diff --git a/custom-completions/README.md b/custom-completions/README.md index 4fedde55d..d651b23f9 100644 --- a/custom-completions/README.md +++ b/custom-completions/README.md @@ -33,3 +33,74 @@ custom-completions// ``` Pin a git revision and path into that folder (or the whole tree). Prefer stable directory names; renames break links and package ids. This repo does not host release zip/tar assets for these trees. + +## Writing completers for the completion engine + +Recent nushell versions run custom commands for completion, show examples as help and give +completers the token under the cursor. Three attributes take advantage of that; each is optional +and an older file keeps working without them. + +### `@non-destructive`: listing helpers that completion may run + +Typing `git-branches | where name == ` offers the branch names, because completion runs the part of +the line before the cursor to see what it gives. A custom command runs for that only if its body +calls nothing but builtin commands that read, or if its author promises it is harmless: + +```nu +# The remotes, one row each: `name` and the fetch `url`. +@non-destructive +@example "The URL of origin" { git-remotes | where name == origin | get url.0 } +export def git-remotes []: nothing -> table { + ^git remote --verbose + | lines + | parse --regex '^(?\S+)\s+(?.+) \((?fetch|push)\)$' + | where direction == fetch + | select name url +} +``` + +Mark only commands that have no lasting effect when run on every keystroke: they write no file, +change no environment (`def --env` is refused whatever it carries), send nothing and install +nothing. `git for-each-ref` and `docker ps` qualify; `git fetch`, `gh api` or anything that fills a +cache file does not. Prefer `git --no-optional-locks status`, `jj --ignore-working-copy` and +`RUSTUP_AUTO_INSTALL=0 cargo metadata` over their plain forms, which can refresh an index, take a +snapshot or fetch a toolchain. A static list needs no attribute. + +Return a table with a `name` column and typed columns (`size: filesize`, `updated: datetime`, +`installed: bool`) so that `where name ==`, `where size >` and `where installed` complete their +values. A completer used as `arg: string@name` returns `value` and `description` columns instead; +build it from the helper (`git-remotes | rename value description`) so the two stay in step. + +### `@interactive`: a completer that owns the terminal + +A completer that drives a picker (`fzf`, `input list`) needs stdin and the TTY, so it must run on +the line-editor thread rather than on the completion worker. Say so with `@interactive`, and take +the `token` record the engine passes: + +```nu +@interactive +def pick-file [token: record] { + ls | get name | to text | ^fzf --query $token.text | lines +} + +def open-file [path: string@pick-file] { open $path } +``` + +An interactive completer is never run in the background, so it cannot also be `@non-destructive`. +Use it only where a picker really is the better answer, since the other completers stay cached and +never block the line editor. `commandline complete --input` shows the record a completer is given +at the cursor, which is how to try one by hand; `commandline complete --explain` shows which +completer produced each candidate. + +### `@example`: help where it is typed + +`@example` works on `def` and on `extern`. For an extern give the code as a string with +`` for the words to replace; completion ranks the examples by how well they fit the +line and puts the chosen one on the command line, ready to have its first placeholder completed. +`--for` ties an example to the flags or parameters it is about, so it is shown where they are typed: + +```nu +@example "Run an example of a package" "cargo run --example -- " --for [--example] +@example "Build with optimizations" "cargo build --release" +export extern "cargo run" [ ... ] +``` diff --git a/custom-completions/ack/ack-completions.nu b/custom-completions/ack/ack-completions.nu index 8478a2687..accd18c79 100644 --- a/custom-completions/ack/ack-completions.nu +++ b/custom-completions/ack/ack-completions.nu @@ -1,66 +1,82 @@ -# copied from auto-generated completions +# Declarative completions for ack, the grep-like source search tool. -export extern "ack" [ - --ignore-case(-i) # Ignore case - --smart-case # Ignore case when pattern contains no uppercase - --no-smart-case # Dont ignore case - --invert-match(-v) # Invert match - --word-regexp(-w) # Match only whole words - --literal(-Q) # Quote all metacharacters - --lines # Only print line(s) NUM of each file - --files-with-matches(-l) # Only print filenames containing matches - --files-without-matches(-L) # Only print filenames with no matches - --output # Output the evaluation of Perl expression for each line - --passthru # Print all lines - --match # Specify pattern explicitly - --max-count(-m) # Stop searching in each file after NUM matches - --with-filename(-H) # Print the filename for each match - --no-filename(-h) # Suppress the prefixing filename on output - --count(-c) # Show number of lines matching per file - --column # Show column number of first match - --no-column # Dont show column number of first match - --print0 # Print null byte as separator between filenames - --pager # Pipes all ack output through command - --no-pager # Do not send output through a pager - --heading # Prints a filename heading above files results - --no-heading # Dont print a filename heading above files results - --break # Print a break between results - --no-break # Dont print a break between results - --group # Filename heading and line break between results - --no-group # No filename heading and no line breaks between results - --color # Highlight the matching text - --no-colour # Dont highlight the matching text - --color-filename # Set the color for filenames - --color-match # Set the color for matches - --color-lineno # Set the color for line numbers - --flush # Flush output immediately - --sort-files # Sort the found files lexically - --show-types # Show which types each file has - --files-from # Read the list of files to search from file - --ignore-directory # Ignore directory - --no-ignore-directory # Dont ignore directory - --ignore-file # Add filter for ignoring files - --recurse(-R) # Recurse into subdirectories - --no-recurse(-n) # No descending into subdirectories - --follow # Follow symlinks - --no-follow # Dont follow symlinks - --known-types(-k) # Include only recognized files - --type # Include only X files - --type-set # Replaces definition of type - --type-add # Specify definition of type - --type-del # Removes all filters associated with type - --no-env # Ignores environment variables and ackrc files - --ackrc # Specifies location of ackrc file - --ignore-ack-defaults # Ignore default definitions ack includes - --create-ackrc # Outputs default ackrc - --help(-?) # Shows help - --help-types # Shows all known types - --dump # Dump information on which options are loaded - --filter # Forces ack to treat input as a pipe - --no-filter # Forces ack to treat input as tty - --man # Shows man page - --version # Displays version and copyright - --thpppt # Bill the Cat - --bar # The warning admiral - ...args -] \ No newline at end of file +export complete [ack] [ + --ignore-case(-i) # Ignore case + --smart-case # Ignore case unless the pattern has uppercase + --no-smart-case # Always respect case + --invert-match(-v) # Select non-matching lines + --word-regexp(-w) # Match only whole words + --literal(-Q) # Quote all metacharacters + --lines: text # Only print the given line(s) of each file + --files-with-matches(-l) # Only print filenames containing matches + --files-without-matches(-L) # Only print filenames with no matches + --output: text # Perl expression evaluated for each matching line + --passthru # Print every line, highlighting matches + --match: text # Specify the pattern explicitly + --max-count(-m): text # Stop searching each file after this many matches + --with-filename(-H) # Print the filename for each match + --no-filename(-h) # Suppress the prefixing filename on output + --count(-c) # Show the number of matching lines per file + --column # Show the column number of the first match + --no-column # Do not show the column number + --print0 # Separate filenames with a null byte + --pager: command # Pipe output through a pager + --no-pager # Do not send output through a pager + --heading # Print a filename heading above file results + --no-heading # Do not print a filename heading + --break # Print a break between results + --no-break # Do not print a break between results + --group # Filename heading and line break between results + --no-group # No filename heading and no line breaks + --color # Highlight the matching text + --no-color # Do not highlight the matching text + --color-filename: text # Colour used for filenames + --color-match: text # Colour used for matches + --color-lineno: text # Colour used for line numbers + --flush # Flush output immediately + --sort-files # Sort the found files lexically + --show-types # Show which types each file has + --files-from: path # Read the list of files to search from a file + --ignore-directory: dir # Ignore this directory + --no-ignore-directory # Do not ignore this directory + --ignore-file: text # Add a filter for ignoring files + --recurse(-R) # Recurse into subdirectories + --no-recurse(-n) # Do not descend into subdirectories + --follow # Follow symlinks + --no-follow # Do not follow symlinks + --known-types(-k) # Include only recognized files + --type: text # Include only files of this type + --type-set: text # Replace the definition of a type + --type-add: text # Add a definition of a type + --type-del: text # Remove all filters associated with a type + --noenv # Ignore environment variables and ackrc files + --ackrc: path # Use this ackrc file + --ignore-ack-defaults # Ignore the default definitions ack includes + --create-ackrc # Output a default ackrc + --help # Show help + --help-types # Show all known types + --dump # Dump which options are loaded + --filter # Treat input as a pipe + --no-filter # Treat input as a tty + --man # Show the man page + --version # Show version and copyright + --thpppt # Bill the Cat + --bar # The warning admiral + pattern?: text # Pattern to search for + ...files: path # Files or directories to search +] where { + excludes --smart-case --no-smart-case + excludes --with-filename --no-filename + at-most-one [--files-with-matches --files-without-matches] + excludes --column --no-column + excludes --pager --no-pager + excludes --heading --no-heading + excludes --break --no-break + excludes --group --no-group + excludes --color --no-color + excludes --recurse --no-recurse + excludes --follow --no-follow + excludes --filter --no-filter + excludes --noenv --ackrc + terminal [--help --help-types --man --version --create-ackrc] +} diff --git a/custom-completions/adb/adb-completions.nu b/custom-completions/adb/adb-completions.nu index 90efe30f9..9a1717a76 100644 --- a/custom-completions/adb/adb-completions.nu +++ b/custom-completions/adb/adb-completions.nu @@ -1,304 +1,367 @@ -def "nu-complete adb one-device-args" [] { - [SERIAL USB] -} - -def "nu-complete adb compression-algorithm" [] { - [any none brotli lz4 zstd] -} - -def "nu-complete adb sync-partations" [] { - [all data odm oem product system system_ext vendor] -} - -def "nu-complete adb wait-for-state" [] { - [-device -recovery -rescue -sideload -bootloader -disconnect] -} - -def "nu-complete adb wait-for-transport" [] { - [-usb -local -any] -} - -def "nu-complete adb reboot-type" [] { - [ - bootloader - recovery - edl - sideload # Reboots into recovery and automatically starts sideload mode. - sideload-auto-reboot - " " - ] -} - -export extern "adb" [ - -a # listen on all network interfaces, not just localhost - -d # use USB device (error if multiple devices connected) - -e # use TCP/IP device (error if multiple TCP/IP devices available) - -s: string # use device with given serial (overrides $ANDROID_SERIAL) - -t: string # use device with given transport id - -H: string # name of adb server host [default=localhost] - -P: int # port of adb server [default=5037] - -L: string # listen on given socket for adb server [default=tcp:localhost:5037] - - --exit-on-write-error # exit if stdout is closed -] - -# Show this help message. -export extern "adb help" [] - -# Show version number. -export extern "adb version" [] - -# Connect to a device via TCP/IP [default PORT=5555]. -export extern "adb connect" [ - host_port: string # Connect to a device via TCP/IP [default PORT=5555]. -] - -# Disconnect from given TCP/IP device [default PORT=5555], or all. -export extern "adb disconnect" [ - host_port?: string # Disconnect device via TCP/IP [default PORT=5555] (disconnect all if no ip given). -] - -# Pair with a device for secure TCP/IP communication. -export extern "adb pair" [ - host_port: string # Connect to a device via TCP/IP [default PORT=5555]. - PAIRING_CODE: string -] - -export extern "adb forward" [ - --list # List all forward socket connections. - --no-rebind - LOCAL_REMOTE: string # Forward socket connection using one of the followings. tcp:PORT (local may be “tcp:0” to pick any open port. localreserved:UNIX_DOMAIN_SOCKET_NAME. localfilesystem:UNIX_DOMAIN_SOCKET_NAME. jdwp:PROCESS PID (remote only). vsock:CID:PORT (remote only). acceptfd:FD (listen only). dev:DEVICE_NAME. dev-raw:DEVICE_NAME. (open device in raw mode)**. - --remove: string # Remove specific forward socket connection. - --remove-all # Remove all forward socket connections. -] - -export extern "adb reverse" [ - --list # List all forward socket connections. - --no-rebind - LOCAL_REMOTE: string # Forward socket connection using one of the followings. tcp:PORT (local may be “tcp:0” to pick any open port. localreserved:UNIX_DOMAIN_SOCKET_NAME. localfilesystem:UNIX_DOMAIN_SOCKET_NAME. jdwp:PROCESS PID (remote only). vsock:CID:PORT (remote only). acceptfd:FD (listen only). dev:DEVICE_NAME. dev-raw:DEVICE_NAME. (open device in raw mode)**. - --remove: string # Remove specific forward socket connection. - --remove-all # Remove all forward socket connections. -] - -export extern "adb mdns" [ - check # Check if mdns discovery is available. - services # List all discovered services. -] - - -# List connected devices. -export extern "adb devices" [ - -l # Use long output. -] - - -# Push a single package to the device and install it -export extern "adb install" [ - Package: string - -r # Replace existing application. - -t # Allow test packages. - -d # Allow version code downgrade (debuggable packages only). - -p # Partial application install (install-multiple only). - -g # Grant all runtime permissions. - --abi:string # Override platform's default ABI. - --instant # Cause the app to be installed as an ephemeral install app. - --no-streaming # Always push APK to device and invoke Package Manager as separate steps. - --streaming # Force streaming APK directly into Package Manager. - --fastdeploy # Use fast deploy. - --no-fastdeploy # Prevent use of fast deploy. - --force-agent # Force update of deployment agent when using fast deploy. - --date-check-agent # Update deployment agent when local version is newer and using fast deploy. - --version-check-agent # Update deployment agent when local version has different version code and using fast deploy. - --local-agent # Locate agent files from local source build (instead of SDK location). See also adb shell pm help for more options. -] - - - -# Push one or more packages to the device and install them atomically -export extern "adb install-multiple" [ - Package: string - -r # Replace existing application. - -t # Allow test packages. - -d # Allow version code downgrade (debuggable packages only). - -p # Partial application install (install-multiple only). - -g # Grant all runtime permissions. - --abi:string # Override platform's default ABI. - --instant # Cause the app to be installed as an ephemeral install app. - --no-streaming # Always push APK to device and invoke Package Manager as separate steps. - --streaming # Force streaming APK directly into Package Manager. - --fastdeploy # Use fast deploy. - --no-fastdeploy # Prevent use of fast deploy. - --force-agent # Force update of deployment agent when using fast deploy. - --date-check-agent # Update deployment agent when local version is newer and using fast deploy. - --version-check-agent # Update deployment agent when local version has different version code and using fast deploy. - --local-agent # Locate agent files from local source build (instead of SDK location). See also adb shell pm help for more options. -] - -export extern "adb install-multi-package" [ - Package: string - -r # Replace existing application. - -t # Allow test packages. - -d # Allow version code downgrade (debuggable packages only). - -p # Partial application install (install-multiple only). - -g # Grant all runtime permissions. - --abi:string # Override platform's default ABI. - --instant # Cause the app to be installed as an ephemeral install app. - --no-streaming # Always push APK to device and invoke Package Manager as separate steps. - --streaming # Force streaming APK directly into Package Manager. - --fastdeploy # Use fast deploy. - --no-fastdeploy # Prevent use of fast deploy. - --force-agent # Force update of deployment agent when using fast deploy. - --date-check-agent # Update deployment agent when local version is newer and using fast deploy. - --version-check-agent # Update deployment agent when local version has different version code and using fast deploy. - --local-agent # Locate agent files from local source build (instead of SDK location). See also adb shell pm help for more options. -] - - -# Remove specified application from the device -export extern "adb uninstall" [ - APPLICATION_ID: string # Remove this APPLICATION_ID from the device. - -k -] - -# Run remote shell command (interactive shell if no command given) -export extern "adb shell" [ - -e # Choose escape character, or “none”; default ‘~’. - -n # Don't read from stdin - -T # Disable pty allocation. - -t # Allocate a pty if on a tty (-tt force pty allocation). - -x # Disable remote exit codes and stdout/stderr separation. - COMMAND?:string # Run emulator console COMMAND -] - - -# Copy local files/directories to device. -export extern "adb push" [ - --sync # Only push files that are newer on the host than the device. - -n # Dry run, push files to device without storing to the filesystem. - -z:string@"nu-complete adb compression-algorithm" # enable compression with a specified algorithm (any/none/brotli/lz4/zstd). - -Z # Disable compression. - -] - -# Copy files/dirs from device -export extern "adb pull" [ - -a # preserve file timestamp and mode. - --sync # Only push files that are newer on the host than the device. - -n # Dry run. Push files to device without storing to the filesystem. - -z:string@"nu-complete adb compression-algorithm" # enable compression with a specified algorithm (any/none/brotli/lz4/zstd). - -Z # Disable compression. - ...remote: string - local: string -] - - -# Sync a local build from $ANDROID_PRODUCT_OUT to the device (default all) -export extern "adb sync" [ - parations: string@"nu-complete adb sync-partations" - -n # Dry run. Push files to device without storing to the filesystem. - -z:string@"nu-complete adb compression-algorithm" # enable compression with a specified algorithm (any/none/brotli/lz4/zstd). - -Z # Disable compression. - -l # List files that would be copied, but don't copy them. -] - -# Ensure that there is a server running. -export extern "adb start-server" [ # only allowed with 'start-server' or 'server nodaemon', - --one-device: string@"nu-complete adb one-device-args" #server will only connect to one USB device, specified by a serial number or USB device address. -] - -# Kill the server if it is running. -export extern "adb kill-server" [] - -# Close connection from host or device side to force reconnect. -export extern "adb reconnect" [ - device?: string -] - -# Close connection from device side to force reconnect. -export extern "adb reconnect device" [] - -# Reset offline/unauthorized devices to force reconnect. -export extern "adb reconnect offline" [] - -# Attach a detached USB device identified by its SERIAL number. -export extern "adb attach" [ - SERIAL: string -] - -# Detach from a USB device identified by its SERIAL to allow use by other processes. -export extern "adb detach" [ - SERIAL: string -] - -# list features supported by adb server. -export extern "adb host-features" [] - -# list features supported by both adb server and device. -export extern "adb features" [] - -# Write bugreport -export extern "adb bugreport" [ - PATH: string # PATH [default=bugreport.zip]; if PATH is a directory, the bug report is saved in that directory. devices that don't support zipped bug reports output to stdout. - -] - -# List pids of processes hosting a JDWP transport. -export extern "adb jdwp" [] - -# Show device log (logcat --help for more). -export extern "adb logcat" [] - -# Disable dm-verity checking on userdebug builds. -export extern "adb disable-verity" [] - -# Re-enable dm-verity checking on userdebug builds. -export extern "adb enable-verity" [] - -# Generate adb public/private key; private key stored in FILE. -export extern "adb keygen" [ - FILE: string -] - -# Wait for device to be in a given state. -export extern "adb wait-for" [ - STATE: string@"nu-complete adb wait-for-state" - TRANSPORT: string@"nu-complete adb wait-for-transport" -] - -# Print offline | bootloader | device. -export extern "adb get-state" [] - -# Print SERIAL_NUMBER. -export extern "adb get-serialno" [] - -# Print DEVICE_PATH. -export extern "adb get-devpath" [] - -# Remount partitions read-write. -export extern "adb remount" [ - -R # Automatically reboot the device. -] - -# Reboot the device; defaults to booting system image but supports bootloader and recovery too. -export extern "adb reboot" [ - type:string@"nu-complete adb reboot-type" -] - -# Sideload the given full OTA package -export extern "adb sideload" [ - OTAPACKAGE: string -] - -# Restart adbd with root permissions. -export extern "adb root" [] - -# Restart adbd without root permissions. -export extern "adb unroot" [] - -# Restart adbd listening on USB. -export extern "adb usb" [] - -# Restart adbd listening on TCP on PORT. -export extern "adb tcpip" [ - PORT:string -] +# Declarative completions for adb, the Android Debug Bridge. + +# `adb forward` / `adb reverse` socket specs: `tcp:8080`, `localabstract:name`, `jdwp:1234`, ... +export syntax adb.socket over chars { + root = proto: until ":" ":" addr: until "" +} + +# Attached devices and emulators, with their state and model. +@non-destructive +export def "nu-complete adb devices" [] { + try { + ^adb devices -l | lines | skip 1 | where {|l| ($l | str trim) != "" } + | parse --regex '^(?\S+)\s+(?\S+)\s*(?.*)$' + | each {|d| + let model = $d.rest | parse --regex 'model:(?\S+)' | get -o 0.m | default "" + {value: $d.serial, description: ($"($d.state) ($model)" | str trim)} + } + } catch { [] } +} + +# Third-party packages installed on the selected device. +@non-destructive +export def "nu-complete adb packages" [] { + try { ^adb shell pm list packages -3 | lines | str replace 'package:' '' | str trim | sort } catch { [] } +} + +# Processes running on the device. +@non-destructive +export def "nu-complete adb device-pids" [] { + try { + ^adb shell ps -A -o PID,NAME | lines | skip 1 | parse --regex '^\s*(?\d+)\s+(?.+)$' + | each {|p| {value: $p.pid, description: $p.name} } + } catch { [] } +} + +# Top-level entries under /sdcard and / on the device, for push/pull targets. +@non-destructive +export def "nu-complete adb device-paths" [] { + try { + ^adb shell 'ls -d /sdcard/* /data/local/tmp /* 2>/dev/null' | lines | str trim | where {|p| $p != "" } + } catch { [] } +} + +@non-destructive +export def "nu-complete adb socket-protocols" [] { + try { + [ + {value: tcp, description: "TCP port"} + {value: localabstract, description: "Unix abstract socket name"} + {value: localreserved, description: "Unix reserved socket name"} + {value: localfilesystem, description: "Unix filesystem socket name"} + {value: dev, description: "Character device name"} + {value: jdwp, description: "Process pid (remote only)"} + {value: vsock, description: "VM socket CID:port"} + {value: acceptfd, description: "Listening socket fd (forward only)"} + ] + } catch { [] } +} + +# Android Debug Bridge +export complete [adb] [ + -a # Listen on all network interfaces, not just localhost + -d # Use the USB device (error if multiple devices are connected) + -e # Use the TCP/IP device (error if multiple TCP/IP devices are available) + -s: by "nu-complete adb devices" # Use the device with this serial (overrides $ANDROID_SERIAL) + -t: text # Use the device with this transport id + -H: hosts # Name of the adb server host [default=localhost] + -P: text # Port of the adb server [default=5037] + -L: text # Listen on this socket for the adb server [default=tcp:localhost:5037] + --one-device: by "nu-complete adb devices" # Server will only connect to this USB device + --exit-on-write-error # Exit if stdout is closed + --help(-h) # Show help + --version # Show version +] where { + at-most-one [-d -e -s -t] + terminal [--help --version] +} + +# Show help +export complete [adb help] [] + +# Show version number +export complete [adb version] [] + +# List connected devices +export complete [adb devices] [ + -l # Long output +] + +# Connect to a device via TCP/IP [default PORT=5555] +export complete [adb connect] [ + host: hosts # HOST[:PORT] +] + +# Disconnect from a TCP/IP device, or from all of them +export complete [adb disconnect] [ + host?: by "nu-complete adb devices" # HOST[:PORT] (all devices if omitted) +] + +# Pair with a device for secure TCP/IP communication +export complete [adb pair] [ + host: hosts # HOST[:PORT] + code?: text # Pairing code +] + +# Forward socket connections from the host to the device +export complete [adb forward] [ + --list # List all forward socket connections + --no-rebind # Fail if the local port is already forwarded + --remove: adb.socket with { root.proto: by "nu-complete adb socket-protocols" } # Remove this forward + --remove-all # Remove all forward socket connections + local?: adb.socket with { root.proto: by "nu-complete adb socket-protocols" } # Host side, e.g. tcp:8080 + remote?: adb.socket with { root.proto: by "nu-complete adb socket-protocols" } # Device side, e.g. tcp:8080 +] where { + at-most-one [--list --remove --remove-all] + excludes --no-rebind --list + excludes --no-rebind --remove-all +} + +# Reverse socket connections from the device to the host +export complete [adb reverse] [ + --list # List all reverse socket connections + --no-rebind # Fail if the remote port is already reversed + --remove: adb.socket with { root.proto: by "nu-complete adb socket-protocols" } # Remove this reverse + --remove-all # Remove all reverse socket connections + remote?: adb.socket with { root.proto: by "nu-complete adb socket-protocols" } # Device side, e.g. tcp:8080 + local?: adb.socket with { root.proto: by "nu-complete adb socket-protocols" } # Host side, e.g. tcp:8080 +] where { + at-most-one [--list --remove --remove-all] + excludes --no-rebind --list + excludes --no-rebind --remove-all +} + +# mDNS discovery of devices +export complete [adb mdns] [ + command?: words [check: "Check whether mdns discovery is available" services: "List discovered services"] +] + +# Push a single package to the device and install it +export complete [adb install] [ + -r # Replace the existing application + -t # Allow test packages + -d # Allow version code downgrade (debuggable packages only) + -g # Grant all runtime permissions + --abi: words [arm64-v8a armeabi-v7a x86 x86_64] # Override the platform's default ABI + --instant # Install as an ephemeral instant app + --no-streaming # Push the APK, then invoke Package Manager separately + --streaming # Stream the APK directly into Package Manager + --fastdeploy # Use fast deploy + --no-fastdeploy # Do not use fast deploy + --force-agent # Force update of the fast deploy agent + --date-check-agent # Update the agent when the local one is newer + --version-check-agent # Update the agent when its version code differs + --local-agent # Use agent files from a local source build + package: path # The APK to install +] where { + excludes --streaming --no-streaming + excludes --fastdeploy --no-fastdeploy + at-most-one [--force-agent --date-check-agent --version-check-agent] +} + +# Push one or more packages to the device and install them atomically +export complete [adb install-multiple] [ + -r # Replace the existing application + -t # Allow test packages + -d # Allow version code downgrade (debuggable packages only) + -p # Partial application install + -g # Grant all runtime permissions + --abi: words [arm64-v8a armeabi-v7a x86 x86_64] # Override the platform's default ABI + --instant # Install as an ephemeral instant app + --no-streaming # Push the APKs, then invoke Package Manager separately + --streaming # Stream the APKs directly into Package Manager + ...packages: path # The APKs (splits) to install +] where { + excludes --streaming --no-streaming +} + +# Push one or more packages to the device and install them atomically, as separate apps +export complete [adb install-multi-package] [ + -r # Replace the existing application + -t # Allow test packages + -d # Allow version code downgrade (debuggable packages only) + -p # Partial application install + -g # Grant all runtime permissions + --abi: words [arm64-v8a armeabi-v7a x86 x86_64] # Override the platform's default ABI + --instant # Install as an ephemeral instant app + ...packages: path # The APKs or APEXes to install +] + +# Remove an application from the device +export complete [adb uninstall] [ + -k # Keep the data and cache directories + package: by "nu-complete adb packages" # The application id to remove +] + +# Run a remote shell command (interactive shell if no command is given) +export complete [adb shell] [ + -e: text # Escape character, or "none" (default ~) + -n # Don't read from stdin + -T # Disable pty allocation + -t # Allocate a pty if on a tty (-tt forces it) + -x # Disable remote exit codes and stdout/stderr separation + ...command: command # The remote command and its arguments +] where { + excludes -T -t +} + +# Run a command on the device without a shell (via exec) +export complete [adb exec-out] [ + ...command: command # The remote command and its arguments +] + +# Copy local files or directories to the device +export complete [adb push] [ + --sync # Only push files that are newer on the host than on the device + -n # Dry run: push to the device without storing to the filesystem + -z: words [any none brotli lz4 zstd] # Compression algorithm + -Z # Disable compression + ...paths: path # LOCAL... REMOTE +] where { + excludes -z -Z +} + +# Copy files or directories from the device +export complete [adb pull] [ + -a # Preserve the file timestamp and mode + -z: words [any none brotli lz4 zstd] # Compression algorithm + -Z # Disable compression + ...paths: by "nu-complete adb device-paths" # REMOTE... [LOCAL] +] where { + excludes -z -Z +} + +# Sync a local build from $ANDROID_PRODUCT_OUT to the device (default all) +export complete [adb sync] [ + -n # Dry run + -l # List the files that would be copied, without copying them + -z: words [any none brotli lz4 zstd] # Compression algorithm + -Z # Disable compression + partition?: words [all data odm oem product system system_ext vendor] # Partition to sync +] where { + excludes -z -Z +} + +# Show the device log +export complete [adb logcat] [ + -b: words [main system radio events crash default all kernel] # Buffer to show + -c # Clear the log and exit + -d # Dump the log and exit + -e: text # Only print lines matching this regex + -f: path # Log to this file instead of stdout + -g # Print the size of the log buffer and exit + -s # Set the default filter to silent + -t: text # Print only the most recent lines (count or time) + -T: text # Print the most recent lines without exiting + -v: words [brief long process raw tag thread threadtime time color epoch monotonic uid usec UTC year zone] # Output format + --pid: by "nu-complete adb device-pids" # Only print logs from this process + --regex: text # Only print lines matching this regex + --uid: text # Only print logs from these uids + --max-count(-m): text # Quit after printing this many lines + --clear # Clear the log and exit + --dump # Dump the log and exit + ...filters: text # TAG:PRIORITY filter specs, e.g. ActivityManager:I *:S +] where { + at-most-one [-c -d -g --clear --dump] + excludes -f -d +} + +# Ensure that there is a server running +export complete [adb start-server] [] + +# Kill the server if it is running +export complete [adb kill-server] [] + +# Close the connection to force a reconnect +export complete [adb reconnect] [ + side?: words [device: "Close from the device side" offline: "Reset offline/unauthorized devices"] +] + +# Attach a detached USB device +export complete [adb attach] [ + serial?: by "nu-complete adb devices" # The device serial +] + +# Detach from a USB device to allow use by other processes +export complete [adb detach] [ + serial?: by "nu-complete adb devices" # The device serial +] + +# List features supported by the adb server +export complete [adb host-features] [] + +# List features supported by both the adb server and the device +export complete [adb features] [] + +# Write a bugreport +export complete [adb bugreport] [ + path?: path # Where to write the report (bugreport.zip by default) +] + +# List pids of processes hosting a JDWP transport +export complete [adb jdwp] [] + +# Disable dm-verity checking on userdebug builds +export complete [adb disable-verity] [] + +# Re-enable dm-verity checking on userdebug builds +export complete [adb enable-verity] [] + +# Generate an adb public/private key pair +export complete [adb keygen] [ + file: path # Where to store the private key +] + +# Wait for a device to be in the given state (wait-for[-TRANSPORT]-STATE) +export complete [adb wait-for-device] [] +export complete [adb wait-for-recovery] [] +export complete [adb wait-for-rescue] [] +export complete [adb wait-for-sideload] [] +export complete [adb wait-for-bootloader] [] +export complete [adb wait-for-disconnect] [] +export complete [adb wait-for-usb-device] [] +export complete [adb wait-for-local-device] [] +export complete [adb wait-for-any-device] [] + +# Print offline | bootloader | device +export complete [adb get-state] [] + +# Print the serial number +export complete [adb get-serialno] [] + +# Print the device path +export complete [adb get-devpath] [] + +# Remount partitions read-write +export complete [adb remount] [ + -R # Reboot the device automatically if needed +] + +# Reboot the device (system by default) +export complete [adb reboot] [ + target?: words [bootloader: "Boot into the bootloader" recovery: "Boot into recovery" sideload: "Recovery and start sideload mode" sideload-auto-reboot: "Sideload, then reboot" fastboot: "Boot into fastbootd" edl: "Emergency download mode"] +] + +# Sideload the given full OTA package +export complete [adb sideload] [ + package: path # The full OTA package +] + +# Restart adbd with root permissions +export complete [adb root] [] + +# Restart adbd without root permissions +export complete [adb unroot] [] + +# Restart adbd listening on USB +export complete [adb usb] [] + +# Restart adbd listening on TCP on PORT +export complete [adb tcpip] [ + port: text # Port to listen on (usually 5555) +] + +# Run an emulator console command +export complete [adb emu] [ + ...command: text # The emulator console command +] diff --git a/custom-completions/aerospace/aerospace-completions.nu b/custom-completions/aerospace/aerospace-completions.nu index 4ffe90890..ec0d72fc0 100644 --- a/custom-completions/aerospace/aerospace-completions.nu +++ b/custom-completions/aerospace/aerospace-completions.nu @@ -1,448 +1,417 @@ -# AeroSpace is an i3-like tiling window manager for macOS -export extern "aerospace" [ - command?:string - --help(-h) # Print help - --version(-v) # Print the current version -] +# Declarative completions for AeroSpace, the i3-like tiling window manager for macOS. -def "nu-complete aerospace-list-all-workspaces" [] { - ^aerospace list-workspaces --all - | lines +# `--format` strings such as `%{window-id} | %{app-name}`. +export syntax aerospace.format over chars { + root = (lit: until "%" | "%{" var: until "}" "}")* } -# Balance sizes of all windows in the current workspace -export extern "aerospace balance-sizes" [ - --help(-h) # Print help - --workspace:int@"nu-complete aerospace-list-all-workspaces" # Act on the specified workspace instead of the focused workspace -] - -def "nu-complete aerospace-list-all-windows" [] { - aerospace list-windows --all - | lines - | split column "|" -n 3 - | rename window-id application title - | str trim +@non-destructive +export def "nu-complete aerospace workspaces" [] { + try { ^aerospace list-workspaces --all | lines } catch { [] } } -# Close the focused window. -export extern "aerospace close" [ - --help(-h) # Print help - --quit-if-last-window # Quit the app instead of closing if it's the last window of the app - --window-id:int@"nu-complete aerospace-list-all-windows" # Act on the specified window instead of the focused window -] - -# On the focused workspace, close all windows but current -export extern "aerospace close-all-windows-but-current" [ - --help(-h) # Print help - --quit-if-last-window # Quit the apps instead of closing them if it's their last window -] +# Workspace names plus the relative targets `workspace` / `move-node-to-workspace` accept. +@non-destructive +export def "nu-complete aerospace workspace-targets" [] { + try { + [{value: next, description: "Next workspace"} {value: prev, description: "Previous workspace"}] + | append (try { ^aerospace list-workspaces --all | lines | each {|w| {value: $w, description: "workspace"} } } catch { [] }) + } catch { [] } +} -# Query AeroSpace config options -export extern "aerospace config" [ - --help(-h) # Print help - --get:string # Get the value for a given key. You can inspect available keys with --major-keys or --all-keys - --major-keys # Print major keys - --all-keys # Print all available keys recursively - --config-path # Print absolute path to the loaded config -] +@non-destructive +export def "nu-complete aerospace windows" [] { + try { + ^aerospace list-windows --all --format '%{window-id}|%{app-name}|%{window-title}' | lines + | parse '{id}|{app}|{title}' + | each {|w| {value: ($w.id | str trim), description: $"($w.app | str trim): ($w.title | str trim)"} } + } catch { [] } +} -def "nu-complete aerospace-config-list-all-keys" [] { - aerospace config --all-keys - | lines +@non-destructive +export def "nu-complete aerospace config-keys" [] { + try { ^aerospace config --all-keys | lines } catch { [] } } +@non-destructive +export def "nu-complete aerospace modes" [] { + try { ^aerospace list-modes | lines } catch { [] } +} -# Interactive command to record Accessibility API debug information to create bug reports -export extern "aerospace debug-windows" [ - --help(-h) # Print help - --window-id:int@"nu-complete aerospace-list-all-windows" # Print debug information of the specified window right away. Usage of this flag disables interactive mode -] +# Directions, relative targets, monitor numbers and names. +@non-destructive +export def "nu-complete aerospace monitors" [] { + try { + let fixed = [left down up right next prev main secondary all focused mouse] | each {|d| {value: $d, description: "target"} } + let mons = try { + ^aerospace list-monitors --format '%{monitor-id}|%{monitor-name}' | lines | parse '{id}|{name}' + | each {|m| {value: ($m.id | str trim), description: ($m.name | str trim)} } + } catch { [] } + $fixed | append $mons + } catch { [] } +} -def "nu-complete aerospace-enable" [] { - ['toggle', 'on', 'off'] +@non-destructive +export def "nu-complete aerospace format-vars" [] { + try { + [window-id window-title window-is-fullscreen window-layout app-bundle-id app-name app-pid app-exec-path + app-bundle-path workspace workspace-is-focused workspace-is-visible workspace-root-container-layout + monitor-id monitor-appkit-nsscreen-screens-id monitor-name monitor-is-main right-padding newline tab] + } catch { [] } } -# Temporarily disable window management -export extern "aerospace enable" [ - --help(-h) # Print help - command:string@"nu-complete aerospace-enable" -] +# AeroSpace is an i3-like tiling window manager for macOS +export complete [aerospace] [ + --help(-h) # Print help + --version(-v) # Print the current version + command?: words [balance-sizes close close-all-windows-but-current config debug-windows enable exec-and-forget flatten-workspace-tree focus focus-back-and-forth focus-monitor fullscreen join-with layout list-apps list-exec-env-vars list-modes list-monitors list-windows list-workspaces macos-native-fullscreen macos-native-minimize mode move move-mouse move-node-to-monitor move-node-to-workspace move-workspace-to-monitor reload-config resize split summon-workspace trigger-binding volume workspace workspace-back-and-forth] +] where { + terminal [--help --version] +} -# Run /bin/bash -c '', and don’t wait for the command termination. Stdout, stderr and exit code are ignored. -export extern "aerospace exec-and-forget" [ - command:string -] +# Balance sizes of all windows in the current workspace +export complete [aerospace balance-sizes] [ + --help(-h) # Print help + --workspace: by "nu-complete aerospace workspaces" # Act on the specified workspace instead of the focused workspace +] where { + terminal [--help] +} -# Flatten the tree of the focused workspace -export extern "aerospace flatten-workspace-tree" [ - --help(-h) # Print help - --workspace:int@"nu-complete aerospace-list-all-workspaces" # Act on the specified workspace instead of the focused workspace -] +# Close the focused window. +export complete [aerospace close] [ + --help(-h) # Print help + --quit-if-last-window # Quit the app instead of closing if it's the last window of the app + --window-id: by "nu-complete aerospace windows" # Act on the specified window instead of the focused window +] where { + terminal [--help] +} -def "nu-complete aerospace-focus" [] { - ['left','down','up','right'] +# On the focused workspace, close all windows but current +export complete [aerospace close-all-windows-but-current] [ + --help(-h) # Print help + --quit-if-last-window # Quit the apps instead of closing them if it's their last window +] where { + terminal [--help] } -# Set focus to the nearest window in the given direction -export extern "aerospace focus" [ - --help(-h) # Print help - command?:string@"nu-complete aerospace-focus" - --window-id:int@"nu-complete aerospace-list-all-windows" - --dfs-index:int - # --dfs-index:int@"nu-complete aerospace-list-dfs-indices" -] +# Query AeroSpace config options +export complete [aerospace config] [ + --help(-h) # Print help + --get: by "nu-complete aerospace config-keys" # Get the value for a given key. You can inspect available keys with --major-keys or --all-keys + --major-keys # Print major keys + --all-keys # Print all available keys recursively + --config-path # Print absolute path to the loaded config +] where { + at-most-one [--get --major-keys --all-keys --config-path] + terminal [--help] +} -def "nu-complete aerospace-focus-boundaries" [] { - ['workspace', 'all-monitors-outer-frame'] +# Interactive command to record Accessibility API debug information to create bug reports +export complete [aerospace debug-windows] [ + --help(-h) # Print help + --window-id: by "nu-complete aerospace windows" # Print debug information of the specified window right away. Usage of this flag disables interactive mode +] where { + terminal [--help] } -def "nu-complete aerospace-focus-boundaries-action" [] { - ['stop', 'wrap-around-the-workspace', 'wrap-around-all-monitors'] +# Temporarily disable window management +export complete [aerospace enable] [ + --help(-h) # Print help + command: words [toggle on off] +] where { + terminal [--help] } -# Switch between the current and previously foxused elements back and forth. The element is either a window or an empty workspace -export extern "aerospace focus-back-and-forth" [ - --help(-h) # Print help +# Run /bin/bash -c '', and don’t wait for the command termination. Stdout, stderr and exit code are ignored. +export complete [aerospace exec-and-forget] [ + ...command: command # Shell command to run with /bin/bash -c ] -def "nu-complete aerospace-focus-monitor-numbers" [] { - ^aerospace list-monitors -count - | 1..$in - | into string +# Flatten the tree of the focused workspace +export complete [aerospace flatten-workspace-tree] [ + --help(-h) # Print help + --workspace: by "nu-complete aerospace workspaces" # Act on the specified workspace instead of the focused workspace +] where { + terminal [--help] } -def "nu-complete aerospace-focus-monitor-regex" [] { - ^aerospace list-monitors - | parse "{number} | {name}" - | str trim - | get name +# Set focus to the nearest window in the given direction +export complete [aerospace focus] [ + --help(-h) # Print help + --window-id: by "nu-complete aerospace windows" + --dfs-index: text + command?: words [left down up right] +] where { + at-most-one [--window-id --dfs-index] + terminal [--help] } -def "nu-complete aerospace-focus-monitor" [] { - [ - 'left', - 'down', - 'up', - 'right', - 'next', - 'prev', - 'main', - 'secondary', - ...(nu-complete aerospace-focus-monitor-numbers), - ...(nu-complete aerospace-focus-monitor-regex) - ] +# Switch between the current and previously foxused elements back and forth. The element is either a window or an empty workspace +export complete [aerospace focus-back-and-forth] [ + --help(-h) # Print help +] where { + terminal [--help] } # Focus monitor by relative direction, by order, or by pattern -export extern "aerospace focus-monitor" [ - --help(-h) # Print help - command:string@"nu-complete aerospace-focus-monitor" -] - - -def "nu-complete aerospace-fullscreen" [] { - [ - "on", - "off" - ] +export complete [aerospace focus-monitor] [ + --help(-h) # Print help + command: by "nu-complete aerospace monitors" +] where { + terminal [--help] } # Toggle the fullscreen mode for the focused window -export extern "aerospace fullscreen" [ - --help(-h) # Print help - --no-outer-gaps # Remove the outer gaps when in fullscreen mode - --window-id:int@"nu-complete aerospace-list-all-windows" # Act on the specified window instead of the focues window - command?:string@"nu-complete aerospace-fullscreen" -] - - -def "nu-complete aerospace-join-with" [] { - [ - "left", - "down", - "up", - "right" - ] +export complete [aerospace fullscreen] [ + --help(-h) # Print help + --no-outer-gaps # Remove the outer gaps when in fullscreen mode + --window-id: by "nu-complete aerospace windows" # Act on the specified window instead of the focues window + command?: words [on off] +] where { + terminal [--help] } # Put the focused window and the nearest node in the specified direction under a common parent container -export extern "aerospace join-with" [ - --help(-h) # Print help - --window-id:int@"nu-complete aerospace-list-all-windows" # Act on the specified window instead of the focues window - command:string@"nu-complete aerospace-join-with" -] - -def "nu-complete aerospace-layout" [] { - [ - "h_tiles", - "v_tiles", - "h_accordion", - "v_accordion", - "tiles", - "accordion", - "horizontal", - "vertical", - "tiling", - "floating" - ] +export complete [aerospace join-with] [ + --help(-h) # Print help + --window-id: by "nu-complete aerospace windows" # Act on the specified window instead of the focues window + command: words [left down up right] +] where { + terminal [--help] } # Change layout of the focused window to the given layout -export extern "aerospace layout" [ - --help(-h) # Print help - --window-id:int@"nu-complete aerospace-list-all-windows" # Act on the specified window instead of the focues window - # TODO: find a way to support multiple options - command:string@"nu-complete aerospace-layout" -] - -def "nu-complete aerospace-output-format-apps" [] { - # TODO: actually implement. +export complete [aerospace layout] [ + --help(-h) # Print help + --window-id: by "nu-complete aerospace windows" # Act on the specified window instead of the focues window + command: words [h_tiles v_tiles h_accordion v_accordion tiles accordion horizontal vertical tiling floating] +] where { + terminal [--help] } # Print the list of running applications that appears in the Dock and may have a user interface -export extern "aerospace list-apps" [ - --help(-h) # Print help - --macos-native-hidden # Filter results to on ly print hidden applications. [no] inverts the condition - --format:string # Specify output format. See "Output Format" section for more details. Incompatible with --count - # --format:string@"nu-complete aerospace-output-format-apps" # Specify output format. See "Output Format" section for more details. Incompatible with --count - --count # Output only the number of apps. Incompatible with --format, --json - --json # Output in JSON format. Can be used in combination with --format to specify which data to include into the json. Incompatible with --count -] +export complete [aerospace list-apps] [ + --help(-h) # Print help + --macos-native-hidden # Filter results to on ly print hidden applications. [no] inverts the condition + --format: aerospace.format with { root.var: by "nu-complete aerospace format-vars" } # Specify output format. See "Output Format" section for more details. Incompatible with --count + --count # Output only the number of apps. Incompatible with --format, --json + --json # Output in JSON format. Can be used in combination with --format to specify which data to include into the json. Incompatible with --count +] where { + excludes --count --format + excludes --count --json + terminal [--help] +} # List environment variables that exec-* commands and callbacks are run with -export extern "aerospace list-exec-env-vars" [ - --help(-h) # Print help -] +export complete [aerospace list-exec-env-vars] [ + --help(-h) # Print help +] where { + terminal [--help] +} # Print a list of modes currently specified in the configuration -export extern "aerospace list-modes" [ - --help(-h) # Print help - --current # only print the currently active mode -] - -def "nu-complete aerospace-output-format-monitors" [] { - # TODO: actually implement. +export complete [aerospace list-modes] [ + --help(-h) # Print help + --current # only print the currently active mode +] where { + terminal [--help] } # Print monitors that satisfy conditions -export extern "aerospace list-monitors" [ - --help(-h) # Print help - --focused # Filter results to only print the focused monitor. [no] inverts the condition - --mouse # Filter results to only print the monitor with the mouse. [no] inverts the condition - --format:string # Specify output format. See "Output Format" section for more details. Incompatible with --count - # --format:string@"nu-complete aerospace-output-format-monitors" # Specify output format. See "Output Format" section for more details. Incompatible with --count - --count # Output only the number of workspaces. Incompatible with --format, --json - --json # Output in JSON format. Can be used in combination with --format to specify which data to include into the json. Incompatible with --count -] - -def "nu-complete aerospace-output-format-windows" [] { - # TODO: actually implement. +export complete [aerospace list-monitors] [ + --help(-h) # Print help + --focused # Filter results to only print the focused monitor. [no] inverts the condition + --mouse # Filter results to only print the monitor with the mouse. [no] inverts the condition + --format: aerospace.format with { root.var: by "nu-complete aerospace format-vars" } # Specify output format. See "Output Format" section for more details. Incompatible with --count + --count # Output only the number of workspaces. Incompatible with --format, --json + --json # Output in JSON format. Can be used in combination with --format to specify which data to include into the json. Incompatible with --count +] where { + excludes --count --format + excludes --count --json + terminal [--help] } # Print windows that satisfy conditions -export extern "aerospace list-windows" [ - --help(-h) # Print help - --all # Alias for --monitor all. Use with caution. Check `man aerospace-list-windows` for more details. - --focused # Print the focused window. Please note that it is possible for no window to be in focus. In that case, an error is reported. - # TODO: create completions for these two - --workspace #Filter results to print windows that belong to either of specified workspaces. - --monitor #Filter results to print windows that belong to either of specified monitors. - --pid #Filter results to only print windows that belong to the Application with specified - --app-bundle-id #Filter results to only print windows that belong to the Application with specified Bundle ID - --format:string # Specify output format. See "Output Format" section for more details. Incompatible with --count - # --format:string@"nu-complete aerospace-output-format-windows" # Specify output format. See "Output Format" section for more details. Incompatible with --count - --count # Output only the number of workspaces. Incompatible with --format, --json - --json # Output in JSON format. Can be used in combination with --format to specify which data to include into the json. Incompatible with --count -] +export complete [aerospace list-windows] [ + --help(-h) # Print help + --all # Alias for --monitor all. Use with caution. Check `man aerospace-list-windows` for more details. + --focused # Print the focused window. Please note that it is possible for no window to be in focus. In that case, an error is reported. + --workspace: by "nu-complete aerospace workspaces" # Filter results to print windows that belong to either of specified workspaces. + --monitor: by "nu-complete aerospace monitors" # Filter results to print windows that belong to either of specified monitors. + --pid: pids # Filter results to only print windows that belong to the Application with specified + --app-bundle-id # Filter results to only print windows that belong to the Application with specified Bundle ID + --format: aerospace.format with { root.var: by "nu-complete aerospace format-vars" } # Specify output format. See "Output Format" section for more details. Incompatible with --count + --count # Output only the number of workspaces. Incompatible with --format, --json + --json # Output in JSON format. Can be used in combination with --format to specify which data to include into the json. Incompatible with --count +] where { + excludes --count --format + excludes --count --json + at-most-one [--all --focused --workspace --monitor] + terminal [--help] +} # Print workspaces that satisfy conditions -export extern "aerospace list-workspaces" [ - --help(-h) # Print help - --all # Alias for --monitor all. Use with caution. Check `man aerospace-list-windows` for more details. - --focused # Alias for --monitor focused --visible. Always prints a single workspace - # TODO: create completion for --monitor - --monitor # Filter results to print windows that belong to either of specified monitors. - --visible # Filter results to only print currently visible workspaces. [no] inverts the condition. Several workspaces can be visible in multi-monitor setup - --empty # Filter results to only print empty workspaces. [no] inverts the condition. - --format:string # Specify output format. See "Output Format" section for more details. Incompatible with --count - # --format:string@"nu-complete aerospace-output-format-windows" # Specify output format. See "Output Format" section for more details. Incompatible with --count - --count # Output only the number of workspaces. Incompatible with --format, --json - --json # Output in JSON format. Can be used in combination with --format to specify which data to include into the json. Incompatible with --count -] - -def "nu-complete aerospace-macos-native-fullscreen" [] { - [ - "on", - "off" - ] +export complete [aerospace list-workspaces] [ + --help(-h) # Print help + --all # Alias for --monitor all. Use with caution. Check `man aerospace-list-windows` for more details. + --focused # Alias for --monitor focused --visible. Always prints a single workspace + --monitor: by "nu-complete aerospace monitors" # Filter results to print windows that belong to either of specified monitors. + --visible # Filter results to only print currently visible workspaces. [no] inverts the condition. Several workspaces can be visible in multi-monitor setup + --empty # Filter results to only print empty workspaces. [no] inverts the condition. + --format: aerospace.format with { root.var: by "nu-complete aerospace format-vars" } # Specify output format. See "Output Format" section for more details. Incompatible with --count + --count # Output only the number of workspaces. Incompatible with --format, --json + --json # Output in JSON format. Can be used in combination with --format to specify which data to include into the json. Incompatible with --count +] where { + excludes --count --format + excludes --count --json + at-most-one [--all --focused --monitor] + terminal [--help] } # Toggle macOS fullscreen for the focused window -export extern "aerospace macos-native-fullscreen" [ - --help(-h) # Print help - --window-id:int@"nu-complete aerospace-list-all-windows" # Act on the specified window instead of the focused window - command?:string@"nu-complete aerospace-macos-native-fullscreen" -] +export complete [aerospace macos-native-fullscreen] [ + --help(-h) # Print help + --window-id: by "nu-complete aerospace windows" # Act on the specified window instead of the focused window + command?: words [on off] +] where { + terminal [--help] +} # Minimize focused window -export extern "aerospace macos-native-minimize" [ - --help(-h) # Print help - --window-id:int@"nu-complete aerospace-list-all-windows" # Act on the specified window instead of the focused window -] - -def "nu-complete aerospace-binding-mode" [] { - ^aerospace list-modes - | lines +export complete [aerospace macos-native-minimize] [ + --help(-h) # Print help + --window-id: by "nu-complete aerospace windows" # Act on the specified window instead of the focused window +] where { + terminal [--help] } # Activate the specified binding mode -export extern "aerospace mode" [ - --help(-h) # Print help - command:string@"nu-complete aerospace-binding-mode" -] - -def "nu-complete aerospace-move" [] { - [ - "left", - "down", - "up", - "right" - ] +export complete [aerospace mode] [ + --help(-h) # Print help + command: by "nu-complete aerospace modes" +] where { + terminal [--help] } # Move the focused window in the given direction -export extern "aerospace move" [ - --help(-h) # Print help - command:string@"nu-complete aerospace-move" - --window-id:int@"nu-complete aerospace-list-all-windows" # Act on the specified window instead of the focused window -] - -def "nu-complete aerospace-move-mouse" [] { - [ - "monitor-lazy-center", - "monitor-force-center", - "window-lazy-center", - "window-force-center" - ] +export complete [aerospace move] [ + --help(-h) # Print help + --window-id: by "nu-complete aerospace windows" # Act on the specified window instead of the focused window + command: words [left down up right] +] where { + terminal [--help] } # Move mouse to the requested position -export extern "aerospace move-mouse" [ - --help(-h) # Print help - command:string@"nu-complete aerospace-move-mouse" -] +export complete [aerospace move-mouse] [ + --help(-h) # Print help + command: words [monitor-lazy-center monitor-force-center window-lazy-center window-force-center] +] where { + terminal [--help] +} # Move window to monitor targeted by relative direction, by order, or by pattern -export extern "aerospace move-node-to-monitor" [ - --help(-h) # Print help - --wrap-around # Make it possible to jump between first and last workspaces using (next|prev) +export complete [aerospace move-node-to-monitor] [ + --help(-h) # Print help + --wrap-around # Make it possible to jump between first and last workspaces using (next|prev) --fail-if-noop # Exit with non-zero code if moving a window to a workspace it already belongs to - --focus-follows-window #Make sure that the window in question receives focus after moving. - --window-id:int@"nu-complete aerospace-list-all-windows" # Act on the specified window instead of the focused window - command:string -] + --focus-follows-window # Make sure that the window in question receives focus after moving. + --window-id: by "nu-complete aerospace windows" # Act on the specified window instead of the focused window + command: by "nu-complete aerospace monitors" +] where { + terminal [--help] +} # Move the focused window to the specified workspace -export extern "aerospace move-node-to-workspace" [ - --help(-h) # Print help - --wrap-around # Make it possible to jump between first and last workspaces using (next|prev) +export complete [aerospace move-node-to-workspace] [ + --help(-h) # Print help + --wrap-around # Make it possible to jump between first and last workspaces using (next|prev) --fail-if-noop # Exit with non-zero code if moving a window to a workspace it already belongs to - --focus-follows-window #Make sure that the window in question receives focus after moving. - --window-id:int@"nu-complete aerospace-list-all-windows" # Act on the specified window instead of the focused window - command:string -] + --focus-follows-window # Make sure that the window in question receives focus after moving. + --window-id: by "nu-complete aerospace windows" # Act on the specified window instead of the focused window + command: by "nu-complete aerospace workspace-targets" +] where { + terminal [--help] +} # Move workspace to monitor targeted by relative direction, by order, or by pattern. Focus follows the focused workspace, so the workspace stays focused. -export extern "aerospace move-workspace-to-monitor" [ - --help(-h) # Print help - --wrap-around # Make it possible to jump between first and last monitors - --workspace # Act on the specified workspace instead of the focused workspace -] +export complete [aerospace move-workspace-to-monitor] [ + --help(-h) # Print help + --wrap-around # Make it possible to jump between first and last monitors + --workspace: by "nu-complete aerospace workspaces" # Act on the specified workspace instead of the focused workspace + command?: by "nu-complete aerospace monitors" # Monitor to move the workspace to +] where { + terminal [--help] +} # Reload currently active config -export extern "aerospace reload-config" [ - --help(-h) # Print help - --no-gui # Don't open GUI to show error. Only use stdout to report errors - --dry-run # Validate the config and show errors (if any) but don't reload the config -] - -def "nu-complete aerospace-resize" [] { - [ - "smart", - "smart-opposite", - "width", - "height", - ] +export complete [aerospace reload-config] [ + --help(-h) # Print help + --no-gui # Don't open GUI to show error. Only use stdout to report errors + --dry-run # Validate the config and show errors (if any) but don't reload the config +] where { + terminal [--help] } # Resize the focused window -export extern "aerospace-resize" [ - --help(-h) # Print help - --window-id:int@"nu-complete aerospace-list-all-windows" # Act on the specified window instead of the focused window - command:string@"nu-complete aerospace-resize" -] - -def "nu-complete aerospace-split" [] { - [ - "horizontal", - "vertical", - "opposite" - ] +export complete [aerospace resize] [ + --help(-h) # Print help + --window-id: by "nu-complete aerospace windows" # Act on the specified window instead of the focused window + command: words [smart smart-opposite width height] +] where { + terminal [--help] } # split command exist solely for compatibility with i3. Unless you’re hardcore i3 user who knows what they are doing, it’s recommended to use join-with -export extern "aerospace split" [ - --help(-h) # Print help - --window-id:int@"nu-complete aerospace-list-all-windows" # Act on the specified window instead of the focused window - command:string@"nu-complete aerospace-split" -] +export complete [aerospace split] [ + --help(-h) # Print help + --window-id: by "nu-complete aerospace windows" # Act on the specified window instead of the focused window + command: words [horizontal vertical opposite] +] where { + terminal [--help] +} # Move the requested workspace to the focused monitor. The moved workspace becomes focused. The behavior is identical to Xmonad. -export extern "aerospace summon-workspace" [ - --help(-h) # Print help +export complete [aerospace summon-workspace] [ + --help(-h) # Print help --fail-if-noop # Exit with non-zero code if moving a window to a workspace it already belongs to - command:string -] + command: by "nu-complete aerospace workspaces" +] where { + terminal [--help] +} # Trigger AeroSpace binding as if it was pressed by user -export extern "aerospace trigger-binding" [ - --help(-h) # Print help - command:string - --mode:string # Moe to search in -] - -def "nu-complete aerospace-volume" [] { - [ - "up", - "down", - "mute-toggle", - "mute-off", - "mute-on", - "set" - ] +export complete [aerospace trigger-binding] [ + --help(-h) # Print help + --mode: by "nu-complete aerospace modes" # Moe to search in + command: text +] where { + terminal [--help] } # Manipulate volume -export extern "aerospace volume" [ - --help(-h) # Print help - command:string@"nu-complete aerospace-volume" -] - -def "nu-complete aerospace-volume-set" [] { - 0..100 +export complete [aerospace volume] [ + --help(-h) # Print help + command: words [up down mute-toggle mute-off mute-on set] +] where { + terminal [--help] } # Focus the specified workspace OR focuses next or previous workspace in the list -export extern "aerospace workspace" [ - --help(-h) # Print help - --wrap-around # Make it possible to jump between first and last workspaces using (next|prev) - --auto-back-and-forth # Autmatic back-and-forth when switching to already focused workspace. Incompatible with --fail-if-noop +export complete [aerospace workspace] [ + --help(-h) # Print help + --wrap-around # Make it possible to jump between first and last workspaces using (next|prev) + --auto-back-and-forth # Autmatic back-and-forth when switching to already focused workspace. Incompatible with --fail-if-noop --fail-if-noop # Exit with non-zero exit code if switching to the already focused workspace. Incompatible with --auto-back-and-forth - command:string -] + command: by "nu-complete aerospace workspace-targets" +] where { + excludes --auto-back-and-forth --fail-if-noop + terminal [--help] +} # Switch between the focused workspace and previously focused workspace back and forth -export extern "aerospace workspace-back-and-forth" [ - --help(-h) # Print help -] - +export complete [aerospace workspace-back-and-forth] [ + --help(-h) # Print help +] where { + terminal [--help] +} diff --git a/custom-completions/ani-cli/ani-cli-completions.nu b/custom-completions/ani-cli/ani-cli-completions.nu index ea5921e2a..d2c9788a2 100644 --- a/custom-completions/ani-cli/ani-cli-completions.nu +++ b/custom-completions/ani-cli/ani-cli-completions.nu @@ -1,125 +1,55 @@ -# Custom completions for ani-cli 4.10.0 - -const qualities = [ - best - worst - '360' - '480' - '720' - '1080' -] - -const limit = 24 - -def qualities [] { { - options: { sort: false } - completions: $qualities -} } - -def episodes [] { { - options: { sort: false } - completions: (1..$limit | into string) -} } +# Declarative completions for ani-cli, a command-line anime browser. + +const EPISODE_LIMIT = 24 + +# Episode numbers offered for --episode. +@non-destructive +export def "nu-complete ani-cli episodes" []: nothing -> list { + try { + 1..$EPISODE_LIMIT | into string + } catch { + [] + } +} -def ranges [] { { - options: { sort: false } - completions: ( - 1..$limit | each { - |start| $start..$limit | each { - |end| if $start != $end { - $'($start)-($end)' - } +# Increasing episode ranges offered for --range. +@non-destructive +export def "nu-complete ani-cli ranges" []: nothing -> list { + try { + 1..($EPISODE_LIMIT - 1) + | each {|start| + ($start + 1)..$EPISODE_LIMIT + | each {|end| $"($start)-($end)" } } - } | flatten - ) -} } - -# Watch anime from the commandline. -# -# A shell script to browse and search anime from the command-line. -# This tool scrapes the site allanime. -# ani-cli without options defaults to iina on macOS, flatpak mpv on Steamdeck, -# mpv apk on android, vlc on iOS and mpv media player everywhere else. -@search-terms anime -@category network -@example "Search for 'banana fish' in 720p" { - ani-cli -q 720 banana fish -} -@example "Search for 'one piece', select 2nd entry and skip the intro" { - ani-cli --skip --skip-title "one piece" -S 2 one piece -} -@example "Search for 'cyberpunk edgerunners' and download 2nd episode" { - ani-cli -d -e 2 cyberpunk edgerunners + | flatten + } catch { + [] + } } -@example "Search for 'cyberpunk edgerunners' 4th episode with VLC in 1080p" { - ani-cli --vlc cyberpunk edgerunners -q 1080 -e 4 -} -@example "Search for 'blue lock' 5th and 6th episodes" { - ani-cli blue lock -e 5-6 -} -@example "Search for 'blue lock' 5th and 6th episodes" { - ani-cli -e "5 6" blue lock -} -export extern ani-cli [ - ...query: string - - --quality (-q): string@qualities - # Specify the video quality - - --episode (-e): string@episodes - # Specify the episode number to watch - - --range (-r): string@ranges - # Specify the episode numbers to watch - - --select-nth (-S): int - # Selects nth entry - - --skip-title: string - # Use given title as ani-skip query - --syncplay (-s) - # Use Syncplay to watch with friends (mpv only) - - --download (-d) - # Download the video instead of playing it - - --continue (-c) - # Continue watching from history - - --help (-h) - # Show summary of options - - --delete (-D) - # Delete history - - --logview (-l) - # Show logs - - --update (-U) - # Update the script - - --version (-V) - # Show the version of the script - - --nextep-countdown (-N) - # Display a countdown to the next episode - - --vlc (-v) - # Use VLC as the media player - - --skip - # Use ani-skip to skip the intro of the episode (mpv only) - - --dub - # Play the dubbed version - - --rofi - # Use rofi instead of fzf for the interactive menu - - --no-detach - # Don't detach the player (mpv only) - - --exit-after-play - # Exit after playing, and return player exit code (mpv only) -] +export complete [ani-cli] [ + --quality(-q): words [best worst 360 480 720 1080] # Video quality + --episode(-e): by "nu-complete ani-cli episodes" # Episode number to watch + --range(-r): by "nu-complete ani-cli ranges" # Episode range to watch + --select-nth(-S): text # Select the nth search result + --skip-title: text # Use the given title as the ani-skip query + --syncplay(-s) # Watch together through Syncplay (mpv only) + --download(-d) # Download the video instead of playing it + --continue(-c) # Continue watching from history + --delete(-D) # Delete the watch history + --logview(-l) # Show the logs + --update(-U) # Update the script + --nextep-countdown(-N) # Show a countdown to the next episode + --vlc(-v) # Use VLC as the media player + --skip # Skip the intro with ani-skip (mpv only) + --dub # Play the dubbed version + --rofi # Use rofi instead of fzf for the menu + --no-detach # Do not detach the player (mpv only) + --exit-after-play # Exit after playing and return the player's code + --help(-h) # Show the summary of options + --version(-V) # Show the script version + ...query: text # Anime title to search for +] where { + at-most-one [--quality --range] + terminal [--help --version] +} diff --git a/custom-completions/as/as-completions.nu b/custom-completions/as/as-completions.nu index b4a3e974b..d9b1bafd3 100644 --- a/custom-completions/as/as-completions.nu +++ b/custom-completions/as/as-completions.nu @@ -1,67 +1,42 @@ -# Omit false conditionals -export extern "as" [ - --alternate # Initially turn on alternate macro syntax - --nocompress-debug-sections # Dont compress DWARF debug sections - --execstack # Require executable stack for this object - --noexecstack # Dont require executable stack for this object - --elf-stt-common # Generate ELF common symbols with STT_COMMON type - --sectname-subst # Enable section name substitution sequences - --gen-debug(-g) # Generate debugging information - --gstabs # Generate STABS debugging information - # --gstabs+ # (breaks the nu parser) Generate STABS debug info with GNU extensions - --gdwarf-2 # Generate DWARF2 debugging information - --gdwarf-sections # Generate per-function section names for DWARF line information - --help # Show help message and exit - --target-help # Show target specific options - --mri(-M) # Assemble in MRI compatibility mode - --reduce-memory-overheads # Prefer smaller memory use - --statistics # Print various measured statistics from execution - --strip-local-absolute # Strip local absolute symbols - --traditional-format # Use same format as native assembler when possible - --version # Print assembler version number and exit - --no-warn(-W) # Suppress warnings - --warn # Dont suppress warnings - --fatal-warnings # Treat warnings as errors - --listing-lhs-width - --listing-lhs-width2 - --listing-rhs-width - --listing-cont-lines - --32 # Generate 32 bits code - --64 # Generate 64 bits code - --x32 # Generate x32 code - ...args -] +# Declarative completions for GNU as, the portable assembler. -# Generate ELF common symbols with STT_COMMON type -export extern "as yes no" [ - --alternate # Initially turn on alternate macro syntax - --nocompress-debug-sections # Dont compress DWARF debug sections - --execstack # Require executable stack for this object - --noexecstack # Dont require executable stack for this object - --elf-stt-common # Generate ELF common symbols with STT_COMMON type - --sectname-subst # Enable section name substitution sequences - --gen-debug(-g) # Generate debugging information - --gstabs # Generate STABS debugging information - # --gstabs+ # (breaks the nu parser) Generate STABS debug info with GNU extensions - --gdwarf-2 # Generate DWARF2 debugging information - --gdwarf-sections # Generate per-function section names for DWARF line information - --help # Show help message and exit - --target-help # Show target specific options - --mri(-M) # Assemble in MRI compatibility mode - --reduce-memory-overheads # Prefer smaller memory use - --statistics # Print various measured statistics from execution - --strip-local-absolute # Strip local absolute symbols - --traditional-format # Use same format as native assembler when possible - --version # Print assembler version number and exit - --no-warn(-W) # Suppress warnings - --warn # Dont suppress warnings - --fatal-warnings # Treat warnings as errors - --listing-lhs-width - --listing-lhs-width2 - --listing-rhs-width - --listing-cont-lines - --32 # Generate 32 bits code - --64 # Generate 64 bits code - --x32 # Generate x32 code - ...args -] \ No newline at end of file +export complete [as] [ + --alternate # Initially turn on alternate macro syntax + --nocompress-debug-sections # Do not compress DWARF debug sections + --execstack # Require an executable stack for this object + --noexecstack # Do not require an executable stack + --elf-stt-common: words [yes no] # Generate ELF common symbols with STT_COMMON type + --sectname-subst # Enable section name substitution sequences + --gen-debug(-g) # Generate debugging information + --gstabs # Generate STABS debugging information + --gdwarf-2 # Generate DWARF2 debugging information + --gdwarf-sections # Generate per-function DWARF line names + --help # Show the help message and exit + --target-help # Show target-specific options + --mri(-M) # Assemble in MRI compatibility mode + --reduce-memory-overheads # Prefer smaller memory use + --statistics # Print measured statistics + --strip-local-absolute # Strip local absolute symbols + --traditional-format # Use the same format as the native assembler + --version # Print the assembler version and exit + --no-warn(-W) # Suppress warnings + --warn # Do not suppress warnings + --fatal-warnings # Treat warnings as errors + --listing-lhs-width: text # Maximum width of the left-hand side + --listing-lhs-width2: text # Maximum width of continuation lines + --listing-rhs-width: text # Maximum width of the source line + --listing-cont-lines: text # Maximum number of continuation lines + --32 # Generate 32-bit code + --64 # Generate 64-bit code + --x32 # Generate x32 code + --output(-o): path # Write the object file here + -f # Skip whitespace and comment preprocessing + -I: dir # Add a directory to the `.include` search path + ...sources: path # Assembly source files +] where { + excludes --execstack --noexecstack + excludes --no-warn --warn + at-most-one [--32 --64 --x32] + at-most-one [--gen-debug --gstabs --gdwarf-2] + terminal [--help --target-help --version] +} diff --git a/custom-completions/aws/aws-completions.nu b/custom-completions/aws/aws-completions.nu index 3f75fd034..a7799c703 100644 --- a/custom-completions/aws/aws-completions.nu +++ b/custom-completions/aws/aws-completions.nu @@ -1,18 +1,2065 @@ -def complete-commands [ - place: record -] { - with-env {COMP_LINE: $place.buffer} { +# Declarative completions for the AWS CLI v2 (`aws`). +# Global options are repeated on every service spec because the CLI accepts them anywhere. + +# Asks `aws_completer` about the `aws` call being completed (its words only, not the pipeline +# around it), for every service, operation and parameter this module does not declare. Declared +# slots marked `fallback` defer to the external completer, so wire this in there, e.g.: +# $env.config.completions.external = {enable: true, completer: {|place| +# if ($place.command | first) == "aws" { aws-completer $place }}} +export def aws-completer [place: record] { + let words = $place.command | each {|word| if ($word =~ '\s') { $'"($word)"' } else { $word } } + with-env {COMP_LINE: ($words | str join ' ')} { let completer = if ((which aws_completer | is-empty) and ("/usr/libexec/aws_completer" | path exists)) { "/usr/libexec/aws_completer" } else { "aws_completer" } - ^$completer - | lines - | each {|x| $"($x) "} + try { ^$completer | lines | each {|x| {value: $x, append_whitespace: true} } } catch { [] } } } -export extern "aws" [ - ...command: string@complete-commands -] +# `s3://bucket/key` URIs. +export syntax aws.s3uri over chars { + root = "s3://" bucket: until "/" ("/" key: until "")? +} + +# Profiles from ~/.aws/config (`[profile x]`, `[default]`) and ~/.aws/credentials (`[x]`). +@non-destructive +export def "nu-complete aws profiles" [] { + try { + let config = $env.AWS_CONFIG_FILE? | default ("~/.aws/config" | path expand) + let creds = $env.AWS_SHARED_CREDENTIALS_FILE? | default ("~/.aws/credentials" | path expand) + let from_config = if ($config | path exists) { + open --raw $config | lines | parse --regex '^\s*\[(?:profile\s+)?(?

[^\]\s]+)\s*\]' | get p | where {|p| $p not-in [sso-session services] } + | each {|p| {value: $p, description: "config"} } + } else { [] } + let from_creds = if ($creds | path exists) { + open --raw $creds | lines | parse --regex '^\s*\[(?

[^\]\s]+)\s*\]' | get p + | each {|p| {value: $p, description: "credentials"} } + } else { [] } + $from_config | append $from_creds | uniq-by value + } catch { [] } +} + +# SSO sessions from ~/.aws/config (`[sso-session x]`). +@non-destructive +export def "nu-complete aws sso-sessions" [] { + try { + let config = $env.AWS_CONFIG_FILE? | default ("~/.aws/config" | path expand) + open --raw $config | lines | parse --regex '^\s*\[sso-session\s+(?

[^\]\s]+)\s*\]' | get p + } catch { [] } +} + +# Buckets of the current profile (only if the API answers fast enough). +@non-destructive +export def "nu-complete aws buckets" [] { + try { ^aws s3api list-buckets --query 'Buckets[].Name' --output text | split row -r '\s+' | where {|b| $b != "" } } catch { [] } +} + +# EKS clusters of the current profile and region. +@non-destructive +export def "nu-complete aws eks-clusters" [] { + try { ^aws eks list-clusters --query 'clusters[]' --output text | split row -r '\s+' | where {|c| $c != "" } } catch { [] } +} + +# Configuration keys for `aws configure get|set`. +@non-destructive +export def "nu-complete aws config-keys" [] { + try { + [aws_access_key_id aws_secret_access_key aws_session_token region output cli_pager cli_binary_format + role_arn source_profile credential_source external_id mfa_serial role_session_name duration_seconds + sso_session sso_account_id sso_role_name sso_region sso_start_url sso_registration_scopes + ca_bundle max_attempts retry_mode endpoint_url credential_process web_identity_token_file] + } catch { [] } +} + +# Unified tool to manage your AWS services +export complete [aws] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --version # Display the version of this tool + --help # Show help + command?: words [accessanalyzer acm apigateway apigatewayv2 appsync athena autoscaling backup batch bedrock bedrock-runtime ce cloudformation cloudfront cloudtrail cloudwatch codebuild codecommit codepipeline cognito-idp configure dynamodb ebs ec2 ecr ecs efs eks elasticache elbv2 emr events firehose glue guardduty iam kinesis kms lambda lightsail logs organizations rds redshift route53 s3 s3api secretsmanager ses sesv2 sns sqs ssm sso sso-oidc stepfunctions sts wafv2 help] # The service to use + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help --version] +} + +# High-level S3 commands +export complete [aws s3] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [ls: "List buckets or objects" cp: "Copy files to, from or within S3" mv: "Move files" rm: "Delete objects" sync: "Sync directories and prefixes" mb: "Make a bucket" rb: "Remove a bucket" presign: "Generate a pre-signed URL" website: "Configure bucket website"] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# List S3 buckets, or objects under a prefix +export complete [aws s3 ls] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --recursive # List all objects under the prefix + --human-readable # Show sizes in human-readable form + --summarize # Show the total number and size of objects + --page-size: text # Number of results per request + --request-payer: words [requester] # Confirm requester pays + --help # Show help for this command + uri?: aws.s3uri with { root.bucket: by "nu-complete aws buckets" } # s3://bucket[/prefix] + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Copy a local file or S3 object to another location +export complete [aws s3 cp] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --dryrun # Display the operations without running them + --quiet # Do not display the operations performed + --include: text # Include files matching this pattern + --exclude: text # Exclude files matching this pattern + --acl: words [private public-read public-read-write authenticated-read aws-exec-read bucket-owner-read bucket-owner-full-control log-delivery-write] # Canned ACL + --storage-class: words [STANDARD REDUCED_REDUNDANCY STANDARD_IA ONEZONE_IA INTELLIGENT_TIERING GLACIER DEEP_ARCHIVE GLACIER_IR] # Storage class + --sse: words [AES256 aws:kms] # Server-side encryption + --sse-kms-key-id: text # KMS key id for SSE + --content-type: text # Explicit content type + --cache-control: text # Caching behavior + --metadata: text # Metadata map (key=value,...) + --no-progress # Do not display transfer progress + --only-show-errors # Only display errors and warnings + --page-size: text # Number of results per list request + --follow-symlinks # Follow symlinks (default) + --no-follow-symlinks # Do not follow symlinks + --expected-size: text # Expected size of a stream upload in bytes + --recursive # Apply to all files under the directory or prefix + --help # Show help for this command + source: path # Local path, `-` or s3://bucket/key + destination: path # Local path, `-` or s3://bucket/key + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --follow-symlinks --no-follow-symlinks + excludes --quiet --only-show-errors + terminal [--help] +} + +# Move a local file or S3 object +export complete [aws s3 mv] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --dryrun # Display the operations without running them + --quiet # Do not display the operations performed + --include: text # Include files matching this pattern + --exclude: text # Exclude files matching this pattern + --acl: words [private public-read public-read-write authenticated-read aws-exec-read bucket-owner-read bucket-owner-full-control log-delivery-write] # Canned ACL + --storage-class: words [STANDARD REDUCED_REDUNDANCY STANDARD_IA ONEZONE_IA INTELLIGENT_TIERING GLACIER DEEP_ARCHIVE GLACIER_IR] # Storage class + --sse: words [AES256 aws:kms] # Server-side encryption + --sse-kms-key-id: text # KMS key id for SSE + --content-type: text # Explicit content type + --cache-control: text # Caching behavior + --metadata: text # Metadata map (key=value,...) + --no-progress # Do not display transfer progress + --only-show-errors # Only display errors and warnings + --page-size: text # Number of results per list request + --follow-symlinks # Follow symlinks (default) + --no-follow-symlinks # Do not follow symlinks + --expected-size: text # Expected size of a stream upload in bytes + --recursive # Apply to all files under the directory or prefix + --help # Show help for this command + source: path # Local path, `-` or s3://bucket/key + destination: path # Local path, `-` or s3://bucket/key + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --follow-symlinks --no-follow-symlinks + excludes --quiet --only-show-errors + terminal [--help] +} + +# Sync directories and S3 prefixes +export complete [aws s3 sync] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --dryrun # Display the operations without running them + --quiet # Do not display the operations performed + --include: text # Include files matching this pattern + --exclude: text # Exclude files matching this pattern + --acl: words [private public-read public-read-write authenticated-read aws-exec-read bucket-owner-read bucket-owner-full-control log-delivery-write] # Canned ACL + --storage-class: words [STANDARD REDUCED_REDUNDANCY STANDARD_IA ONEZONE_IA INTELLIGENT_TIERING GLACIER DEEP_ARCHIVE GLACIER_IR] # Storage class + --sse: words [AES256 aws:kms] # Server-side encryption + --sse-kms-key-id: text # KMS key id for SSE + --content-type: text # Explicit content type + --cache-control: text # Caching behavior + --metadata: text # Metadata map (key=value,...) + --no-progress # Do not display transfer progress + --only-show-errors # Only display errors and warnings + --page-size: text # Number of results per list request + --follow-symlinks # Follow symlinks (default) + --no-follow-symlinks # Do not follow symlinks + --expected-size: text # Expected size of a stream upload in bytes + --delete # Delete files in the destination that are not in the source + --size-only # Compare by size only + --exact-timestamps # Compare timestamps exactly + --help # Show help for this command + source: path # Local directory or s3://bucket/prefix + destination: path # Local directory or s3://bucket/prefix + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --follow-symlinks --no-follow-symlinks + excludes --quiet --only-show-errors + excludes --size-only --exact-timestamps + terminal [--help] +} + +# Delete an S3 object +export complete [aws s3 rm] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --recursive # Delete all objects under the prefix + --dryrun # Display the operations without running them + --quiet # Do not display the operations performed + --include: text # Include objects matching this pattern + --exclude: text # Exclude objects matching this pattern + --only-show-errors # Only display errors and warnings + --help # Show help for this command + uri: aws.s3uri with { root.bucket: by "nu-complete aws buckets" } # s3://bucket/key + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --quiet --only-show-errors + terminal [--help] +} + +# Create an S3 bucket +export complete [aws s3 mb] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + uri: aws.s3uri with { root.bucket: by "nu-complete aws buckets" } # s3://bucket + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Delete an empty S3 bucket +export complete [aws s3 rb] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --force # Delete all objects first + --help # Show help for this command + uri: aws.s3uri with { root.bucket: by "nu-complete aws buckets" } # s3://bucket + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Generate a pre-signed URL for an S3 object +export complete [aws s3 presign] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --expires-in: words [300 900 3600 43200 86400 604800] # Seconds until the URL expires (default 3600) + --help # Show help for this command + uri: aws.s3uri with { root.bucket: by "nu-complete aws buckets" } # s3://bucket/key + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Configure credentials and settings +export complete [aws configure] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [list: "Show the configuration" get: "Print a value" set: "Set a value" list-profiles: "List profiles" sso: "Configure an SSO profile" sso-session: "Configure an SSO session" export-credentials: "Export credentials" import: "Import CSV credentials" add-model: "Add a service model"] # Configure subcommand + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Print a configuration value +export complete [aws configure get] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + key: by "nu-complete aws config-keys" # Key, optionally profile.key + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Set a configuration value +export complete [aws configure set] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + key: by "nu-complete aws config-keys" # Key, optionally profile.key + value: text # The value + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Show the configuration of the profile +export complete [aws configure list] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# List the configured profiles +export complete [aws configure list-profiles] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Configure a profile to use IAM Identity Center +export complete [aws configure sso] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --use-device-code # Use the device code flow + --no-browser # Do not open a browser + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Configure an SSO session +export complete [aws configure sso-session] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Export the resolved credentials +export complete [aws configure export-credentials] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --format: words [process env env-no-export powershell windows-cmd] # Output format + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Import CSV credentials +export complete [aws configure import] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --csv: path # The CSV file (file://...) + --skip-invalid # Skip invalid rows + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# IAM Identity Center +export complete [aws sso] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [login logout list-accounts list-account-roles get-role-credentials] # SSO operation + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Sign in to IAM Identity Center +export complete [aws sso login] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --sso-session: by "nu-complete aws sso-sessions" # SSO session to sign in to + --use-device-code # Use the device code flow + --no-browser # Do not open a browser + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --sso-session --profile + terminal [--help] +} + +# Sign out of every IAM Identity Center session +export complete [aws sso logout] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Security Token Service +export complete [aws sts] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [get-caller-identity: "Who am I" assume-role: "Assume an IAM role" get-session-token: "Temporary credentials" assume-role-with-web-identity: "Assume a role with an OIDC token" decode-authorization-message: "Decode an access-denied message" get-access-key-info: "Account of an access key"] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Return details about the calling identity +export complete [aws sts get-caller-identity] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Return temporary credentials for a role +export complete [aws sts assume-role] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --role-arn: text # ARN of the role to assume + --role-session-name: text # Identifier for the session + --duration-seconds: words [900 3600 7200 14400 43200] # Session duration + --serial-number: text # MFA device serial + --token-code: text # MFA code + --external-id: text # External id + --policy: text # Inline session policy (JSON) + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + requires --token-code --serial-number + terminal [--help] +} + +# Return temporary credentials for the user +export complete [aws sts get-session-token] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --duration-seconds: words [900 3600 43200 129600] # Session duration + --serial-number: text # MFA device serial + --token-code: text # MFA code + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + requires --token-code --serial-number + terminal [--help] +} + +# Identity and Access Management +export complete [aws iam] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [list-users: "List users" get-user: "Show a user" create-user: "Create a user" delete-user: "Delete a user" list-roles: "List roles" get-role: "Show a role" create-role: "Create a role" delete-role: "Delete a role" list-policies: "List policies" get-policy: "Show a policy" create-policy: "Create a policy" attach-role-policy: "Attach a managed policy to a role" detach-role-policy: "Detach a managed policy" attach-user-policy: "Attach a managed policy to a user" list-attached-role-policies: "Policies on a role" put-role-policy: "Add an inline role policy" list-groups: "List groups" add-user-to-group: "Add a user to a group" create-access-key: "Create an access key" list-access-keys: "List access keys" delete-access-key: "Delete an access key" list-mfa-devices: "List MFA devices" get-account-summary: "Account usage and quotas" simulate-principal-policy: "Simulate a principal's policies" list-instance-profiles: "List instance profiles"] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Elastic Compute Cloud +export complete [aws ec2] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [describe-instances: "Show instances" run-instances: "Launch instances" start-instances: "Start instances" stop-instances: "Stop instances" reboot-instances: "Reboot instances" terminate-instances: "Terminate instances" describe-images: "Show AMIs" create-image: "Create an AMI" describe-security-groups: "Show security groups" authorize-security-group-ingress: "Add an inbound rule" revoke-security-group-ingress: "Remove an inbound rule" describe-vpcs: "Show VPCs" describe-subnets: "Show subnets" describe-volumes: "Show EBS volumes" create-volume: "Create an EBS volume" attach-volume: "Attach a volume" create-snapshot: "Snapshot a volume" describe-key-pairs: "Show key pairs" create-key-pair: "Create a key pair" describe-regions: "List regions" describe-availability-zones: "List availability zones" allocate-address: "Allocate an Elastic IP" associate-address: "Associate an Elastic IP" create-tags: "Tag resources" get-console-output: "Instance console output" describe-instance-types: "Show instance types"] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Describe EC2 instances +export complete [aws ec2 describe-instances] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --instance-ids: text # Instance ids + --filters: text # Filters (Name=...,Values=...) + --max-items: text # Total number of items to return + --dry-run # Check permissions without making the request + --no-dry-run # Make the request + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --dry-run --no-dry-run + terminal [--help] +} + +# Start instances +export complete [aws ec2 start-instances] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --instance-ids: text # Instance ids + --dry-run # Check permissions only + --no-dry-run # Make the request + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --dry-run --no-dry-run + terminal [--help] +} + +# Stop instances +export complete [aws ec2 stop-instances] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --instance-ids: text # Instance ids + --dry-run # Check permissions only + --no-dry-run # Make the request + --force # Force the instances to stop + --hibernate # Hibernate the instances + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --dry-run --no-dry-run + excludes --force --hibernate + terminal [--help] +} + +# Reboot instances +export complete [aws ec2 reboot-instances] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --instance-ids: text # Instance ids + --dry-run # Check permissions only + --no-dry-run # Make the request + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --dry-run --no-dry-run + terminal [--help] +} + +# Terminate instances +export complete [aws ec2 terminate-instances] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --instance-ids: text # Instance ids + --dry-run # Check permissions only + --no-dry-run # Make the request + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --dry-run --no-dry-run + terminal [--help] +} + +# Launch EC2 instances +export complete [aws ec2 run-instances] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --image-id: text # AMI id + --instance-type: words [t3.nano t3.micro t3.small t3.medium t3.large t4g.micro t4g.small m6i.large m7g.large c6i.large c7g.large r6i.large g5.xlarge] # Instance type + --key-name: text # Key pair name + --count: text # Number of instances (min[:max]) + --subnet-id: text # Subnet + --security-group-ids: text # Security groups + --user-data: path # User data (file://...) + --iam-instance-profile: text # Instance profile (Name=... or Arn=...) + --tag-specifications: text # Tags for the instances + --associate-public-ip-address # Assign a public IP + --no-associate-public-ip-address # Do not assign a public IP + --dry-run # Check permissions only + --no-dry-run # Make the request + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --associate-public-ip-address --no-associate-public-ip-address + excludes --dry-run --no-dry-run + terminal [--help] +} + +# AWS Lambda +export complete [aws lambda] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [list-functions: "List functions" get-function: "Show a function" invoke: "Invoke a function" create-function: "Create a function" update-function-code: "Deploy new code" update-function-configuration: "Change settings" delete-function: "Delete a function" publish-version: "Publish a version" create-alias: "Create an alias" list-aliases: "List aliases" add-permission: "Grant an invoke permission" get-policy: "Show the resource policy" list-event-source-mappings: "List event sources" create-function-url-config: "Create a function URL" put-function-concurrency: "Reserve concurrency" list-layers: "List layers"] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Invoke a Lambda function +export complete [aws lambda invoke] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --function-name: text # Function name, ARN or alias + --invocation-type: words [RequestResponse Event DryRun] # Synchronous, async or dry run + --log-type: words [None Tail] # Include the execution log + --payload: text # JSON payload (or file://...) + --qualifier: text # Version or alias + --client-context: text # Base64 client context + --help # Show help for this command + outfile: path # Where to write the response + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Deploy new code to a Lambda function +export complete [aws lambda update-function-code] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --function-name: text # Function name or ARN + --zip-file: path # Deployment package (fileb://...) + --s3-bucket: text # Bucket of the package + --s3-key: text # Key of the package + --image-uri: text # Container image URI + --publish # Publish a new version + --no-publish # Do not publish + --architectures: words [x86_64 arm64] # Instruction set + --dry-run # Validate only + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + at-most-one [--zip-file --s3-bucket --image-uri] + requires --s3-key --s3-bucket + excludes --publish --no-publish + terminal [--help] +} + +# CloudWatch Logs +export complete [aws logs] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [tail: "Tail a log group" describe-log-groups: "List log groups" describe-log-streams: "List log streams" filter-log-events: "Search log events" get-log-events: "Read a log stream" create-log-group: "Create a log group" delete-log-group: "Delete a log group" put-retention-policy: "Set retention" start-query: "Start an Insights query" get-query-results: "Insights query results" start-live-tail: "Start a live tail session"] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Tail the events of a log group +export complete [aws logs tail] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --follow # Keep streaming new events + --since: words [5m 10m 30m 1h 6h 1d 1w] # Start time (relative or ISO 8601) + --filter-pattern: text # Filter pattern + --format: words [detailed short json] # Output format + --log-stream-names: text # Only these streams + --log-stream-name-prefix: text # Only streams with this prefix + --help # Show help for this command + group_name: text # The log group name or ARN + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --log-stream-names --log-stream-name-prefix + terminal [--help] +} + +# Elastic Kubernetes Service +export complete [aws eks] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [update-kubeconfig: "Configure kubectl for a cluster" list-clusters: "List clusters" describe-cluster: "Show a cluster" create-cluster: "Create a cluster" delete-cluster: "Delete a cluster" list-nodegroups: "List node groups" describe-nodegroup: "Show a node group" create-nodegroup: "Create a node group" update-nodegroup-config: "Scale a node group" list-addons: "List add-ons" get-token: "Get a token for kubectl" list-access-entries: "List access entries"] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Configure kubectl so that you can connect to an EKS cluster +export complete [aws eks update-kubeconfig] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --name: by "nu-complete aws eks-clusters" # Cluster name + --kubeconfig: path # Kubeconfig file to write + --role-arn: text # Role to assume for authentication + --alias: text # Alias for the cluster context + --user-alias: text # Alias for the user entry + --dry-run # Print the merged kubeconfig instead of writing it + --verbose # Print more detailed output + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Describe an EKS cluster +export complete [aws eks describe-cluster] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --name: by "nu-complete aws eks-clusters" # Cluster name + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Get a token for authentication with an EKS cluster +export complete [aws eks get-token] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --cluster-name: by "nu-complete aws eks-clusters" # Cluster name + --role-arn: text # Role to assume + --cluster-id: text # Cluster id (local clusters on Outposts) + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + exactly-one [--cluster-name --cluster-id] + terminal [--help] +} + +# Elastic Container Service +export complete [aws ecs] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [list-clusters: "List clusters" describe-clusters: "Show clusters" list-services: "List services" describe-services: "Show services" update-service: "Update a service" create-service: "Create a service" delete-service: "Delete a service" list-tasks: "List tasks" describe-tasks: "Show tasks" run-task: "Run a task" stop-task: "Stop a task" execute-command: "Run a command in a container" register-task-definition: "Register a task definition" list-task-definitions: "List task definitions" describe-task-definition: "Show a task definition"] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Modify an ECS service +export complete [aws ecs update-service] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --cluster: text # Cluster name or ARN + --service: text # Service name + --desired-count: text # Number of tasks + --task-definition: text # family[:revision] or ARN + --force-new-deployment # Start a new deployment + --no-force-new-deployment # Do not force a new deployment + --enable-execute-command # Enable ECS Exec + --disable-execute-command # Disable ECS Exec + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --force-new-deployment --no-force-new-deployment + excludes --enable-execute-command --disable-execute-command + terminal [--help] +} + +# Run a command in a running container +export complete [aws ecs execute-command] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --cluster: text # Cluster name or ARN + --task: text # Task id or ARN + --container: text # Container name + --command: text # Command to run + --interactive # Run interactively (required) + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + requires --command --task + terminal [--help] +} + +# Systems Manager +export complete [aws ssm] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [start-session: "Open a Session Manager session" get-parameter: "Read a parameter" get-parameters: "Read parameters" get-parameters-by-path: "Read a parameter hierarchy" put-parameter: "Write a parameter" delete-parameter: "Delete a parameter" describe-parameters: "List parameters" send-command: "Run a command on instances" get-command-invocation: "Command result" describe-instance-information: "List managed instances" terminate-session: "End a session"] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Start a Session Manager session +export complete [aws ssm start-session] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --target: text # Managed instance id + --document-name: words [AWS-StartPortForwardingSession AWS-StartPortForwardingSessionToRemoteHost AWS-StartInteractiveCommand AWS-StartSSHSession] # Session document + --parameters: text # Document parameters (JSON or shorthand) + --reason: text # Reason for the session + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Read one parameter +export complete [aws ssm get-parameter] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --name: text # Parameter name or ARN + --with-decryption # Decrypt SecureString values + --no-with-decryption # Do not decrypt + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --with-decryption --no-with-decryption + terminal [--help] +} + +# Write a parameter +export complete [aws ssm put-parameter] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --name: text # Parameter name + --value: text # Parameter value + --type: words [String StringList SecureString] # Parameter type + --key-id: text # KMS key for SecureString + --overwrite # Overwrite an existing parameter + --no-overwrite # Fail if it exists + --tier: words [Standard Advanced Intelligent-Tiering] # Parameter tier + --description: text # Description + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --overwrite --no-overwrite + terminal [--help] +} + +# DynamoDB +export complete [aws dynamodb] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [list-tables describe-table create-table delete-table scan query get-item put-item update-item delete-item batch-write-item update-table describe-time-to-live] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# CloudFormation +export complete [aws cloudformation] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [deploy package describe-stacks list-stacks create-stack update-stack delete-stack describe-stack-events validate-template wait create-change-set execute-change-set] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Secrets Manager +export complete [aws secretsmanager] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [get-secret-value list-secrets describe-secret create-secret put-secret-value update-secret delete-secret restore-secret rotate-secret] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Elastic Container Registry +export complete [aws ecr] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [get-login-password describe-repositories create-repository delete-repository list-images describe-images batch-delete-image put-lifecycle-policy] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Simple Queue Service +export complete [aws sqs] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [list-queues get-queue-url send-message receive-message delete-message purge-queue create-queue delete-queue get-queue-attributes] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Simple Notification Service +export complete [aws sns] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [list-topics publish create-topic delete-topic subscribe unsubscribe list-subscriptions] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Route 53 +export complete [aws route53] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [list-hosted-zones list-resource-record-sets change-resource-record-sets get-change create-hosted-zone] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Relational Database Service +export complete [aws rds] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [describe-db-instances describe-db-clusters create-db-snapshot start-db-instance stop-db-instance reboot-db-instance modify-db-instance describe-db-snapshots] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# CloudFront +export complete [aws cloudfront] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [list-distributions get-distribution create-invalidation list-invalidations get-invalidation] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Key Management Service +export complete [aws kms] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + operation?: words [list-keys list-aliases describe-key encrypt decrypt generate-data-key create-key] # Operation to run + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Print an authentication token for docker login +export complete [aws ecr get-login-password] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} + +# Deploy a CloudFormation template +export complete [aws cloudformation deploy] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --template-file: path # Template file + --stack-name: text # Stack name + --parameter-overrides: text # Key=Value pairs + --capabilities: words [CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND] # Capabilities + --s3-bucket: text # Bucket for large templates + --no-execute-changeset # Create the change set without executing it + --fail-on-empty-changeset # Fail when there are no changes + --no-fail-on-empty-changeset # Succeed when there are no changes + --role-arn: text # Service role + --tags: text # Stack tags + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --fail-on-empty-changeset --no-fail-on-empty-changeset + terminal [--help] +} + +# Read the value of a secret +export complete [aws secretsmanager get-secret-value] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --secret-id: text # Secret name or ARN + --version-id: text # Version id + --version-stage: words [AWSCURRENT AWSPREVIOUS AWSPENDING] # Version stage + --help # Show help for this command + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + excludes --version-id --version-stage + terminal [--help] +} + +# Show help for the CLI or a service +export complete [aws help] [ + --debug # Turn on debug logging + --endpoint-url: text # Override the command's default URL + --no-verify-ssl # Do not verify SSL certificates + --no-paginate # Disable automatic pagination + --output: words [json yaml yaml-stream text table] # Output format + --query: text # JMESPath query to filter the response + --profile: by "nu-complete aws profiles" # Use a profile from the config/credentials files + --region: words [us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-south-2 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-northeast-1 ap-northeast-2 ap-northeast-3 ca-central-1 ca-west-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-south-2 eu-north-1 il-central-1 me-south-1 me-central-1 sa-east-1 us-gov-east-1 us-gov-west-1 cn-north-1 cn-northwest-1] # The region to use + --color: words [on off auto] # Turn color output on or off + --no-sign-request # Do not sign requests + --ca-bundle: path # CA certificate bundle for SSL verification + --cli-read-timeout: text # Maximum socket read time in seconds + --cli-connect-timeout: text # Maximum socket connect time in seconds + --cli-binary-format: words [base64 raw-in-base64-out] # Formatting style for binary blobs + --no-cli-pager # Disable the CLI pager + --cli-auto-prompt # Automatically prompt for CLI input parameters + --no-cli-auto-prompt # Disable automatic prompting + --help # Show help for this command + topic?: words [accessanalyzer acm apigateway apigatewayv2 appsync athena autoscaling backup batch bedrock bedrock-runtime ce cloudformation cloudfront cloudtrail cloudwatch codebuild codecommit codepipeline cognito-idp configure dynamodb ebs ec2 ecr ecs efs eks elasticache elbv2 emr events firehose glue guardduty iam kinesis kms lambda lightsail logs organizations rds redshift route53 s3 s3api secretsmanager ses sesv2 sns sqs ssm sso sso-oidc stepfunctions sts wafv2 config-vars return-codes s3-config topics] # Service or topic + ...args: fallback # Further arguments, handed to the external completer (`aws-completer`) +] where { + excludes --cli-auto-prompt --no-cli-auto-prompt + excludes --no-verify-ssl --ca-bundle + terminal [--help] +} diff --git a/custom-completions/bat/bat-completions.nu b/custom-completions/bat/bat-completions.nu index f818e81ca..ce70fc8a4 100644 --- a/custom-completions/bat/bat-completions.nu +++ b/custom-completions/bat/bat-completions.nu @@ -1,64 +1,99 @@ -# A cat(1) clone with syntax highlighting and Git integration -export extern "bat" [ - ...file: glob # file(s) to print / concatenate - --help # Print help (see a summary with '-h') - -h # Print help (see more with '--help') - --version # Print version - --show-all(-A) # Show non-printable chars like space, tab and \n - --nonprintable-notation: string@"nu-complete nonprintable-notation" # Set notation for non-printable characters - --plain(-p) # Only show plain style, no decorations - --language(-l): string@"nu-complete languages" # Explicitly set the language for syntax highlighting - --list-languages(-L) # Display a list of supported languages for syntax highlighting - --highlight-line: string # Highlight from N to M line range with a different background color - --file-name: string # Specify the name to display for a file. Useful when piping data to bat from STDIN when bat does not otherwise know the filename - --diff(-d) # Only show lines that have been added/removed/modified with respect to the Git index. Checkout --diff-context=N - --diff-context: number # Include N lines of context around added/removed/modified lines when using '--diff' - --tabs: number # Set the tab width to T spaces. Use a width of 0 to pass tabs through directly - --wraps: string@"nu-complete wrap-modes" # Specify the text-wrapping mode - --chop-long-lines(-S) # Truncate all lines longer than screen width. Alias for '--wrap=never' - --terminal-width: number # Explicitly set the width of the terminal instead of determining it automatically - --number(-n) # Only show line numbers, no other decorations - --color: string@"nu-complete when" # Specify when to use colored output - --italic-text: string@"nu-complete ansi italics" # Specify when to use ANSI sequences for italic text in the output - --decorations: string@"nu-complete when" # Specify when to use the decorations that have been specified via '--style' - --force-colorization(-f) # Alias for '--decorations=always --color=always' - --paging: string@"nu-complete when" # Specify when to use the pager - --pager: string # Determine which pager is used - --map-syntax(-m): string # Map a glob pattern to an existing syntax name - --ignored-suffix: string # Ignore extension. For example: 'bat --ignored-suffix ".dev" my_file.json.dev' will use JSON syntax, and ignore '.dev' - --theme: string@"nu-complete themes" # Set the theme for syntax highlighting - --list-themes # Display a list of supported themes for syntax highlighting - --style: string # Configure which elements (line numbers, file headers, grid borders, Git modifications, ..) - --line-range(-r): string # Only print from N to M - --unbuffered(-u) # This option exists for POSIX-compliance reasons ('u' is for 'unbuffered'). The output is always unbuffered - this option is simply ignored - --diagnostic # Show diagnostic information for bug reports - --acknowledgements # Show acknowledgements -] +# nu-version: 0.116.2 +# Declarative completions for bat 0.26 (flags from `bat --help`). Load with `use bat-completions.nu *`. -def "nu-complete nonprintable-notation" [] { - ['unicode', 'caret'] +# `--style` takes a comma-separated list of components, each optionally prefixed with `+` or `-` +# to modify the previous set instead of replacing it. +export syntax bat.style over chars { + root = item ("," item)* + item = ("+" | "-")? component: word } -def "nu-complete languages" [] { - ^bat --list-languages - | lines - | parse "{value}:{description}" +# `--map-syntax` maps a glob to a syntax: `*.build:Python`. +export syntax bat.map over chars { + root = glob: until ":" ":" syntax: until "" } -def "nu-complete wrap-modes" [] { - ['auto', 'never', 'character'] +# The languages bat can highlight (`bat --list-languages`), described by their extensions. +@non-destructive +export def "nu-complete bat languages" [...rest: string]: nothing -> list> { + try { + with-env {BAT_PAGER: cat, PAGER: cat} { ^bat --list-languages --color=never --paging=never } + | lines + | parse '{value}:{description}' + } catch { [] } } -def "nu-complete when" [] { - ['auto', 'never', 'always'] +# The themes bat knows (`bat --list-themes`). +@non-destructive +export def "nu-complete bat themes" [...rest: string]: nothing -> list { + try { + with-env {BAT_PAGER: cat, PAGER: cat} { ^bat --list-themes --color=never --paging=never } | lines | where $it != '' + } catch { [] } } -def "nu-complete ansi italics" [] { - ['never', 'always'] +# The components `--style` accepts. +@non-destructive +export def "nu-complete bat style" [...rest: string]: nothing -> list> { + [ + {value: default, description: "Recommended components (default)"} + {value: full, description: "All available components"} + {value: auto, description: "Same as default, unless the output is piped"} + {value: plain, description: "Disable all components"} + {value: changes, description: "Git modification markers"} + {value: header, description: "Alias for header-filename"} + {value: header-filename, description: "File names before the content"} + {value: header-filesize, description: "File sizes before the content"} + {value: grid, description: "Vertical/horizontal lines separating the sections"} + {value: rule, description: "Horizontal lines between files"} + {value: numbers, description: "Line numbers in the side bar"} + {value: snip, description: "Lines between ranges with --line-range"} + ] } -def "nu-complete themes" [] { - ^bat --list-themes - | lines - | parse "{value}" +# A cat(1) clone with syntax highlighting and Git integration. +export complete [bat] [ + --show-all(-A) # Show non-printable characters + --nonprintable-notation: words [unicode: "Unicode characters (default)" caret: "Caret notation (^G, ^J, ..)"] + --binary: words [no-printing: "Do not print binary content" as-text: "Treat binary content as text"] + --plain(-p) # Only show plain style, no decorations + --language(-l): by "nu-complete bat languages" # Explicitly set the language for highlighting + --highlight-line(-H): text # Highlight lines N:M with a different background + --file-name: text # Name to display for the file + --diff(-d) # Only show lines changed against the Git index + --diff-context: text # Lines of context around changes with --diff + --tabs: text # Tab width in spaces (0 passes tabs through) + --wrap: words [auto never character] # Text-wrapping mode + --chop-long-lines(-S) # Truncate long lines (alias for --wrap=never) + --terminal-width: text # Explicit terminal width (+N/-N for offsets) + --number(-n) # Only show line numbers, no other decorations + --color: words [auto never always] # When to use colors + --italic-text: words [always never] # When to use italic text + --decorations: words [auto never always] # When to show the --style decorations + --force-colorization(-f) # Alias for --decorations=always --color=always + --paging: words [auto never always] # When to use the pager + --pager: command # Pager to use + --map-syntax(-m): bat.map with { root.syntax: by "nu-complete bat languages" } # Map a glob to a syntax (glob:syntax) + --ignored-suffix: text # Ignore this extension when detecting syntax + --theme: by "nu-complete bat themes" # Theme for syntax highlighting + --theme-light: by "nu-complete bat themes" # Theme to use with a light terminal background + --theme-dark: by "nu-complete bat themes" # Theme to use with a dark terminal background + --list-themes # List the available themes + --squeeze-blank(-s) # Squeeze consecutive empty lines + --squeeze-limit: text # Most consecutive empty lines to keep + --strip-ansi: words [auto always never] # When to strip ANSI escape sequences from the input + --style: bat.style with { item.component: by "nu-complete bat style" } # Components to display + --line-range(-r): text # Only print lines N:M + --list-languages(-L) # List the supported languages + --unbuffered(-u) # Ignored (output is always unbuffered) + --completion: words [bash fish zsh ps1] # Print the completion script for a shell + --diagnostic # Show diagnostic information for bug reports + --acknowledgements # Show acknowledgements + --set-terminal-title # Set the terminal title to the file names + --help(-h) # Print help + --version(-V) # Print version + ...files: path # Files to print +] where { + at-most-one [--plain --number] + at-most-one [--wrap --chop-long-lines] + terminal [--help --version --list-languages --list-themes --diagnostic --acknowledgements] } diff --git a/custom-completions/bend/bend-completions.nu b/custom-completions/bend/bend-completions.nu index fc55f2e43..46725178a 100644 --- a/custom-completions/bend/bend-completions.nu +++ b/custom-completions/bend/bend-completions.nu @@ -1,143 +1,162 @@ -def "nu-complete bend opts" [] { - [all, no-all, eta, no-eta, prune, no-prune, - linearize-matches, linearize-matches-alt, - no-linearize-matches, float-combinators, - no-float-combinators, merge, no-merge, inline, - no-inline, check-net-size, no-check-net-size] -} +# Declarative completions for Bend, a massively parallel programming language. -def "nu-complete bend warn" [] { - [all, irrefutable-match, redundant-match, unreachable-match, unused-definition, repeated-bind, recursion-cycle] +# The subcommands accepted by `bend help`. +export complete [bend help] [ + topic?: words [check desugar gen-hvm gen-c gen-cu run run-c run-cu help] # Subcommand to describe + --help(-h) # Print help + --version(-V) # Print version + --entrypoint(-e): text # Use another entrypoint rather than main or Main + --verbose(-v) # Be verbose +] where { + terminal [--help --version] } -# Checks that the program is syntactically and semantically correct -export extern "bend check" [ - -O: string@"nu-complete bend opts" # Enables or disables the given optimizations - --warn(-W): string@"nu-complete bend warn" # Show the specified compilation warning - --deny(-D): string@"nu-complete bend warn" # Deny the specified compilation warning - --allow(-A): string@"nu-complete bend warn" # Allow the specified compilation warning - --help(-h) # Print help - --entrypoint(-e): string # Use other entrypoint rather than main or Main - --verbose(-v) # Be verbose -] - -# Runs the lambda-term level desugaring passes -export extern "bend desugar" [ - -p # Debug and normalization pretty printing - -O: string@"nu-complete bend opts" # Enables or disables the given optimizations - --io # Run with IO enabled - -l # Linear readback (show explicit dups) - --stats(-s) # Show runtime stats and rewrite counts - --warn(-W): string@"nu-complete bend warn" # Show the specified compilation warning - --deny(-D): string@"nu-complete bend warn" # Deny the specified compilation warning - --allow(-A): string@"nu-complete bend warn" # Allow the specified compilation warning - --help(-h) # Print help - --entrypoint(-e): string # Use other entrypoint rather than main or Main - --verbose(-v) # Be verbose -] +# Check that the program is syntactically and semantically correct. +export complete [bend check] [ + file?: path # Bend source file + -O: words [all no-all eta no-eta prune no-prune linearize-matches linearize-matches-alt no-linearize-matches float-combinators no-float-combinators merge no-merge inline no-inline check-net-size no-check-net-size] # Enable or disable optimizations + --warn(-W): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Show the given warning + --deny(-D): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Deny the given warning + --allow(-A): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Allow the given warning + --entrypoint(-e): text # Use another entrypoint rather than main or Main + --verbose(-v) # Be verbose + --help(-h) # Print help +] where { + terminal [--help] +} -# Compiles the program to hvmc and prints to stdout -export extern "bend gen-hvm" [ - -p # Debug and normalization pretty printing - -O: string@"nu-complete bend opts" # Enables or disables the given optimizations - --io # Run with IO enabled - -l # Linear readback (show explicit dups) - --stats(-s) # Show runtime stats and rewrite counts - --warn(-W): string@"nu-complete bend warn" # Show the specified compilation warning - --deny(-D): string@"nu-complete bend warn" # Deny the specified compilation warning - --allow(-A): string@"nu-complete bend warn" # Allow the specified compilation warning - --help(-h) # Print help - --entrypoint(-e): string # Use other entrypoint rather than main or Main - --verbose(-v) # Be verbose -] +# Run the lambda-term level desugaring passes. +export complete [bend desugar] [ + file?: path # Bend source file + -p # Debug and normalization pretty printing + -O: words [all no-all eta no-eta prune no-prune linearize-matches linearize-matches-alt no-linearize-matches float-combinators no-float-combinators merge no-merge inline no-inline check-net-size no-check-net-size] # Enable or disable optimizations + --io # Run with IO enabled + -l # Linear readback (show explicit dups) + --stats(-s) # Show runtime stats and rewrite counts + --warn(-W): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Show the given warning + --deny(-D): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Deny the given warning + --allow(-A): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Allow the given warning + --entrypoint(-e): text # Use another entrypoint rather than main or Main + --verbose(-v) # Be verbose + --help(-h) # Print help +] where { + terminal [--help] +} -# Compiles the program to standalone C and prints to stdout -export extern "bend gen-c" [ - -p # Debug and normalization pretty printing - -O: string@"nu-complete bend opts" # Enables or disables the given optimizations - --io # Run with IO enabled - -l # Linear readback (show explicit dups) - --stats(-s) # Show runtime stats and rewrite counts - --warn(-W): string@"nu-complete bend warn" # Show the specified compilation warning - --deny(-D): string@"nu-complete bend warn" # Deny the specified compilation warning - --allow(-A): string@"nu-complete bend warn" # Allow the specified compilation warning - --help(-h) # Print help - --entrypoint(-e): string # Use other entrypoint rather than main or Main - --verbose(-v) # Be verbose -] +# Compile the program to HVM and print it to stdout. +export complete [bend gen-hvm] [ + file?: path # Bend source file + -p # Debug and normalization pretty printing + -O: words [all no-all eta no-eta prune no-prune linearize-matches linearize-matches-alt no-linearize-matches float-combinators no-float-combinators merge no-merge inline no-inline check-net-size no-check-net-size] # Enable or disable optimizations + --io # Run with IO enabled + -l # Linear readback (show explicit dups) + --stats(-s) # Show runtime stats and rewrite counts + --warn(-W): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Show the given warning + --deny(-D): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Deny the given warning + --allow(-A): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Allow the given warning + --entrypoint(-e): text # Use another entrypoint rather than main or Main + --verbose(-v) # Be verbose + --help(-h) # Print help +] where { + terminal [--help] +} -# Compiles the program to standalone Cuda and prints to stdout -export extern "bend gen-cu" [ - -p # Debug and normalization pretty printing - -O: string@"nu-complete bend opts" # Enables or disables the given optimizations - --io # Run with IO enabled - -l # Linear readback (show explicit dups) - --stats(-s) # Show runtime stats and rewrite counts - --warn(-W): string@"nu-complete bend warn" # Show the specified compilation warning - --deny(-D): string@"nu-complete bend warn" # Deny the specified compilation warning - --allow(-A): string@"nu-complete bend warn" # Allow the specified compilation warning - --help(-h) # Print help - --entrypoint(-e): string # Use other entrypoint rather than main or Main - --verbose(-v) # Be verbose -] +# Compile the program to standalone C and print it to stdout. +export complete [bend gen-c] [ + file?: path # Bend source file + -p # Debug and normalization pretty printing + -O: words [all no-all eta no-eta prune no-prune linearize-matches linearize-matches-alt no-linearize-matches float-combinators no-float-combinators merge no-merge inline no-inline check-net-size no-check-net-size] # Enable or disable optimizations + --io # Run with IO enabled + -l # Linear readback (show explicit dups) + --stats(-s) # Show runtime stats and rewrite counts + --warn(-W): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Show the given warning + --deny(-D): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Deny the given warning + --allow(-A): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Allow the given warning + --entrypoint(-e): text # Use another entrypoint rather than main or Main + --verbose(-v) # Be verbose + --help(-h) # Print help +] where { + terminal [--help] +} -# Compiles the program and runs it with the Rust HVM implementation -export extern "bend run" [ - -p # Debug and normalization pretty printing - -O: string@"nu-complete bend opts" # Enables or disables the given optimizations - --io # Run with IO enabled - -l # Linear readback (show explicit dups) - --stats(-s) # Show runtime stats and rewrite counts - --warn(-W): string@"nu-complete bend warn" # Show the specified compilation warning - --deny(-D): string@"nu-complete bend warn" # Deny the specified compilation warning - --allow(-A): string@"nu-complete bend warn" # Allow the specified compilation warning - --help(-h) # Print help - --entrypoint(-e): string # Use other entrypoint rather than main or Main - --verbose(-v) # Be verbose -] +# Compile the program to standalone CUDA and print it to stdout. +export complete [bend gen-cu] [ + file?: path # Bend source file + -p # Debug and normalization pretty printing + -O: words [all no-all eta no-eta prune no-prune linearize-matches linearize-matches-alt no-linearize-matches float-combinators no-float-combinators merge no-merge inline no-inline check-net-size no-check-net-size] # Enable or disable optimizations + --io # Run with IO enabled + -l # Linear readback (show explicit dups) + --stats(-s) # Show runtime stats and rewrite counts + --warn(-W): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Show the given warning + --deny(-D): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Deny the given warning + --allow(-A): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Allow the given warning + --entrypoint(-e): text # Use another entrypoint rather than main or Main + --verbose(-v) # Be verbose + --help(-h) # Print help +] where { + terminal [--help] +} -# Compiles the program and runs it with the C HVM implementation -export extern "bend run-c" [ - -p # Debug and normalization pretty printing - -O: string@"nu-complete bend opts" # Enables or disables the given optimizations - --io # Run with IO enabled - -l # Linear readback (show explicit dups) - --stats(-s) # Show runtime stats and rewrite counts - --warn(-W): string@"nu-complete bend warn" # Show the specified compilation warning - --deny(-D): string@"nu-complete bend warn" # Deny the specified compilation warning - --allow(-A): string@"nu-complete bend warn" # Allow the specified compilation warning - --help(-h) # Print help - --entrypoint(-e): string # Use other entrypoint rather than main or Main - --verbose(-v) # Be verbose -] +# Compile the program and run it with the Rust HVM implementation. +export complete [bend run] [ + file?: path # Bend source file + -p # Debug and normalization pretty printing + -O: words [all no-all eta no-eta prune no-prune linearize-matches linearize-matches-alt no-linearize-matches float-combinators no-float-combinators merge no-merge inline no-inline check-net-size no-check-net-size] # Enable or disable optimizations + --io # Run with IO enabled + -l # Linear readback (show explicit dups) + --stats(-s) # Show runtime stats and rewrite counts + --warn(-W): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Show the given warning + --deny(-D): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Deny the given warning + --allow(-A): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Allow the given warning + --entrypoint(-e): text # Use another entrypoint rather than main or Main + --verbose(-v) # Be verbose + --help(-h) # Print help +] where { + terminal [--help] +} -# Compiles the program and runs it with the Cuda HVM implementation -export extern "bend run-cu" [ - -p # Debug and normalization pretty printing - -O: string@"nu-complete bend opts" # Enables or disables the given optimizations - --io # Run with IO enabled - -l # Linear readback (show explicit dups) - --stats(-s) # Show runtime stats and rewrite counts - --warn(-W): string@"nu-complete bend warn" # Show the specified compilation warning - --deny(-D): string@"nu-complete bend warn" # Deny the specified compilation warning - --allow(-A): string@"nu-complete bend warn" # Allow the specified compilation warning - --help(-h) # Print help - --entrypoint(-e): string # Use other entrypoint rather than main or Main - --verbose(-v) # Be verbose -] +# Compile the program and run it with the C HVM implementation. +export complete [bend run-c] [ + file?: path # Bend source file + -p # Debug and normalization pretty printing + -O: words [all no-all eta no-eta prune no-prune linearize-matches linearize-matches-alt no-linearize-matches float-combinators no-float-combinators merge no-merge inline no-inline check-net-size no-check-net-size] # Enable or disable optimizations + --io # Run with IO enabled + -l # Linear readback (show explicit dups) + --stats(-s) # Show runtime stats and rewrite counts + --warn(-W): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Show the given warning + --deny(-D): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Deny the given warning + --allow(-A): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Allow the given warning + --entrypoint(-e): text # Use another entrypoint rather than main or Main + --verbose(-v) # Be verbose + --help(-h) # Print help +] where { + terminal [--help] +} -# A high-level, massively parallel programming language -export extern "bend help" [ - --help(-h) # Print help - --version(-V) # Print version - --entrypoint(-e): string # Use other entrypoint rather than main or Main - --verbose(-v) # Be verbose -] +# Compile the program and run it with the CUDA HVM implementation. +export complete [bend run-cu] [ + file?: path # Bend source file + -p # Debug and normalization pretty printing + -O: words [all no-all eta no-eta prune no-prune linearize-matches linearize-matches-alt no-linearize-matches float-combinators no-float-combinators merge no-merge inline no-inline check-net-size no-check-net-size] # Enable or disable optimizations + --io # Run with IO enabled + -l # Linear readback (show explicit dups) + --stats(-s) # Show runtime stats and rewrite counts + --warn(-W): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Show the given warning + --deny(-D): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Deny the given warning + --allow(-A): words [all irrefutable-match redundant-match unreachable-match unused-definition repeated-bind recursion-cycle] # Allow the given warning + --entrypoint(-e): text # Use another entrypoint rather than main or Main + --verbose(-v) # Be verbose + --help(-h) # Print help +] where { + terminal [--help] +} -# A high-level, massively parallel programming language -export extern "bend" [ +# Bend root command: dispatch to the subcommands above. +export complete [bend] [ --help(-h) # Print help --version(-V) # Print version - --entrypoint(-e): string # Use other entrypoint rather than main or Main + --entrypoint(-e): text # Use another entrypoint rather than main or Main --verbose(-v) # Be verbose -] \ No newline at end of file +] where { + terminal [--help --version] +} diff --git a/custom-completions/bitwarden-cli/bitwarden-cli-completions.nu b/custom-completions/bitwarden-cli/bitwarden-cli-completions.nu index a8daa30ac..a77ffa888 100644 --- a/custom-completions/bitwarden-cli/bitwarden-cli-completions.nu +++ b/custom-completions/bitwarden-cli/bitwarden-cli-completions.nu @@ -1,95 +1,28 @@ # Enums from https://bitwarden.com/help/cli/#enums -# Two-step login methods -# -# Used to specify which two-step login method to use when logging in -def "nu-complete bw login-methods" [] { - [Authenticator, Email, YubiKey] -} - -# Item types -# -# Used with the create command to specify a vault item type -def "nu-complete bw item-types" [] { - [Login, "Secure Note", Card, Identity] -} - -# Login URI match types -# -# Used with the create and edit command to specify URI match detection behavior for a login item -def "nu-complete bw uri-match-types" [] { - [Domain, Host, "Starts With", Exact, "Regular Expressions", Never] -} - -# Field types -# -# Used with the create and edit commands to configure custom fields -def "nu-complete bw field-types" [] { - [Text, Hidden, Boolean] -} - -# Organization user types -# -# Indicates a user's type -def "nu-complete bw organization-user-types" [] { - [Owner, Admin, User, Manager] -} - -# Organization user statuses -# -# Indicates a user's status within the organization -def "nu-complete bw organization-user-statuses" [] { - [Owner, Admin, User, Manager] -} - -# Config settings -# -# Supported settings -def "nu-complete bw config-settings" [] { - [{ value: "server", description: "On-premises hosted installation URL." }] -} - -# bw list supported object values -def "nu-complete bw list-valid-objects" [] { - [items, folders, collections, org-collections, org-members, - organizations] +# Live vault objects. These need an unlocked vault (BW_SESSION); a locked vault yields nothing. +def bw-json [...args: string] { + ^bw list ...$args --nointeraction | from json } -# bw get supported object values -def "nu-complete bw get-valid-objects" [] { - [item, username, password, uri, totp, notes, exposed, attachment, - folder, collection, org-collection, organization, template, - fingerprint, send] +@non-destructive +export def "nu-complete bw folders" [] { + try { bw-json folders | each {|f| {value: ($f.id | default "null"), description: $f.name} } | append {value: "null", description: "No folder"} } catch { [] } } -# bw create supported object values -def "nu-complete bw create-valid-objects" [] { - [item, attachment, folder, org-collection] +@non-destructive +export def "nu-complete bw collections" [] { + try { bw-json collections | each {|c| {value: $c.id, description: $c.name} } } catch { [] } } -# bw edit supported object values -def "nu-complete bw edit-valid-objects" [] { - [item, item-collections, folder, org-collection] +@non-destructive +export def "nu-complete bw organizations" [] { + try { bw-json organizations | each {|o| {value: $o.id, description: $o.name} } | append [{value: "null", description: "Personal"} {value: "notnull", description: "Any organization"}] } catch { [] } } -# bw restore supported object values -def "nu-complete bw restore-valid-objects" [] { - [item] -} - -# bw confirm supported object values -def "nu-complete bw confirm-valid-objects" [] { - ["org-member"] -} - -# bw send template supported object values -def "nu-complete bw send template-valid-objects" [] { - ["send.text", "send.file"] -} - -# bw export supported object values -def "nu-complete bw export-valid-objects" [] { - [csv, json, and encrypted_json] +@non-destructive +export def "nu-complete bw items" [] { + try { bw-json items | each {|i| {value: $i.id, description: $i.name} } } catch { [] } } # bw confirm supported object values @@ -98,18 +31,11 @@ def "nu-complete bw export-valid-objects" [] { # This has multiple issues: # - If not logged in, the completion would need to ask for the password first # - Because there are two optional arguments, Nu doesn't show completions either -def "nu-complete bw import-formats" [] { - ^bw import --formats -} - -# bw send command supported values -def "nu-complete bw send-commands" [] { - [list, template, get, receive, create, edit, remove-password, delete] -} - -# Chose environment variable -def "nu-complete bw env-vars" [] { - $env | columns +@non-destructive +export def "nu-complete bw import-formats" [] { + try { + ^bw import --formats + } catch { [] } } # Bitwarden command line client @@ -134,17 +60,19 @@ def "nu-complete bw env-vars" [] { # bw send "text to send" # echo "text to send" | bw send # bw receive https://vault.bitwarden.com/#/send/rg3iuoS_Akm2gqy6ADRHmg/Ht7dYjsqjmgqUM3rjzZDSQ -export extern "bw" [ - --pretty # Format output. JSON is tabbed with two spaces. - --raw # Return raw output instead of a descriptive message. - --response # Return a JSON formatted version of response output. - --cleanexit # Exit with a success exit code (0) unless an error is thrown. - --quiet # Don't return anything to stdout. - --nointeraction # Do not prompt for interactive user input. - --session: string # Pass session key instead of reading from env. - --version(-v) # output the version number - --help(-h) # display help for command -] +export complete [bw] [ + --pretty # Format output. JSON is tabbed with two spaces. + --raw # Return raw output instead of a descriptive message. + --response # Return a JSON formatted version of response output. + --cleanexit # Exit with a success exit code (0) unless an error is thrown. + --quiet # Don't return anything to stdout. + --nointeraction # Do not prompt for interactive user input. + --session: text # Pass session key instead of reading from env. + --version(-v) # output the version number + --help(-h) # display help for command +] where { + terminal [--help --version] +} # Log into a user account. # @@ -161,19 +89,22 @@ export extern "bw" [ # bw login john@example.com myPassword321 --raw # bw login john@example.com myPassword321 --method 1 --code 249213 # bw login --sso -export extern "bw login" [ - --method: string@"nu-complete bw login-methods" # Two-step login method. - --code: int # Two-step login code. - --sso # Log in with Single-Sign On. - --apikey # Log in with an Api Key. - --passwordenv: string@"nu-complete bw env-vars" # Environment variable storing your password - --passwordfile: path # Path to a file containing your password as its first line - --check # Check login status. - --raw # Pass `--raw` option to only return the session key. - - email?: string - password?: string -] +export complete [bw login] [ + --method: words [Authenticator Email YubiKey] # Two-step login method. + --code: text # Two-step login code. + --sso # Log in with Single-Sign On. + --apikey # Log in with an Api Key. + --passwordenv: env # Environment variable storing your password + --passwordfile: path # Path to a file containing your password as its first line + --check # Check login status. + --raw # Pass `--raw` option to only return the session key. + email?: text + password?: text +] where { + at-most-one [--sso --apikey] + requires --code --method + excludes --passwordenv --passwordfile +} # Log out of the current user account. # @@ -181,9 +112,11 @@ export extern "bw login" [ # Examples: # # bw logout -export extern "bw logout" [ - --help(-h) # display help for command -] +export complete [bw logout] [ + --help(-h) # display help for command +] where { + terminal [--help] +} # Lock the vault and destroy active session keys. # @@ -191,9 +124,11 @@ export extern "bw logout" [ # Examples: # # bw lock -export extern "bw lock" [ - --help(-h) # display help for command -] +export complete [bw lock] [ + --help(-h) # display help for command +] where { + terminal [--help] +} # Unlock the vault and return a new session key. # @@ -209,12 +144,15 @@ export extern "bw lock" [ # bw unlock # bw unlock myPassword321 # bw unlock myPassword321 --raw -export extern "bw unlock" [ - --check # Check lock status. - --passwordenv: string@"nu-complete bw env-vars" # Environment variable storing your password - --passwordfile: path # Path to a file containing your password as its first line - --help(-h) # display help for command -] +export complete [bw unlock] [ + --check # Check lock status. + --passwordenv: env # Environment variable storing your password + --passwordfile: path # Path to a file containing your password as its first line + --help(-h) # display help for command +] where { + excludes --passwordenv --passwordfile + terminal [--help] +} # Pull the latest vault data from server. # @@ -224,11 +162,13 @@ export extern "bw unlock" [ # bw sync # bw sync -f # bw sync --last -export extern "bw sync" [ - --force(-f) # Force a full sync. - --last # Get the last sync date. - --help(-h) # display help for command -] +export complete [bw sync] [ + --force(-f) # Force a full sync. + --last # Get the last sync date. + --help(-h) # display help for command +] where { + terminal [--help] +} # Generate a password/passphrase. # @@ -249,19 +189,30 @@ export extern "bw sync" [ # bw generate -ul # bw generate -p --separator _ # bw generate -p --words 5 --separator space -export extern "bw generate" [ - --uppercase(-u) # Include uppercase characters. - --lowercase(-l) # Include lowercase characters. - --number(-n) # Include numeric characters. - --special(-s) # Include special characters. - --passphrase(-p) # Generate a passphrase. - --length: int # Length of the password. - --words: int # Number of words. - --separator: string # Word separator. - --capitalize(-c) # Title case passphrase. - --includeNumber # Passphrase includes number. - --help(-h) # display help for command -] +export complete [bw generate] [ + --uppercase(-u) # Include uppercase characters. + --lowercase(-l) # Include lowercase characters. + --number(-n) # Include numeric characters. + --special(-s) # Include special characters. + --passphrase(-p) # Generate a passphrase. + --length: text # Length of the password. + --words: text # Number of words. + --separator: text # Word separator. + --capitalize(-c) # Title case passphrase. + --includeNumber # Passphrase includes number. + --help(-h) # display help for command +] where { + requires --words --passphrase + requires --separator --passphrase + requires --capitalize --passphrase + requires --includeNumber --passphrase + excludes --passphrase --uppercase + excludes --passphrase --lowercase + excludes --passphrase --number + excludes --passphrase --special + excludes --passphrase --length + terminal [--help] +} # Base 64 encode stdin. # @@ -273,9 +224,11 @@ export extern "bw generate" [ # Examples: # # echo '{"name":"My Folder"}' | bw encode -export extern "bw encode" [ - --help(-h) # display help for command -] +export complete [bw encode] [ + --help(-h) # display help for command +] where { + terminal [--help] +} # Configure CLI settings. # @@ -290,19 +243,20 @@ export extern "bw encode" [ # bw config server https://bw.company.com # bw config server bitwarden.com # bw config server --api http://localhost:4000 --identity http://localhost:33656 -export extern "bw config" [ - --web-vault: string # Provides a custom web vault URL that differs from the base URL. - --api: string # Provides a custom API URL that differs from the base URL. - --identity: string # Provides a custom identity URL that differs from the base URL. - --icons: string # Provides a custom icons service URL that differs from the base URL. - --notifications: string # Provides a custom notifications URL that differs from the base URL. - --events: string # Provides a custom events URL that differs from the base URL. - --key-connector: string # Provides the URL for your Key Connector server. - --help(-h) # display help for command - - settings: string@"nu-complete bw config-settings" - value?: any -] +export complete [bw config] [ + --web-vault: text # Provides a custom web vault URL that differs from the base URL. + --api: text # Provides a custom API URL that differs from the base URL. + --identity: text # Provides a custom identity URL that differs from the base URL. + --icons: text # Provides a custom icons service URL that differs from the base URL. + --notifications: text # Provides a custom notifications URL that differs from the base URL. + --events: text # Provides a custom events URL that differs from the base URL. + --key-connector: text # Provides the URL for your Key Connector server. + --help(-h) # display help for command + settings: words [server: "On-premises hosted installation URL."] + value?: text +] where { + terminal [--help] +} # Check for updates. # @@ -317,9 +271,11 @@ export extern "bw config" [ # # bw update # bw update --raw -export extern "bw update" [ - --help(-h) # display help for command -] +export complete [bw update] [ + --help(-h) # display help for command +] where { + terminal [--help] +} # Not useful in Nushell # export extern "bw completion" [ @@ -345,9 +301,11 @@ export extern "bw update" [ # - `unauthenticated` when you are not logged in # - `locked` when you are logged in and the vault is locked # - `unlocked` when you are logged in and the vault is unlocked -export extern "bw status" [ - --help(-h) # display help for command -] +export complete [bw status] [ + --help(-h) # display help for command +] where { + terminal [--help] +} # Start a RESTful API webserver. # @@ -363,12 +321,14 @@ export extern "bw status" [ # bw serve # bw serve --port 8080 # bw serve --hostname bwapi.mydomain.com --port 80 -export extern "bw serve" [ - --hostname: string # The hostname to bind your API webserver to. - --port: int # The port to run your API webserver on. - --disable-origin-protection # If set, allows requests with origin header. Warning, this option exists for backwards compatibility reasons and exposes your environment to known CSRF attacks. - --help(-h) # display help for command -] +export complete [bw serve] [ + --hostname: text # The hostname to bind your API webserver to. + --port: text # The port to run your API webserver on. + --disable-origin-protection # If set, allows requests with origin header. Warning, this option exists for backwards compatibility reasons and exposes your environment to known CSRF attacks. + --help(-h) # display help for command +] where { + terminal [--help] +} # List an array of objects from the vault. # @@ -391,17 +351,18 @@ export extern "bw serve" [ # bw list items --trash # bw list folders --search email # bw list org-members --organizationid 60556c31-e649-4b5d-8daf-fc1c391a1bf2 -export extern "bw list" [ - --search: string # Perform a search on the listed objects. - --url: string # Filter items of type login with a url-match search. - --folderid: string # Filter items by folder id. - --collectionid: string # Filter items by collection id. - --organizationid: string # Filter items or collections by organization id. - --trash # Filter items that are deleted and in the trash. - --help(-h) # display help for command - - object: string@"nu-complete bw list-valid-objects" # Valid objects are: items, folders, collections, org-collections, org-members, organizations -] +export complete [bw list] [ + --search: text # Perform a search on the listed objects. + --url: text # Filter items of type login with a url-match search. + --folderid: by "nu-complete bw folders" # Filter items by folder id. + --collectionid: by "nu-complete bw collections" # Filter items by collection id. + --organizationid: by "nu-complete bw organizations" # Filter items or collections by organization id. + --trash # Filter items that are deleted and in the trash. + --help(-h) # display help for command + object: words [items folders collections org-collections org-members organizations] # Valid objects are: items, folders, collections, org-collections, org-members, organizations +] where { + terminal [--help] +} # Get an object from the vault. # @@ -420,15 +381,16 @@ export extern "bw list" [ # bw get attachment photo.jpg --itemid 99ee88d2-6046-4ea7-92c2-acac464b1412 --raw # bw get folder email # bw get template folder -export extern "bw get" [ - --itemid: string # Attachment's item id. - --output: string # Output directory or filename for attachment. - --organizationid: string # Organization id for an organization object. - --help(-h) # display help for command - - object: string@"nu-complete bw get-valid-objects" # Valid objects are: item, username, password, uri, totp, notes, exposed, attachment, folder, collection, org-collection, organization, template, fingerprint, send - id: string # Search term or object's globally unique `id`. -] +export complete [bw get] [ + --itemid: by "nu-complete bw items" # Attachment's item id. + --output: path # Output directory or filename for attachment. + --organizationid: by "nu-complete bw organizations" # Organization id for an organization object. + --help(-h) # display help for command + object: words [item username password uri totp notes exposed attachment folder collection org-collection organization template fingerprint send] # Valid objects are: item, username, password, uri, totp, notes, exposed, attachment, folder, collection, org-collection, organization, template, fingerprint, send + id: text # Search term or object's globally unique `id`. +] where { + terminal [--help] +} # Create an object in the vault. # @@ -438,15 +400,16 @@ export extern "bw get" [ # bw create folder eyJuYW1lIjoiTXkgRm9sZGVyIn0K # echo 'eyJuYW1lIjoiTXkgRm9sZGVyIn0K' | bw create folder # bw create attachment --file ./myfile.csv --itemid 16b15b89-65b3-4639-ad2a-95052a6d8f66 -export extern "bw create" [ - --file: string # Path to file for attachment. - --itemid: string # Attachment's item id. - --organizationid: string # string Organization id for an organization object. - --help(-h) # display help for command - - object: string@"nu-complete bw create-valid-objects" # Valid objects are: item, attachment, folder, org-collection - encodedJson?: string # Encoded json of the object to create. Can also be piped into stdin. -] +export complete [bw create] [ + --file: path # Path to file for attachment. + --itemid: by "nu-complete bw items" # Attachment's item id. + --organizationid: by "nu-complete bw organizations" # string Organization id for an organization object. + --help(-h) # display help for command + object: words [item attachment folder org-collection] # Valid objects are: item, attachment, folder, org-collection + encodedJson?: text # Encoded json of the object to create. Can also be piped into stdin. +] where { + terminal [--help] +} # Edit an object from the vault. # @@ -456,14 +419,15 @@ export extern "bw create" [ # bw edit folder 5cdfbd80-d99f-409b-915b-f4c5d0241b02 eyJuYW1lIjoiTXkgRm9sZGVyMiJ9Cg== # echo 'eyJuYW1lIjoiTXkgRm9sZGVyMiJ9Cg==' | bw edit folder 5cdfbd80-d99f-409b-915b-f4c5d0241b02 # bw edit item-collections 78307355-fd25-416b-88b8-b33fd0e88c82 WyI5NzQwNTNkMC0zYjMzLTRiOTgtODg2ZS1mZWNmNWM4ZGJhOTYiXQ== -export extern "bw edit" [ - --organizationid: string # Organization id for an organization object. - --help(-h) # display help for command - - object: string@"nu-complete bw edit-valid-objects" # Valid objects are: item, item-collections, folder, org-collection - id: string@"nu-complete bw edit-valid-objects" # Object's globally unique `id`. - encodedJson?: string # Encoded json of the object to create. Can also be piped into stdin. -] +export complete [bw edit] [ + --organizationid: by "nu-complete bw organizations" # Organization id for an organization object. + --help(-h) # display help for command + object: words [item item-collections folder org-collection] # Valid objects are: item, item-collections, folder, org-collection + id: by "nu-complete bw items" # Object's globally unique `id`. + encodedJson?: text # Encoded json of the object to create. Can also be piped into stdin. +] where { + terminal [--help] +} # Delete an object from the vault. # @@ -474,15 +438,15 @@ export extern "bw edit" [ # bw delete item 89c21cd2-fab0-4f69-8c6e-ab8a0168f69a --permanent # bw delete folder 5cdfbd80-d99f-409b-915b-f4c5d0241b02 # bw delete attachment b857igwl1dzrs2 --itemid 310d5ffd-e9a2-4451-af87-ea054dce0f78 -export extern "bw delete" [ - --itemid: string # Attachment's item id. - --organizationid: string # Organization id for an organization object. - -p, --permanent # Permanently deletes the item instead of soft-deleting it (item only). - --help(-h) # display help for command - - object: string@"nu-complete bw create-valid-objects" # Valid objects are: item, attachment, folder, org-collection - id: string # Object's globally unique `id`. -] +export complete [bw delete] [ + --itemid: by "nu-complete bw items" # Attachment's item id. + --organizationid: by "nu-complete bw organizations" # Organization id for an organization object. + --help(-h) # display help for command + object: words [item attachment folder org-collection] # Valid objects are: item, attachment, folder, org-collection + id: text # Object's globally unique `id`. +] where { + terminal [--help] +} # Restores an object from the trash. # @@ -490,12 +454,13 @@ export extern "bw delete" [ # Examples: # # bw restore item 7063feab-4b10-472e-b64c-785e2b870b92 -export extern "bw restore" [ - --help(-h) # display help for command - - object: string@"nu-complete bw create-valid-objects" # Valid objects are: item - id: string # Object's globally unique `id`. -] +export complete [bw restore] [ + --help(-h) # display help for command + object: words [item] # Valid objects are: item + id: text # Object's globally unique `id`. +] where { + terminal [--help] +} # Move an item to an organization. # @@ -504,13 +469,14 @@ export extern "bw restore" [ # # bw move 4af958ce-96a7-45d9-beed-1e70fabaa27a 6d82949b-b44d-468a-adae-3f3bacb0ea32 WyI5NzQwNTNkMC0zYjMzLTRiOTgtODg2ZS1mZWNmNWM4ZGJhOTYiXQ== # echo '["974053d0-3b33-4b98-886e-fecf5c8dba96"]' | bw encode | bw move 4af958ce-96a7-45d9-beed-1e70fabaa27a 6d82949b-b44d-468a-adae-3f3bacb0ea32 -export extern "bw move" [ - --help(-h) # display help for command - - id: string # Object's globally unique `id`. - organizationId: string # Organization's globally unique `id`. - encodedJson?: string # Encoded json of an array of collection ids. Can also be piped into stdin. -] +export complete [bw move] [ + --help(-h) # display help for command + id: text # Object's globally unique `id`. + organizationId: by "nu-complete bw organizations" # Organization's globally unique `id`. + encodedJson?: text # Encoded json of an array of collection ids. Can also be piped into stdin. +] where { + terminal [--help] +} # Confirm an object to the organization. # @@ -518,13 +484,14 @@ export extern "bw move" [ # Examples: # # bw confirm org-member 7063feab-4b10-472e-b64c-785e2b870b92 --organizationid 310d5ffd-e9a2-4451-af87-ea054dce0f78 -export extern "bw confirm" [ - --organizationid: string # Organization id for an organization object. - --help(-h) # display help for command - - object: string@"nu-complete bw create-valid-objects" # Valid objects are: org-member - id: string # Object's globally unique `id`. -] +export complete [bw confirm] [ + --organizationid: by "nu-complete bw organizations" # Organization id for an organization object. + --help(-h) # display help for command + object: words [org-member] # Valid objects are: org-member + id: text # Object's globally unique `id`. +] where { + terminal [--help] +} # Import vault data from a file. # @@ -535,16 +502,16 @@ export extern "bw confirm" [ # bw import bitwardencsv ./from/source.csv # bw import keepass2xml keepass_backup.xml # bw import --organizationid cf14adc3-aca5-4573-890a-f6fa231436d9 keepass2xml keepass_backup.xml -export extern "bw import" [ - --formats # List formats - --organizationid: string # ID of the organization to import to. - --help(-h) # display help for command - - format?: string # The format of [input] - # @"nu-complete bw import-formats" does not work - - input?: path # Filepath to data to import -] +export complete [bw import] [ + --formats # List formats + --organizationid: by "nu-complete bw organizations" # ID of the organization to import to. + --help(-h) # display help for command + format?: by "nu-complete bw import-formats" # The format of [input] + input?: path # Filepath to data to import +] where { + terminal [--formats] + terminal [--help] +} # Export vault data to a CSV or JSON file. # @@ -565,48 +532,57 @@ export extern "bw import" [ # bw export --output ./exp/bw.csv # bw export myPassword321 --output bw.json --format json # bw export myPassword321 --organizationid 7063feab-4b10-472e-b64c-785e2b870b92 -export extern "bw export" [ - --output: string # Output directory or filename. - --format: string@"nu-complete bw export-valid-objects" # Export file format. - --password: string # [password] Use password to encrypt instead of your Bitwarden account encryption key. Only applies to the encrypted_json format. - --organizationid: string # Organization id for an organization. - --help(-h) # display help for command - - password?: string # Use password to encrypt instead of your Bitwarden account encryption key. Only applies to the encrypted_json format. -] +export complete [bw export] [ + --output: path # Output directory or filename. + --format: words [csv json encrypted_json] # Export file format. + --password: text # [password] Use password to encrypt instead of your Bitwarden account encryption key. Only applies to the encrypted_json format. + --organizationid: by "nu-complete bw organizations" # Organization id for an organization. + --help(-h) # display help for command + password?: text # Use password to encrypt instead of your Bitwarden account encryption key. Only applies to the encrypted_json format. +] where { + terminal [--help] +} # --DEPRECATED-- Move an item to an organization. -export extern "bw share" [ - --help(-h) # display help for command -] +export complete [bw share] [ + --help(-h) # display help for command +] where { + terminal [--help] +} # Work with Bitwarden sends. # # A Send can be quickly created using this command or subcommands can be used to fine-tune the Send -export extern "bw send" [ - command: string@"nu-complete bw send-commands" # The subcommand to use -] +export complete [bw send] [ + --file(-f) # Specifies that is a filepath + --deleteInDays(-d): text # The number of days in the future to set deletion date, defaults to 7 (default: "7") + --maxAccessCount(-a): text # The amount of max possible accesses. + --hidden # Hide in web by default. Valid only if --file is not set. + --name(-n): text # The name of the Send. Defaults to a guid for text Sends and the filename for files. + --notes: text # Notes to add to the Send. + --fullObject # Specifies that the full Send object should be returned rather than just the access url. + --help(-h) # display help for command + command?: words [list template get receive create edit remove-password delete] # The subcommand to use + data?: text # The data to Send. Specify as a filepath with the --file option +] where { + excludes --file --hidden + terminal [--help] +} # List all the Sends owned by you -export extern "bw send list" [ - --file(-f) # Specifies that is a filepath - --deleteInDays(-d): int # The number of days in the future to set deletion date, defaults to 7 (default: "7") - --maxAccessCount(-a): int # The amount of max possible accesses. - --hidden # Hide in web by default. Valid only if --file is not set. - --name(-n): string # The name of the Send. Defaults to a guid for text Sends and the filename for files. - --notes: string # Notes to add to the Send. - --fullObject # Specifies that the full Send object should be returned rather than just the access url. - --help(-h) # display help for command - - data: any # The data to Send. Specify as a filepath with the --file option -] +export complete [bw send list] [ + --help(-h) # display help for command +] where { + terminal [--help] +} # Get json templates for send objects -export extern "bw send template" [ - --help(-h) # display help for command - - object: string@"nu-complete bw send template-valid-objects" # Valid objects are: send.text, send.file -] +export complete [bw send template] [ + --help(-h) # display help for command + object: words [send.text send.file] # Valid objects are: send.text, send.file +] where { + terminal [--help] +} # Get Sends owned by you. # @@ -622,82 +598,95 @@ export extern "bw send template" [ # bw send get searchText --file # bw send get searchText --file --output ../Photos/photo.jpg # bw send get searchText --file --raw -export extern "bw send get" [ - --output:path # Output directory or filename for attachment. - --text # Specifies to return the text content of a Send - --help(-h) # display help for command - - id: string # Search term or Send's globally unique `id`. -] +export complete [bw send get] [ + --output: path # Output directory or filename for attachment. + --text # Specifies to return the text content of a Send + --help(-h) # display help for command + id: text # Search term or Send's globally unique `id`. +] where { + excludes --text --output + terminal [--help] +} # Access a Bitwarden Send from a url # # # If a password is required, the provided password is used or the user is prompted. -export extern "bw send receive" [ - --password: string # Password needed to access the Send. - --passwordenv: string@"nu-complete bw env-vars" # Environment variable storing the Send's password - --passwordfile: path # Path to a file containing the Sends password as its first line - --obj # Return the Send's json object rather than the Send's content - --output: path # Specify a file path to save a File-type Send to - --help(-h) # display help for command -] +export complete [bw send receive] [ + --password: text # Password needed to access the Send. + --passwordenv: env # Environment variable storing the Send's password + --passwordfile: path # Path to a file containing the Sends password as its first line + --obj # Return the Send's json object rather than the Send's content + --output: path # Specify a file path to save a File-type Send to + --help(-h) # display help for command +] where { + at-most-one [--password --passwordenv --passwordfile] + terminal [--help] +} # Create a Send # # # Note: # Options specified in JSON take precedence over command options -export extern "bw send create" [ - --file: path # file to Send. Can also be specified in parent's JSON. - --text: string # text to Send. Can also be specified in parent's JSON. - --hidden # text hidden flag. Valid only with the --text option. - --password: string # optional password to access this Send. Can also be specified in JSON - --help(-h) # display help for command - - encodedJson?: string # JSON object to upload. Can also be piped in through stdin. -] +export complete [bw send create] [ + --file: path # file to Send. Can also be specified in parent's JSON. + --text: text # text to Send. Can also be specified in parent's JSON. + --hidden # text hidden flag. Valid only with the --text option. + --password: text # optional password to access this Send. Can also be specified in JSON + --help(-h) # display help for command + encodedJson?: text # JSON object to upload. Can also be piped in through stdin. +] where { + excludes --file --text + requires --hidden --text + terminal [--help] +} # edit a Send # # # Note: # You cannot update a File-type Send's file. Just delete and remake it -export extern "bw send edit" [ - --itemid: string # Overrides the itemId provided in [encodedJson] - --help(-h) # display help for command - - encodedJson?: string # Updated JSON object to save. If not provided, encodedJson is read from stdin. -] +export complete [bw send edit] [ + --itemid: by "nu-complete bw items" # Overrides the itemId provided in [encodedJson] + --help(-h) # display help for command + encodedJson?: text # Updated JSON object to save. If not provided, encodedJson is read from stdin. +] where { + terminal [--help] +} # Removes the saved password from a Send. -export extern "bw send remove-password" [ - --help(-h) # display help for command - - id: string # The id of the Send to alter. -] +export complete [bw send remove-password] [ + --help(-h) # display help for command + id: text # The id of the Send to alter. +] where { + terminal [--help] +} # Delete a Send -export extern "bw send delete" [ - --help(-h) # display help for command - - id: string # The id of the Send to delete. -] +export complete [bw send delete] [ + --help(-h) # display help for command + id: text # The id of the Send to delete. +] where { + terminal [--help] +} # Access a Bitwarden Send from a url # # # If a password is required, the provided password is used or the user is prompted. -export extern "bw receive" [ - --password: string # Password needed to access the Send. - --passwordenv: string@"nu-complete bw env-vars" # Environment variable storing the Send's password - --passwordfile: path # Path to a file containing the Sends password as its first line - --obj # Return the Send's json object rather than the Send's content - --output: path # Specify a file path to save a File-type Send to - --help(-h) # display help for command - - urs: string -] +export complete [bw receive] [ + --password: text # Password needed to access the Send. + --passwordenv: env # Environment variable storing the Send's password + --passwordfile: path # Path to a file containing the Sends password as its first line + --obj # Return the Send's json object rather than the Send's content + --output: path # Specify a file path to save a File-type Send to + --help(-h) # display help for command + url: text # The Send URL +] where { + at-most-one [--password --passwordenv --passwordfile] + terminal [--help] +} # Not useful in Nushell # export extern "bw help" [ diff --git a/custom-completions/bmc/bmc-completions.nu b/custom-completions/bmc/bmc-completions.nu index 76a11c2d1..440c6a27b 100644 --- a/custom-completions/bmc/bmc-completions.nu +++ b/custom-completions/bmc/bmc-completions.nu @@ -1,84 +1,111 @@ -# completions for botmaker-cli +# Declarative completions for botmaker-cli (bmc). -def "nu-complete list client actions" [] { - glob **/*.js --depth 2 | path basename +# Client action scripts (*.js) found up to two levels below the current directory. +@non-destructive +export def "nu-complete bmc client-actions" []: nothing -> list { + try { + glob **/*.js --depth 2 | path basename | uniq + } catch { + [] + } } -export extern "bmc" [ - command?: string # command - --help # Show help - --version # Show version number -] +export complete [bmc] [ + --help # Show help + --version # Show version number +] where { + terminal [--help --version] +} -# Run a Botmaker Client Action Script -export extern "bmc run" [ - source: string@"nu-complete list client actions" # client action to run - --help # Show help - --version # Show version number -] +# Run a Botmaker client action script. +export complete [bmc run] [ + source: by "nu-complete bmc client-actions" cwd # Client action to run + --help # Show help + --version # Show version number +] where { + terminal [--help --version] +} -# Import a new business from a token -export extern "bmc import" [ - apiToken: string # command - --help # Show help - --version # Show version number -] +# Import a new business from a token. +export complete [bmc import] [ + api-token: text # API token of the business + --help # Show help + --version # Show version number +] where { + terminal [--help --version] +} -# Load context for a customer -export extern "bmc set-customer" [ - customerId: string # command - --help # Show help - --version # Show version number -] +# Load the context for a customer. +export complete [bmc set-customer] [ + customer-id: text # Customer identifier + --help # Show help + --version # Show version number +] where { + terminal [--help --version] +} -# Show change status -export extern "bmc status" [ - caName?: string@"nu-complete list client actions" # client action to check - --help # Show help - --version # Show version number -] +# Show the change status. +export complete [bmc status] [ + ca-name?: by "nu-complete bmc client-actions" cwd # Client action to check + --help # Show help + --version # Show version number +] where { + terminal [--help --version] +} -# Diff client actions states -export extern "bmc diff" [ - caName: string@"nu-complete list client actions" # client action to check - code: string # command - --help # Show help - --version # Show version number - --vs-code(-v) # Open in vs-code -] +# Diff client action states. +export complete [bmc diff] [ + ca-name: by "nu-complete bmc client-actions" cwd # Client action to compare + code: path # File to compare against + --vs-code(-v) # Open the diff in VS Code + --help # Show help + --version # Show version number +] where { + terminal [--help --version] +} -# Pull incoming changes -export extern "bmc pull" [ - caName?: string@"nu-complete list client actions" # client action to pull - --help # Show help - --version # Show version number -] +# Pull incoming changes. +export complete [bmc pull] [ + ca-name?: by "nu-complete bmc client-actions" cwd # Client action to pull + --help # Show help + --version # Show version number +] where { + terminal [--help --version] +} -# Create a new client action -export extern "bmc new" [ - caName: string # command - --help # Show help - --version # Show version number -] +# Create a new client action. +export complete [bmc new] [ + ca-name: text # Name of the new client action + --help # Show help + --version # Show version number +] where { + terminal [--help --version] +} -# Push changes in client action -export extern "bmc push" [ - caName?: string@"nu-complete list client actions" # client action to push - --help # Show help - --version # Show version number -] +# Push the changes of a client action. +export complete [bmc push] [ + ca-name?: by "nu-complete bmc client-actions" cwd # Client action to push + --help # Show help + --version # Show version number +] where { + terminal [--help --version] +} -# Publish changes in client action -export extern "bmc publish" [ - caName: string@"nu-complete list client actions" # client action to publish - --help # Show help - --version # Show version number -] +# Publish the changes of a client action. +export complete [bmc publish] [ + ca-name: by "nu-complete bmc client-actions" cwd # Client action to publish + --help # Show help + --version # Show version number +] where { + terminal [--help --version] +} -# Renames the given client action -export extern "bmc rename" [ - caOldName: string@"nu-complete list client actions" # client action to rename - caNewName: string # new name - --help # Show help - --version # Show version number -] +# Rename a client action. +export complete [bmc rename] [ + ca-old-name: by "nu-complete bmc client-actions" cwd # Client action to rename + ca-new-name: text # New name + --help # Show help + --version # Show version number +] where { + terminal [--help --version] +} diff --git a/custom-completions/btm/btm-completions.nu b/custom-completions/btm/btm-completions.nu index ceece0e3f..e892d9588 100644 --- a/custom-completions/btm/btm-completions.nu +++ b/custom-completions/btm/btm-completions.nu @@ -1,47 +1,67 @@ -# authour: DWTW +# Declarative completions for bottom (btm), a graphical process/system monitor. -def colorScheme [] { - [ "default", "default-light", "gruvbox", "gruvbox-light", "nord", "nord-light" ] +export complete [btm] [ + # General options + --autohide_time # Hide the time scale automatically after zooming + --basic(-b) # Hide graphs and use a basic, htop-like look + --config_location(-C): path # Location of the TOML config file + --default_time_value(-t): text # Default graph time value (ms or duration, e.g. 60s) + --default_widget_count: text # Use the Nth widget of the default type + --default_widget_type: words [cpu mem net network proc process processes temp temperature disk batt battery] # Widget selected by default + --disable_click # Disable mouse clicks + --disable_keys # Disable keyboard shortcuts, including quitting + --dot_marker(-m) # Use a dot marker for graphs + --expanded(-e) # Expand the default widget on start + --hide_time # Hide the time scale + --rate(-r): text # Refresh rate (ms or duration, e.g. 1s) + --retention: text # How long to keep data (ms or duration, e.g. 10m) + --show_table_scroll_position # Show the scroll position in table widget titles + --time_delta(-d): text # Zoom step (ms or duration, e.g. 15s) + # Process options + --case_sensitive(-S) # Search processes case-sensitively by default + --current_usage(-u) # Process CPU% as a share of current usage + --disable_advanced_kill # Hide additional stopping options + --read_only # Prevent actions that affect the system + --get_threads # Also gather process thread information + --process_default_sort: words [cpu% mem mem% pid name command user state] # Default process sort column + --group_processes(-g) # Group processes with the same name + --process_memory_as_value # Show process memory by value + --process_command # Show the full command instead of the name + --regex(-R) # Search with regex by default + --tree(-T) # Show processes as a tree + --tree_collapse # Collapse the process tree by default + --unnormalized_cpu(-n) # Do not average process CPU% over cores + --whole_word(-W) # Match whole words when searching + # Temperature options + --celsius(-c) # Use Celsius (default) + --fahrenheit(-f) # Use Fahrenheit + --kelvin(-k) # Use Kelvin + # CPU options + --cpu_left_legend(-l) # Put the CPU legend on the left + --default_cpu_entry: words [all avg] # CPU entry selected by default + --hide_avg_cpu(-a) # Hide the average CPU entry + # Memory options + --memory_legend: words [none top-left top top-right left right bottom-left bottom bottom-right] # Memory legend position + --enable_cache_memory # Collect and show cache and buffer memory + --free_arc # Subtract reclaimable ARC from memory + --short_gpu_names # Use short GPU names in the memory widget + # Network options + --network_legend: words [none top-left top top-right left right bottom-left bottom bottom-right] # Network legend position + --network_use_bytes # Show network usage in bytes + --network_use_binary_prefix # Show network usage with binary prefixes + --network_use_log # Use a log scale for the network graph + --use_old_network_legend # (Deprecated) Use a separate network legend + --show_packets # Show packet rate and average packet size + --network_start_zeroed # Count network usage from app start + # Battery and GPU options + --battery # Show the battery widget + --disable_gpu # Disable GPU data collection + # Style options + --theme: words [default default-light gruvbox gruvbox-light nord nord-light] # Built-in color scheme + # Other options + --help(-h) # Print help + --version(-V) # Print version +] where { + at-most-one [--celsius --fahrenheit --kelvin] + terminal [--help --version] } - -def widgetType [] { - [ "cpu", "mem", "net", "proc", "temp", "disk", "bat" ] -} - -# Yet another cross-platform graphical process/system monitor. -export extern "btm" [ - --autohide-time # Hide time-scale in graphs automatically - --basic(-b) # Use a more basic look - --battery # Show battery widget - --case_sensitive(-S) # Enables case sensitivity - --celsius(-c) # Sets temp type to celsius - --color: string@colorScheme # Use a pre-defined colorscheme - --config(-C): string # Sets the location of the config file - --current_usage(-u) # Set CPU% to current system CPU% - --default_time_value(-t): int # Time value for graphs - --default_widget_count: int # Sets nth selected widget type to use default widget - --default_widget_type: string@widgetType # Set default select widget - --disable_advanced_kill # Hide advanced options - --disable_click # Disables mouse - --dot_marker(-m) # Uses dot marker for graphs - --fahrenheit(-f) # Sets temp type to fahrenheit - --group(-g) # Groups processes - --help(-h) # Prints help information - --hide_avg_cpu(-a) # Hide average CPU usage - --hide_table_gap # Hides spacing between table headers and entries - --hide_time # Completely hides the time scale - --kelvin(-k) # Sets temp type to kelvin - --left-legend(-l) # Puts the CPU chart to left - --men_as_value # Default sort by memory usage - --network_use_binary_prefix # Network widget with binary prefixes - --network_use_bytes # Network widget as bytes - --network_use_logs # Network eidget with logs - --process_command # Show processes as commands - --rate(-r): int # Sets refresh - --regex(-R) # Enable regex by default - --show_table_scroll_position # Show scroll position - --time-delta(-d): int # Amount changed when zooming in/out - --tree(-T) # Show processes as tree - --version(-V) # Prints version information - --whole-word(-w) # Search results match entries query -] diff --git a/custom-completions/cargo-loco/cargo-loco-completions.nu b/custom-completions/cargo-loco/cargo-loco-completions.nu index f6f952c5e..fc9025a5e 100644 --- a/custom-completions/cargo-loco/cargo-loco-completions.nu +++ b/custom-completions/cargo-loco/cargo-loco-completions.nu @@ -1,14 +1,9 @@ def _locate_cargo_root [] { - cargo --quiet locate-project --message-format plain e> /dev/null + try { cargo --quiet locate-project --message-format plain e> /dev/null } catch { 'Cargo.toml' } } -def _scheduler_jobs [ - context: string, -] { - let environment = $context - | parse --regex '(?:--environment|-e)\s+(?P[a-z0-9_-]+)' - | get 0?.environment? - | default "development" +def _scheduler_jobs [environment?: string] { + let environment = $environment | default "development" _locate_cargo_root | path dirname @@ -18,130 +13,75 @@ def _scheduler_jobs [ | transpose name settings } -def "nu-complete environment" [] { - let environments = _locate_cargo_root - | path dirname - | path join "config" - | ls $in - | get name - | path parse - | get stem - - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - }, - completions: $environments - } -} - -def "nu-complete tasks" [] { - let tasks = _locate_cargo_root - | path dirname - | path join "src/tasks" - | ls $in - | get name - | path parse - | get stem - | skip while {|file| $file == "mod"} - - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - }, - completions: $tasks - } -} - -def "nu-complete scheduler jobs" [ - context: string, -] { - let jobs = _scheduler_jobs $context - | get name - - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - }, - completions: $jobs - } -} - -def "nu-complete scheduler tags" [ - context: string, -] { - let tags = _scheduler_jobs $context - | get settings?.tags - | flatten - | uniq - - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - }, - completions: $tags - } +@non-destructive +export def "nu-complete environment" [] { + try { + _locate_cargo_root + | path dirname + | path join "config" + | ls $in + | get name + | path parse + | get stem + } catch { [] } +} + +@non-destructive +export def "nu-complete tasks" [] { + try { + _locate_cargo_root + | path dirname + | path join "src/tasks" + | ls $in + | get name + | path parse + | get stem + | skip while {|file| $file == "mod"} + } catch { [] } +} + +@non-destructive +export def "nu-complete scheduler jobs" [environment?: string] { + try { _scheduler_jobs $environment | get name } catch { [] } } +@non-destructive +export def "nu-complete scheduler tags" [environment?: string] { + try { _scheduler_jobs $environment | get settings?.tags | flatten | uniq } catch { [] } +} + +@non-destructive def "nu-complete kind" [] { - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - sort: false, - }, - completions: [ + [ "htmx" "html" "api" ] - } } +@non-destructive def "nu-complete deployment" [] { - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - sort: false, - }, - completions: [ + [ "docker" "shuttle" "nginx" ] - } } +@non-destructive def "nu-complete status" [] { - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - sort: false, - }, - completions: [ + [ "queued" "processing" "completed" "failed" "cancelled" ] - } } +@non-destructive def "nu-complete template" [] { - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - sort: false, - }, - completions: [ + [ "controller" "controller/api" "controller/api/controller.t" @@ -212,14 +152,10 @@ def "nu-complete template" [] { "worker/test.t" "worker/worker.t" ] - } } -def columns [ - name: string - query?: string -] { - mut columns = [ +# Column types of the model generator (`name:type`), with the `!` (not null) and `^` (unique) variants. +const COLUMN_TYPES = [ "uuid" "uuid_col" "uuid_col!" @@ -278,429 +214,458 @@ def columns [ "jsonb!" ] - if not ($query | is-empty) { - $columns = $columns | where { - $in | str contains --ignore-case $query - } - } - - $columns | each {|column| $"($name):($column) "} -} - -def "nu-complete generate fields" [ - context: string, - position?: int -] { - let field = $context - | split row --regex '\s+' - | last - | str trim - | split column ':' name column - | last - | { name: ($in.name | str snake-case), column: $in.column } - - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - }, - completions: (columns $field.name $field.column) - } -} - -def "nu-complete subcommands" [] { - { - options: { - sort: false - }, - completions : [ - { value: "start", description: "Start an app" }, - { value: "db", description: "Perform DB operations" }, - { value: "routes", description: "Describe all application endpoints" }, - { value: "middleware", description: "Describe all application middlewares" }, - { value: "task", description: "Run a custom task" }, - { value: "jobs", description: "Managing jobs queue" }, - { value: "scheduler", description: "Run the scheduler" }, - { value: "generate", description: "code generation creates a set of files and code templates based on a predefined set of rules" }, - { value: "doctor", description: "Validate and diagnose configurations" }, - { value: "version", description: "Display the app version" }, - { value: "watch", description: "Watch and restart the app" }, - { value: "help", description: "Print this message or the help of the given subcommand(s)" }, - - # Aliases - { value: "g", description: "Alias for `generate`" } - ] - } -} - -def "nu-complete generate subcommands" [] { - { - options: { - sort: false - }, - completions: [ - { value: "model", description: "Generates a new model file for defining the data structure of your application, and test file logic" }, - { value: "migration", description: "Generates a new migration file" }, - { value: "scaffold", description: "Generates a CRUD scaffold, model and controller" }, - { value: "controller", description: "Generate a new controller with the given controller name, and test file" }, - { value: "task", description: "Generate a Task based on the given name" }, - { value: "scheduler", description: "Generate a scheduler jobs configuration template" }, - { value: "worker", description: "Generate worker" }, - { value: "mailer", description: "Generate mailer" }, - { value: "deployment", description: "Generate a deployment infrastructure" }, - { value: "override", description: "Override templates and allows you to take control of them. You can always go back when deleting the local template" }, - { value: "help", description: "Print this message or the help of the given subcommand(s)" } - ] - } -} - -def "nu-complete jobs" [] { - { - options: { - sort: false - }, - completions: [ - { value: "cancel", description: "Cancels jobs with the specified names, setting their status to `cancelled`" } - { value: "tidy", description: "Deletes jobs that are either completed or cancelled" } - { value: "purge", description: "Deletes jobs based on their age in days" } - { value: "dump", description: "Saves the details of all jobs to files in the specified folder" } - { value: "import", description: "Imports jobs from a file" } - { value: "help", description: "Print this message or the help of the given subcommand(s)" } - ] - } -} - -# The one-person framework for Rust -export extern "cargo loco" [ - subcommand?: string@"nu-complete subcommands" - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Start an app -export extern "cargo loco start" [ - --worker(-w) # start worker - --server-and-worker(-s) # start same-process server and worker - --binding(-b): string # server bind address - --port(-p): number # server port address - --no-banner(-n) # disable the banner display - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Describe all application endpoints -export extern "cargo loco routes" [ - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Start an app -export extern "cargo loco middleware" [ +# `name:type` for each column type, with the name typed so far. +@non-destructive +export def "nu-complete column types" [] { + try { + $COLUMN_TYPES + } catch { [] } +} + +@non-destructive +export def "nu-complete subcommands" [] { + try { + [ + { value: "start", description: "Start an app" }, + { value: "db", description: "Perform DB operations" }, + { value: "routes", description: "Describe all application endpoints" }, + { value: "middleware", description: "Describe all application middlewares" }, + { value: "task", description: "Run a custom task" }, + { value: "jobs", description: "Managing jobs queue" }, + { value: "scheduler", description: "Run the scheduler" }, + { value: "generate", description: "code generation creates a set of files and code templates based on a predefined set of rules" }, + { value: "doctor", description: "Validate and diagnose configurations" }, + { value: "version", description: "Display the app version" }, + { value: "watch", description: "Watch and restart the app" }, + { value: "help", description: "Print this message or the help of the given subcommand(s)" }, + + # Aliases + { value: "g", description: "Alias for `generate`" } + ] + } catch { [] } +} + +@non-destructive +export def "nu-complete generate subcommands" [] { + try { + [ + { value: "model", description: "Generates a new model file for defining the data structure of your application, and test file logic" }, + { value: "migration", description: "Generates a new migration file" }, + { value: "scaffold", description: "Generates a CRUD scaffold, model and controller" }, + { value: "controller", description: "Generate a new controller with the given controller name, and test file" }, + { value: "task", description: "Generate a Task based on the given name" }, + { value: "scheduler", description: "Generate a scheduler jobs configuration template" }, + { value: "worker", description: "Generate worker" }, + { value: "mailer", description: "Generate mailer" }, + { value: "deployment", description: "Generate a deployment infrastructure" }, + { value: "override", description: "Override templates and allows you to take control of them. You can always go back when deleting the local template" }, + { value: "help", description: "Print this message or the help of the given subcommand(s)" } + ] + } catch { [] } +} + +@non-destructive +export def "nu-complete jobs" [] { + try { + [ + { value: "cancel", description: "Cancels jobs with the specified names, setting their status to `cancelled`" } + { value: "tidy", description: "Deletes jobs that are either completed or cancelled" } + { value: "purge", description: "Deletes jobs based on their age in days" } + { value: "dump", description: "Saves the details of all jobs to files in the specified folder" } + { value: "import", description: "Imports jobs from a file" } + { value: "help", description: "Print this message or the help of the given subcommand(s)" } + ] + } catch { [] } +} + +# Perform database operations +@non-destructive +def "nu-complete db subcommands" [] { + ['create' 'drop' 'migrate' 'reset' 'seed' 'setup' 'truncate'] +} + +# A model/migration field: `name:type` (the type is completed after the colon). +export syntax loco.field over chars { + root = name: until ":" (":" type: until ":")? +} + +export complete [cargo loco] [ + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco start] [ + --worker(-w) # start worker + --server-and-worker(-s) # start same-process server and worker + --binding(-b): text # server bind address + --port(-p): text # server port address + --no-banner(-n) # disable the banner display + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco routes] [ + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco middleware] [ --config(-c): path - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Run a custom task -export extern "cargo loco task" [ - name: string@"nu-complete tasks" # Task name (identifier) - ...params: string # Task params (e.g. `foo:bar baz:qux`) - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Run a custom task -export extern "cargo loco jobs" [ - subcommand?: string@"nu-complete jobs" - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Cancels jobs with the specified names, setting their status to `cancelled` -export extern "cargo loco jobs cancel" [ - --name: string # Names of jobs to cancel - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Deletes jobs that are either completed or cancelled -export extern "cargo loco jobs tidy" [ - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Deletes jobs based on their age in days -export extern "cargo loco jobs purge" [ - --max-age: number = 90 # Deletes jobs with errors or cancelled, older than the specified maximum age in days - --status: string@"nu-complete status" # Limits the jobs being saved to those with specific criteria like `completed` or `queued` - --dump: path # Saves the details of jobs into a file before deleting them - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Saves the details of all jobs to files in the specified folder -export extern "cargo loco jobs dump" [ - --status: string@"nu-complete status" # Limits the jobs being saved to those with specific criteria like `completed` or `queued` - --folder(-f): path = "." # Folder to save the job files - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Imports jobs from a file -export extern "cargo loco jobs import" [ - --file(-f): path # Path to the file containing job details to import - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Run the scheduler -export extern "cargo loco scheduler" [ - --name(-n): string@"nu-complete scheduler jobs" # Run a specific job by its name - --tag(-t): string@"nu-complete scheduler tags" # Run jobs that are associated with a specific tag - --config(-c): path # Specify a path to a dedicated scheduler configuration file. by default load schedulers job setting from environment config - --list(-l) # Show all configured jobs - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# code generation creates a set of files and code templates based on a predefined set of rules -export extern "cargo loco generate" [ - subcommand?: string@"nu-complete generate subcommands" - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generates a new model file for defining the data structure of your application, and test file logic -export extern "cargo loco generate model" [ - name: string # Name of the thing to generate - ...fields: string@"nu-complete generate fields" # Model fields, eg. title:string hits:int - --link(-l) # Is it a link table? Use this in many-to-many relations - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generates a new migration file -export extern "cargo loco generate migration" [ - name: string # Name of the migration to generate - ...fields: string@"nu-complete generate fields" # Table fields, eg. title:string hits:int - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate a new controller with the given controller name, and test file -export extern "cargo loco generate controller" [ - name: string # Name of the thing to generate - ...actions: string # Actions - --kind(-k): string@"nu-complete kind" # The kind of controller actions to generate - --htmx # Use HTMX controller actions - --html # Use HTML controller actions - --api # Use API controller actions - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generates a CRUD scaffold, model and controller -export extern "cargo loco generate scaffold" [ - name: string # Name of the thing to generate - ...fields: string@"nu-complete generate fields" # Model fields, eg. title:string hits:int - --kind(-k): string@"nu-complete kind" # The kind of controller actions to generate - --htmx # Use HTMX controller actions - --html # Use HTML controller actions - --api # Use API controller actions - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate a Task based on the given name -export extern "cargo loco generate task" [ - name: string # Name of the thing to generate - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate a scheduler jobs configuration template -export extern "cargo loco generate scheduler" [ - name: string # Name of the thing to generate - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate worker -export extern "cargo loco generate worker" [ - name: string # Name of the thing to generate - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate mailer -export extern "cargo loco generate mailer" [ - name: string # Name of the thing to generate - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate a deployment infrastructure -export extern "cargo loco generate deployment" [ - --kind: string@"nu-complete deployment" # The kind of deployment to generate - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Override templates and allows you to take control of them. You can always go back when deleting the local template -export extern "cargo loco generate override" [ - template: path@"nu-complete template" # The path to a specific template or directory to copy - --info # Show available templates to copy under the specified directory without actually coping them - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - - -# code generation creates a set of files and code templates based on a predefined set of rules -export extern "cargo loco g" [ - subcommand?: string@"nu-complete generate subcommands" - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generates a new model file for defining the data structure of your application, and test file logic -export extern "cargo loco g model" [ - name: string # Name of the thing to generate - ...fields: string@"nu-complete generate fields" # Model fields, eg. title:string hits:int - --link(-l) # Is it a link table? Use this in many-to-many relations - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generates a new migration file -export extern "cargo loco g migration" [ - name: string # Name of the migration to generate - ...fields: string@"nu-complete generate fields" # Table fields, eg. title:string hits:int - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate a new controller with the given controller name, and test file -export extern "cargo loco g controller" [ - name: string # Name of the thing to generate - ...actions: string # Actions - --kind(-k): string@"nu-complete kind" # The kind of controller actions to generate - --htmx # Use HTMX controller actions - --html # Use HTML controller actions - --api # Use API controller actions - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generates a CRUD scaffold, model and controller -export extern "cargo loco g scaffold" [ - name: string # Name of the thing to generate - ...fields: string@"nu-complete generate fields" # Model fields, eg. title:string hits:int - --kind(-k): string@"nu-complete kind" # The kind of controller actions to generate - --htmx # Use HTMX controller actions - --html # Use HTML controller actions - --api # Use API controller actions - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate a Task based on the given name -export extern "cargo loco g task" [ - name: string # Name of the thing to generate - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate a scheduler jobs configuration template -export extern "cargo loco g scheduler" [ - name: string # Name of the thing to generate - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate worker -export extern "cargo loco g worker" [ - name: string # Name of the thing to generate - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate mailer -export extern "cargo loco g mailer" [ - name: string # Name of the thing to generate - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Generate a deployment infrastructure -export extern "cargo loco g deployment" [ - --kind: string@"nu-complete deployment" # The kind of deployment to generate - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Override templates and allows you to take control of them. You can always go back when deleting the local template -export extern "cargo loco g override" [ - template: path@"nu-complete template" # The path to a specific template or directory to copy - --info # Show available templates to copy under the specified directory without actually coping them - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Validate and diagnose configurations -export extern "cargo loco doctor" [ - --config(-c) # print out the current configurations - --production(-p) # print out the current configurations - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Display the app version -export extern "cargo loco version" [ - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] - -# Watch -export extern "cargo loco watch" [ - --worker(-w) # start worker - --server-and-worker(-s) # start same-process server and worker - --environment(-e): string@"nu-complete environment" = "development" # Specify the environment - --help(-h) # Print help - --version(-V) # Print version -] + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco db] [ + subcommand?: words ["create" "drop" "migrate" "reset" "seed" "setup" "truncate"] + ...args: text + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help +] where { + terminal [--help] +} + +export complete [cargo loco task] [ + name: by "nu-complete tasks" # Task name (identifier) + ...params: text # Task params (e.g. `foo:bar baz:qux`) + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco jobs] [ + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco jobs cancel] [ + --name: text # Names of jobs to cancel + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco jobs tidy] [ + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco jobs purge] [ + --max-age: text # Deletes jobs with errors or cancelled, older than the specified maximum age in days + --status: words ["queued" "processing" "completed" "failed" "cancelled"] # Limits the jobs being saved to those with specific criteria like `completed` or `queued` + --dump: path # Saves the details of jobs into a file before deleting them + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco jobs dump] [ + --status: words ["queued" "processing" "completed" "failed" "cancelled"] # Limits the jobs being saved to those with specific criteria like `completed` or `queued` + --folder(-f): path # Folder to save the job files + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco jobs import] [ + --file(-f): path # Path to the file containing job details to import + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco scheduler] [ + --name(-n): by "nu-complete scheduler jobs" [environment: --environment] # Run a specific job by its name + --tag(-t): by "nu-complete scheduler tags" [environment: --environment] # Run jobs that are associated with a specific tag + --config(-c): path # Specify a path to a dedicated scheduler configuration file. by default load schedulers job setting from environment config + --list(-l) # Show all configured jobs + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] + at-most-one [--name --tag] +} + +export complete [cargo loco generate] [ + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco generate model] [ + name: text # Name of the thing to generate + ...fields: loco.field with { root.type: by "nu-complete column types" } # Model fields, eg. title:string hits:int + --link(-l) # Is it a link table? Use this in many-to-many relations + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco generate migration] [ + name: text # Name of the migration to generate + ...fields: loco.field with { root.type: by "nu-complete column types" } # Table fields, eg. title:string hits:int + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco generate controller] [ + name: text # Name of the thing to generate + ...actions: text # Actions + --kind(-k): words ["htmx" "html" "api"] # The kind of controller actions to generate + --htmx # Use HTMX controller actions + --html # Use HTML controller actions + --api # Use API controller actions + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] + at-most-one [--kind --htmx --html --api] +} + +export complete [cargo loco generate scaffold] [ + name: text # Name of the thing to generate + ...fields: loco.field with { root.type: by "nu-complete column types" } # Model fields, eg. title:string hits:int + --kind(-k): words ["htmx" "html" "api"] # The kind of controller actions to generate + --htmx # Use HTMX controller actions + --html # Use HTML controller actions + --api # Use API controller actions + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] + at-most-one [--kind --htmx --html --api] +} + +export complete [cargo loco generate task] [ + name: text # Name of the thing to generate + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco generate scheduler] [ + name: text # Name of the thing to generate + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco generate worker] [ + name: text # Name of the thing to generate + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco generate mailer] [ + name: text # Name of the thing to generate + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco generate deployment] [ + --kind: words ["docker" "shuttle" "nginx"] # The kind of deployment to generate + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco generate override] [ + template: words ["controller" "controller/api" "controller/api/controller.t" "controller/api/test.t" "controller/html" "controller/html/controller.t" "controller/html/view.t" "controller/htmx" "controller/htmx/controller.t" "controller/htmx/view.t" "deployment" "deployment/docker" "deployment/docker/docker.t" "deployment/docker/ignore.t" "deployment/nginx" "deployment/nginx/nginx.t" "deployment/shuttle" "deployment/shuttle/config.t" "deployment/shuttle/shuttle.t" "mailer" "mailer/html.t" "mailer/mailer.t" "mailer/subject.t" "mailer/text.t" "migration" "migration/add_columns.t" "migration/add_references.t" "migration/empty.t" "migration/join_table.t" "migration/remove_columns.t" "model" "model/model.t" "model/test.t" "scaffold" "scaffold/api" "scaffold/api/controller.t" "scaffold/api/test.t" "scaffold/html" "scaffold/html/base.t" "scaffold/html/controller.t" "scaffold/html/view.t" "scaffold/html/view_create.t" "scaffold/html/view_edit.t" "scaffold/html/view_list.t" "scaffold/html/view_show.t" "scaffold/htmx" "scaffold/htmx/base.t" "scaffold/htmx/controller.t" "scaffold/htmx/view.t" "scaffold/htmx/view_create.t" "scaffold/htmx/view_edit.t" "scaffold/htmx/view_list.t" "scaffold/htmx/view_show.t" "scheduler" "scheduler/scheduler.t" "task" "task/task.t" "task/test.t" "worker" "worker/test.t" "worker/worker.t"] # The path to a specific template or directory to copy + --info # Show available templates to copy under the specified directory without actually coping them + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco g] [ + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco g model] [ + name: text # Name of the thing to generate + ...fields: loco.field with { root.type: by "nu-complete column types" } # Model fields, eg. title:string hits:int + --link(-l) # Is it a link table? Use this in many-to-many relations + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco g migration] [ + name: text # Name of the migration to generate + ...fields: loco.field with { root.type: by "nu-complete column types" } # Table fields, eg. title:string hits:int + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco g controller] [ + name: text # Name of the thing to generate + ...actions: text # Actions + --kind(-k): words ["htmx" "html" "api"] # The kind of controller actions to generate + --htmx # Use HTMX controller actions + --html # Use HTML controller actions + --api # Use API controller actions + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] + at-most-one [--kind --htmx --html --api] +} + +export complete [cargo loco g scaffold] [ + name: text # Name of the thing to generate + ...fields: loco.field with { root.type: by "nu-complete column types" } # Model fields, eg. title:string hits:int + --kind(-k): words ["htmx" "html" "api"] # The kind of controller actions to generate + --htmx # Use HTMX controller actions + --html # Use HTML controller actions + --api # Use API controller actions + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] + at-most-one [--kind --htmx --html --api] +} + +export complete [cargo loco g task] [ + name: text # Name of the thing to generate + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco g scheduler] [ + name: text # Name of the thing to generate + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco g worker] [ + name: text # Name of the thing to generate + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco g mailer] [ + name: text # Name of the thing to generate + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco g deployment] [ + --kind: words ["docker" "shuttle" "nginx"] # The kind of deployment to generate + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco g override] [ + template: words ["controller" "controller/api" "controller/api/controller.t" "controller/api/test.t" "controller/html" "controller/html/controller.t" "controller/html/view.t" "controller/htmx" "controller/htmx/controller.t" "controller/htmx/view.t" "deployment" "deployment/docker" "deployment/docker/docker.t" "deployment/docker/ignore.t" "deployment/nginx" "deployment/nginx/nginx.t" "deployment/shuttle" "deployment/shuttle/config.t" "deployment/shuttle/shuttle.t" "mailer" "mailer/html.t" "mailer/mailer.t" "mailer/subject.t" "mailer/text.t" "migration" "migration/add_columns.t" "migration/add_references.t" "migration/empty.t" "migration/join_table.t" "migration/remove_columns.t" "model" "model/model.t" "model/test.t" "scaffold" "scaffold/api" "scaffold/api/controller.t" "scaffold/api/test.t" "scaffold/html" "scaffold/html/base.t" "scaffold/html/controller.t" "scaffold/html/view.t" "scaffold/html/view_create.t" "scaffold/html/view_edit.t" "scaffold/html/view_list.t" "scaffold/html/view_show.t" "scaffold/htmx" "scaffold/htmx/base.t" "scaffold/htmx/controller.t" "scaffold/htmx/view.t" "scaffold/htmx/view_create.t" "scaffold/htmx/view_edit.t" "scaffold/htmx/view_list.t" "scaffold/htmx/view_show.t" "scheduler" "scheduler/scheduler.t" "task" "task/task.t" "task/test.t" "worker" "worker/test.t" "worker/worker.t"] # The path to a specific template or directory to copy + --info # Show available templates to copy under the specified directory without actually coping them + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco doctor] [ + --config(-c) # print out the current configurations + --production(-p) # print out the current configurations + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco version] [ + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} + +export complete [cargo loco watch] [ + --worker(-w) # start worker + --server-and-worker(-s) # start same-process server and worker + --environment(-e): by "nu-complete environment" # Specify the environment + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help] +} diff --git a/custom-completions/cargo-make/cargo-make-completions.nu b/custom-completions/cargo-make/cargo-make-completions.nu index 8c1986779..62a74fbca 100644 --- a/custom-completions/cargo-make/cargo-make-completions.nu +++ b/custom-completions/cargo-make/cargo-make-completions.nu @@ -1,41 +1,9 @@ alias makers = cargo make alias "carg-make make" = cargo make -export extern "cargo make" [ - task?: string@"nu-complete tasks" # task to run - --help(-h) # Print help information - --version(-V) # Print version information - --makefile: path # The optional toml file containing the tasks definitions - --task(-t): string@"nu-complete tasks" # The task name to execute (can omit the flag if the task name is the last argument) [default: default] - --profile(-p): string # The profile name (will be converted to lower case) [default: development] - # --profile(-p): string@"nu-complete profiles" # The profile name (will be converted to lower case) [default: development] - --cwd: path # Will set the current working directory. The search for the makefile will be from this directory if defined. - --no-workspace # Disable workspace support (tasks are triggered on workspace and not on members) - --no-on-error # Disable on error flow even if defined in config sections - --allow-private # Allow invocation of private tasks - --skip-init-end-tasks # If set, init and end tasks are skipped - --skip-tasks: string # Skip all tasks that match the provided regex (example: pre.*|post.*) - --env-file: path # Set environment variables from provided file - --env(-e): string # Set environment variables - --loglevel(-l): string@"nu-complete loglevels" # The log level (verbose, info, error, off) [default: info] - --verbose(-v) # Sets the log level to verbose (shorthand for --loglevel verbose) - --quiet # Sets the log level to error (shorthand for --loglevel error) - --silent # Sets the log level to off (shorthand for --loglevel off) - --no-color # Disables colorful output - --time-summary # Print task level time summary at end of flow - --experimental # Allows access unsupported experimental predefined tasks. - --disable-check-for-updates # Disables the update check during startup - --output-format: string@"nu-complete output-format" # The print/list steps format (some operations do not support all formats) (default, short-description, markdown, markdown-single-page, markdown-sub-section, autocomplete) - --output-file: path # The list steps output file name - --hide-uninteresting # Hide any minor tasks such as pre/post hooks. - --print-steps # Only prints the steps of the build in the order they will be invoked but without invoking them - --list-all-steps # Lists all known steps - --list-category-steps: string # List steps for a given category - --diff-steps # Runs diff between custom flow and prebuilt flow (requires git) -] - -def "nu-complete tasks" [] { - open Makefile.toml | get tasks | columns +@non-destructive +export def "nu-complete tasks" [makefile?: string] { + try { open ($makefile | default Makefile.toml) | get tasks | transpose name t | each {|r| {value: $r.name, description: ($r.t.description? | default '')} } } catch { [] } } def "nu-complete profiles" [] { @@ -48,4 +16,43 @@ def "nu-complete loglevels" [] { def "nu-complete output-format" [] { ['default', 'short-description', 'markdown', 'markdown-single-page', 'markdown-sub-section', 'autocomplete'] -} \ No newline at end of file +} + +export complete [cargo make] [ + task?: by "nu-complete tasks" [makefile: --makefile] # task to run + --help(-h) # Print help information + --version(-V) # Print version information + --makefile: path # The optional toml file containing the tasks definitions + --task(-t): by "nu-complete tasks" [makefile: --makefile] # The task name to execute (can omit the flag if the task name is the last argument) + --profile(-p): text # The profile name (will be converted to lower case) [default: development] + --cwd: dir cwd # Will set the current working directory. The search for the makefile will be from this directory if defined. + --no-workspace # Disable workspace support (tasks are triggered on workspace and not on members) + --no-on-error # Disable on error flow even if defined in config sections + --allow-private # Allow invocation of private tasks + --skip-init-end-tasks # If set, init and end tasks are skipped + --skip-tasks: text # Skip all tasks that match the provided regex (example: pre.*|post.*) + --env-file: path # Set environment variables from provided file + --env(-e): text # Set environment variables + --loglevel(-l): words ["verbose" "info" "error" "off"] # The log level (verbose, info, error, off) [default: info] + --verbose(-v) # Sets the log level to verbose (shorthand for --loglevel verbose) + --quiet # Sets the log level to error (shorthand for --loglevel error) + --silent # Sets the log level to off (shorthand for --loglevel off) + --no-color # Disables colorful output + --time-summary # Print task level time summary at end of flow + --experimental # Allows access unsupported experimental predefined tasks. + --disable-check-for-updates # Disables the update check during startup + --output-format: words ["default" "short-description" "markdown" "markdown-single-page" "markdown-sub-section" "autocomplete"] # The print/list steps format (some operations do not support all formats) (default, short-description, markdown, markdown-single-page, markdown-sub-section, autocomplete) + --output-file: path # The list steps output file name + --hide-uninteresting # Hide any minor tasks such as pre/post hooks. + --print-steps # Only prints the steps of the build in the order they will be invoked but without invoking them + --list-all-steps # Lists all known steps + --list-category-steps: text # List steps for a given category + --diff-steps # Runs diff between custom flow and prebuilt flow (requires git) +] where { + at-most-one [--verbose --quiet] + terminal [--help] + at-most-one [--verbose --quiet --silent --loglevel] + at-most-one [--print-steps --list-all-steps --list-category-steps --diff-steps] + requires --output-file --list-all-steps + terminal [--version --list-all-steps --list-category-steps --diff-steps] +} diff --git a/custom-completions/cargo/cargo-completions.nu b/custom-completions/cargo/cargo-completions.nu index 886318a6d..723f47866 100644 --- a/custom-completions/cargo/cargo-completions.nu +++ b/custom-completions/cargo/cargo-completions.nu @@ -1,589 +1,108 @@ ## Written by lukexor, Improved by @Dan-Gamin +## Ported to declarative completions (`export complete`). -def "nu-complete cargo targets" [type: string] { - ^cargo metadata --format-version=1 --offline --no-deps | from json | get packages.targets | flatten | where ($type in $it.kind) | get name -} -def "nu-complete cargo bins" [] { nu-complete cargo targets bin } -def "nu-complete cargo examples" [] { nu-complete cargo targets example } - -def "nu-complete cargo packages" [] { - let metadata = (^cargo metadata --format-version=1 --offline --no-deps) - if $metadata == '' { - [] - } else { - $metadata | from json | get packages.name - } -} - -def "nu-complete cargo color" [] { - ['auto', 'always', 'never'] -} - -def "nu-complete cargo profiles" [] { - open Cargo.toml | get profile | transpose | get column0 -} - -def "nu-complete cargo features" [] { - open Cargo.toml | get features | transpose | get column0 -} - -# `cargo --list` is slow, `open` is faster. -# TODO: Add caching. -def "nu-complete cargo subcommands" [] { - ^cargo --list | lines | skip 1 | str join "\n" | from ssv --noheaders | get column0 -} -def "nu-complete cargo vcs" [] { - [ - 'git', - 'hg', - 'pijul', - 'fossil', - 'none' - ] -} - -#*> Core <*# - -# Disabled due to messing with undefined cargo-subcommands - -# # Rust's package manager -# export extern "cargo" [ -# --version(-V) # Print version info and exit -# --list # List installed commands -# --explain: number # Run `rustc --explain CODE` -# --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output -# --quiet(-q) # Do not print cargo log messages -# --color: string@"nu-complete cargo color" # Control when colored output is used -# --frozen # Require Cargo.lock and cache are up to date -# --locked # Require Cargo.lock is up to date -# --offline # Run without accessing the network -# --config: string # Override a configuration value -# -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details -# -h, --help # Print help information -# ...args: any -# ] - -#*> Common Commands (Sorted by order shown by running the `cargo` command) <*# - -# Compile the current package -export extern "cargo build" [ - --package(-p): string@"nu-complete cargo packages" # Build only the specified packages - --workspace # Build all members in the workspace - --exclude: string@"nu-complete cargo packages" # Exclude the specified packages - --lib # Build the package's library - --bin: string@"nu-complete cargo bins" # Build the specified binary - --bins # Build all binary targets - --example: string@"nu-complete cargo examples" # Build the specified example - --examples # Build all example targets - --test: string # Build the specified integration test - --tests # Build all targets in test mode that have the test = true manifest flag set - --bench: string # Build the specified benchmark - --benches # Build all targets in benchmark mode that have the bench = true manifest flag set - --all-targets # Build all targets - --features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate - --all-features # Activate all available features of all selected packages - --no-default-features # Do not activate the default feature of the selected packages - --target: string # Build for the given architecture. - --release(-r) # Build optimized artifacts with the release profile - --profile: string@"nu-complete cargo profiles" # Build with the given profile - --ignore-rust-version # Ignore `rust-version` specification in packages - --timings # Output information how long each compilation takes - --target-dir: path # Directory for all generated artifacts and intermediate files - --out-dir: path # Copy final artifacts to this directory - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --message-format: string # The output format for diagnostic messages - --build-plan # Outputs a series of JSON messages to stdout that indicate the commands to run the build - --manifest-path: path # Path to the Cargo.toml file - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - -h, --help # Print help information - --jobs(-j): number # Number of parallel jobs to run - --future-incompat-report # Displays a future-incompat report for any future-incompatible warnings -] - -# Check the current package -export extern "cargo check" [ - --package(-p): string@"nu-complete cargo packages" #Check only the specified packages - --workspace # Check all members in the workspace - --all # Alias for --workspace (deprecated) - --exclude: string@"nu-complete cargo packages" # Exclude the specified packages - --lib # Check the package's library - --bin: string@"nu-complete cargo bins" # Check the specified binary - --example: string@"nu-complete cargo examples" # Check the specified example - --examples # Check all example targets - --test: string # Check the specified integration test - --tests # Check all targets in test mode that have the test = true manifest flag set - --bench: string # Check the specified benchmark - --benches # Check all targets in benchmark mode that have the bench = true manifest flag set - --all-targets # Check all targets - --features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate - --all-features # Activate all available features - --no-default-features # Do not activate the `default` feature - --target: string # Check for the given architecture - --release(-r) # Check optimized artifacts with the release profile - --profile: string@"nu-complete cargo profiles" # Check with the given profile - --ignore-rust-version # Ignore `rust-version` specification in packages - --timings # Output information how long each compilation takes - --target-dir: path # Directory for all generated artifacts and intermediate files - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --message-format: string # The output format for diagnostic messages - --manifest-path: path # Path to the Cargo.toml file - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - -h, --help # Print help information - --jobs(-j): number # Number of parallel jobs to run - --keep-going # Build as many crates in the dependency graph as possible - --future-incompat-report # Displays a future-incompat report for any future-incompatible warnings -] - -# Remove the target directory -export extern "cargo clean" [ - --package(-p): string@"nu-complete cargo packages" # Clean only the specified packages - --doc # Remove only the doc directory in the target directory - --release # Remove all artifacts in the release directory - --profile # Remove all artifacts in the directory with the given profile name - --target-dir: path # Directory for all generated artifacts and intermediate files - --target: string # Clean for the given architecture - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --message-format: string # The output format for diagnostic messages - --manifest-path: path # Path to the Cargo.toml file - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - -h, --help # Print help information -] - -# Build a package's documentation -export extern "cargo doc" [ - --open # Open the docs in a browser after building them - --no-deps # Do not build documentation for dependency - --document-private-items # Include non-public items in the documentation - --package(-p): string@"nu-complete cargo packages" # Document only the specified packages - --workspace # Document all members in the workspace - --exclude: string@"nu-complete cargo packages" # Exclude the specified packages - --lib: string # Document the package's library - --bin: string@"nu-complete cargo bins" # Document the specified binary - --bins # Document all binary targets - --example: string@"nu-complete cargo examples" # Document the specified example - --examples # Document all example targets - --features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate - --all-features # Activate all available features of all selected packages - --no-default-features # Do not activate the default feature of the selected packages - --target: string # Document for the given architecture - --release(-r) # Document optimized artifacts with the release profile - --profile: string@"nu-complete cargo profiles" # Document with the given profile - --ignore-rust-version # Ignore `rust-version` specification in packages - --timings # Output information how long each compilation takes - --target-dir: path # Directory for all generated artifacts and intermediate files - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --message-format: string # The output format for diagnostic messages - --manifest-path: path # Path to the Cargo.toml file - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - -h, --help # Print help information - --jobs(-j): number # Number of parallel jobs to run - --keep-going # Build as many crates in the dependency graph as possible -] - -# Create a new cargo package -export extern "cargo new" [ - path: path # The directory that will contain the project - --bin # Create a package with a binary target (src/main.rs) (default) - --lib # Create a package with a library target (src/lib.rs) - --edition: number # Specify the Rust edition to use (default: 2021) - --name: string # Set the package name. Defaults to the directory name. - --vcs: string@"nu-complete cargo vcs" # Initialize a new VCS repository for the given version control system - --registry: string # Name of the registry to use - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - -h, --help # Print help information -] - -# Create a new cargo package in an existing directory -export extern "cargo init" [ - path: path # The directory that will contain the project - --bin # Create a package with a binary target (src/main.rs) (default) - --lib # Create a package with a library target (src/lib.rs) - --edition: number # Specify the Rust edition to use (default: 2021) - --name: string # Set the package name. Defaults to the directory name. - --vcs: string@"nu-complete cargo vcs" # Initialize a new VCS repository for the given version control system - --registry: string # Name of the registry to use - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - -h, --help # Print help information -] - -# Run the current cargo package -export extern "cargo run" [ - ...args: any # Arguments to be passed to your program - --bin: string@"nu-complete cargo bins" # Name of the bin target to run - --example: string@"nu-complete cargo examples" # Name of the example target to run - --quiet(-q) # Do not print cargo log messages - --package(-p): string@"nu-complete cargo packages" # Package with the target to run - --jobs(-j): number # Number of parallel jobs, defaults to # of CPUs - --release # Build artifacts in release mode, with optimizations - --profile: string@"nu-complete cargo profiles" # Build artifacts with the specified profile - --features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate - --all-features # Activate all available features - --no-default-features # Do not activate the `default` feature - --target: string # Build for the target triple - --target-dir: path # Directory for all generated artifacts - --manifest-path: path # Path to Cargo.toml - --message-format: string # Error format - --unit-graph # Output build graph in JSON (unstable) - --ignore-rust-version # Ignore `rust-version` specification in packages - --verbose(-v) # Use verbose output (-vv very verbose/build.rs output) - --color: string@"nu-complete cargo color" # Control when colored output is used - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - --config: string # Override a configuration value (unstable) - -Z: string # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - --help(-h) # Prints help information -] - -# Run the tests -export extern "cargo test" [ - test_arg_separator?: string - ...args: any # Arguments to be passed to the tests - --no-run # Compile, but don't run tests - --no-fail-fast # Run all tests regardless of failure - --package(-p): string@"nu-complete cargo packages" # Test only the specified packages - --workspace # Test all members in the workspace - --exclude: string@"nu-complete cargo packages" # Exclude the specified packages - --lib # Test the package's library - --bin: string@"nu-complete cargo bins" # Test only the specified binary - --bins # Test all binaries - --example: string@"nu-complete cargo examples" # Test only the specified example - --examples # Test all examples - --test: string # Test the specified integration test - --tests # Test all targets in test mode that have the test = true manifest flag set - --bench: string # Test the specified benchmark - --benches # Test all targets in benchmark mode that have the bench = true manifest flag set - --all-targets # Test all targets - --doc # Test ONLY the library's documentation - --features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate - --all-features # Activate all available features of all selected packages - --no-default-features # Do not activate the default feature of the selected packages - --target: string # Test for the given architecture - --release(-r) # Test optimized artifacts with the release profile - --profile: string@"nu-complete cargo profiles" # Test with the given profile - --ignore-rust-version # Ignore `rust-version` specification in packages - --timings # Output information how long each compilation takes - --target-dir: path # Directory for all generated artifacts and intermediate files - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --message-format: string # The output format for diagnostic messages - --manifest-path: path # Path to the Cargo.toml file - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - --help(-h) # Prints help information - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - --jobs(-j): number # Number of parallel jobs to run - --keep-going # Build as many crates in the dependency graph as possible - --future-incompat-report # Displays a future-incompat report for any future-incompatible warnings -] - -# Execute benchmarks of a package -export extern "cargo bench" [ - bench_option_separator?: string - ...options: any # Options to be passed to the benchmarks - --no-run # Compile, but don't run benchmarks - --no-fail-fast # Run all benchmarks regardless of failure - --package(-p): string@"nu-complete cargo packages" # Benchmark only the specified packages - --workspace # Benchmark all members in the workspace - --exclude: string@"nu-complete cargo packages" # Exclude the specified packages - --lib # Benchmark the package's library - --bin: string@"nu-complete cargo bins" # Benchmark only the specified binary - --bins # Benchmark all binary targets - --example: string@"nu-complete cargo examples" # Benchmark only the specified example - --examples # Benchmark all example targets - --test: string # Benchmark the specified integration test - --tests # Benchmark all targets in test mode that have the test = true - --bench: string # Benchmark the specified benchmark - --benches # Benchmark all targets in benchmark mode that have the bench = true manifest flag set - --all-targets # Benchmark all targets - --features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate - --all-features # Activate all available features of all selected packages - --no-default-features # Do not activate the default feature of the selected packages - --target: string # Benchmark for the given architecture - --profile: string@"nu-complete cargo profiles" # Build artifacts with the specified profile - --ignore-rust-version # Ignore `rust-version` specification in packages - --timings # Output information how long each compilation takes - --target-dir: path # Directory for all generated artifacts and intermediate files - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --message-format: string # The output format for diagnostic messages - --build-plan # Outputs a series of JSON messages to stdout that indicate the commands to run the build - --manifest-path: path # Path to the Cargo.toml file - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - -h, --help # Print help information - --jobs(-j): number # Number of parallel jobs to run - --keep-going # Build as many crates in the dependency graph as possible -] - -# Update dependencies listed in Cargo.lock -export extern "cargo update" [ - --package(-p): string@"nu-complete cargo packages" # Update only the specified packages - --aggressive # Dependencies of the specified packages are forced to update as well - --precise: any # Allows you to specify a specific version number to set the package to - --workspace(-w) # Attempt to update only packages defined in the workspace - --dry-run # Displays what would be updated but doesn't write the lockfile - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --manifest-path: path # Path to the Cargo.toml file - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - --help(-h) # Prints help information - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details -] - -# Search packages in crates.io -export extern "cargo search" [ - query: string # The thing to search - --limit: number # Limit the number of results. (default: 10, max: 100) - --index: string # The URL of the registry index to use - --registry: string # Name of the registry to use - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --help(-h) # Prints help information - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details -] - -# Package and upload a package to the registry -export extern "cargo publish" [ - --dry-run # Perform all checks without uploading - --token: any # API token to use when authenticating - --no-verify # Don't verify the contents by building them - --allow-dirty # Allow working directories with uncommitted VCS changes to be packaged - --index: string # The URL of the registry index to use - --registry: string # Name of the registry to publish to - --package(-p): string@"nu-complete cargo packages" # The package to publish - --target: string # Publish for the given architecture - --target-dir: path # Directory for all generated artifacts and intermediate files - --features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate - --all-features # Activate all available features of all selected packages - --no-default-features # Do not activate the default feature of the selected packages - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --manifest-path: path # Path to the Cargo.toml file - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - --help(-h) # Prints help information - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - --jobs(-j): number # Number of parallel jobs to run - --keep-going # Build as many crates in the dependency graph as possible -] - -# Build and install a Rust binary -export extern "cargo install" [ - crate?: string # The crate to install - --version: string # Specify a version to install - --vers: string # Specify a version to install - --git: string # Git URL to install the specified crate from - --branch: string # Branch to use when installing from git - --tag: string # Tag to use when installing from git - --rev: string # Specific commit to use when installing from git - --path: path # Filesystem path to local crate to install - --list # List all installed packages and their versions - --force(-f) # Force overwriting existing crates or binaries - --no-track # Don't keep track of this package - --bin: string@"nu-complete cargo bins" # Install only the specified binary - --bins # Install all binaries - --example: string@"nu-complete cargo examples" # Install only the specified example - --examples # Install all examples - --root: path # Directory to install packages into - --registry: string # Name of the registry to use - --index: string # The URL of the registry index to use - --features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate - --all-features # Activate all available features of all selected packages - --no-default-features # Do not activate the default feature of the selected packages - --target: string # Install for the given architecture - --target-dir: path # Directory for all generated artifacts and intermediate files - --debug # Build with the dev profile instead the release profile - --profile: string@"nu-complete cargo profiles" # Build artifacts with the specified profile - --timings # Output information how long each compilation takes - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - --jobs(-j): number # Number of parallel jobs to run - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --message-format: string # The output format for diagnostic messages - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - -h, --help # Print help information -] - -# Remove a Rust binary -export extern "cargo uninstall" [ - package?: string@"nu-complete cargo packages" # Package to uninstall - --package(-p): string@"nu-complete cargo packages" # Package to uninstall - --bin: string@"nu-complete cargo bins" # Only uninstall the binary name - --root: path # Directory to uninstall packages from - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - -h, --help # Print help information -] - -#*> Other Commands <*# - -# Output the resolved dependencies of a package in machine-readable format -export extern "cargo metadata" [ - --no-deps # Output information only about the workspace members and don't fetch dependencies - --format-version: number # Specify the version of the output format to use. Currently 1 is the only possible value - --filter-platform: string # This filters the resolve output to only include dependencies for the iven target triple - --features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate - --all-features # Activate all available features of all selected packages - --no-default-features # Do not activate the default feature of the selected packages - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --manifest-path: path # Path to the Cargo.toml file - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - --help(-h) # Prints help information - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details -] - -# Get the help of the given cargo subcommand -export extern "cargo help" [ - subcommand: string@"nu-complete cargo subcommands" - --color: string@"nu-complete cargo color" # Control when colored output is used - --config: string # Override a configuration value - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details -] - -# A bunch of lints to catch common mistakes and improve your Rust code -export extern "cargo clippy" [ - --no-deps # Run Clippy only on the given crate, without linting the dependencies - --fix # Automatically apply lint suggestions. This flag implies `--no-deps - --version(-V) # Prints version information - --help(-h) # Prints help information - --warn(-W): string # Set lint warnings - --allow(-A): string # Set lint allowed - --deny(-D): string # Set lint denied - --forbid(-F): string # Set lint forbidden - --package(-p): string@"nu-complete cargo packages" #Check only the specified packages - --workspace # Check all members in the workspace - --all # Alias for --workspace (deprecated) - --exclude: string@"nu-complete cargo packages" # Exclude the specified packages - --lib # Check the package's library - --bin: string@"nu-complete cargo bins" # Check the specified binary - --example: string@"nu-complete cargo examples" # Check the specified example - --examples # Check all example targets - --test: string # Check the specified integration test - --tests # Check all targets in test mode that have the test = true manifest flag set - --bench: string # Check the specified benchmark - --benches # Check all targets in benchmark mode that have the bench = true manifest flag set - --all-targets # Check all targets - --features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate - --all-features # Activate all available features - --no-default-features # Do not activate the `default` feature - --target: string # Check for the given architecture - --release(-r) # Check optimized artifacts with the release profile - --profile: string@"nu-complete cargo profiles" # Check with the given profile - --ignore-rust-version # Ignore `rust-version` specification in packages - --timings # Output information how long each compilation takes - --target-dir: path # Directory for all generated artifacts and intermediate files - --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output - --quiet(-q) # Do not print cargo log messages - --color: string@"nu-complete cargo color" # Control when colored output is used - --message-format: string # The output format for diagnostic messages - --manifest-path: path # Path to the Cargo.toml file - --frozen # Require Cargo.lock and cache are up to date - --locked # Require Cargo.lock is up to date - --offline # Run without accessing the network - -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - -h, --help # Print help information - --jobs(-j): number # Number of parallel jobs to run - --keep-going # Build as many crates in the dependency graph as possible - --future-incompat-report # Displays a future-incompat report for any future-incompatible warnings - -Z: any -] - -# Parameters from cargo update -export extern "cargo install-update" [ - --all(-a) # Update all packages - --allow-no-update(-i) # Allow for fresh-installing packages - --downdate(-d) # Downdate packages to match latest unyanked registry version - --force(-f) # Update all packages regardless if they need updating - --git(-g) # Also update git packages - --help(-h) # Prints help information - --list(-l) # Don't update packages, only list and check if they need an update (all packages by default) - --quiet(-q) # No output printed to stdout - --version(-V) # Prints version information - --cargo-dir(-c) # The cargo home directory. Default: $CARGO_HOME or $HOME/.cargo - --filter(-s) # Specify a filter a package must match to be considered - --install-cargo(-r) # Specify an alternative cargo to run for installations - --temp-dir(-t) # The temporary directory. Default: $TEMP/cargo-update -] - -# Parameters from cargo add -export extern "cargo add" [ - --no-default-features # Disable the default features - --default-features # Re-enable the default features - --features(-F) # Space or comma separated list of features to activate - --optional # Mark the dependency as optional - --verbose(-v) # Use verbose output (-vv very verbose/build.rs output) - --no-optional # Mark the dependency as required - --color: string@"nu-complete cargo color" # Coloring: auto, always, never - --rename # Rename the dependency - --locked # Require Cargo.lock is up to date - --package(-p) # Package to modify - --offline # Run without accessing the network - --quiet(-q) # Do not print cargo log messages - --config # Override a configuration value - --dry-run # Don't actually write the manifest - --help(-h) # Print help information - --path # Filesystem path to local crate to add - --git # Git repository location - --branch # Git branch to download the crate from - --tag # Git tag to download the crate from - --rev # Git reference to download the crate from - --registry # Package registry for this dependency - --dev # Add as development dependency - --build # Add as build dependency - --target # Add as dependency to the given target platform - ...args -] +# The packages of the workspace, from `cargo metadata` (no lockfile written, no toolchain installed). +def workspace-packages [manifest?: string]: nothing -> list { + let args = if ($manifest | is-empty) { [] } else { ['--manifest-path' $manifest] } + try { + with-env { RUSTUP_AUTO_INSTALL: "0" } { + ^cargo metadata --format-version=1 --offline --no-deps ...$args | from json | get packages + } + } catch { [] } +} + +# The packages of the workspace, one row each: `name`, `version` and the `manifest` path. Reads only. +@non-destructive +export def cargo-packages []: nothing -> table { + workspace-packages | each {|pkg| {name: $pkg.name, version: $pkg.version, manifest: $pkg.manifest_path} } +} + +# The targets of the workspace, one row each: `name`, `kind`, `package` and source `path`. Reads only. +@non-destructive +export def cargo-targets []: nothing -> table { + workspace-packages + | each {|pkg| $pkg.targets | each {|target| {name: $target.name, kind: ($target.kind | first), package: $pkg.name, path: $target.src_path} } } + | flatten +} + +# Targets of one kind (bin, example, test, bench), narrowed to the `--package` given (if any). +def target-names [kind: string, package?: string]: nothing -> list { + workspace-packages + | where {|p| $package in [null '' $p.name] } + | each {|p| $p.targets | each {|t| {package: $p.name, ...$t} } } + | flatten + | where {|t| $kind in $t.kind } + | uniq-by name + | each {|t| {value: $t.name, description: $"($t.package) · ($t.src_path | path basename)"} } +} + +@non-destructive +export def "nu-complete cargo bins" [package?: string] { try { target-names bin $package } catch { [] } } +@non-destructive +export def "nu-complete cargo examples" [package?: string] { try { target-names example $package } catch { [] } } +@non-destructive +export def "nu-complete cargo tests" [package?: string] { try { target-names test $package } catch { [] } } +@non-destructive +export def "nu-complete cargo benches" [package?: string] { try { target-names bench $package } catch { [] } } + +# Workspace members, with their version. +@non-destructive +export def "nu-complete cargo packages" [manifest?: string] { + try { workspace-packages $manifest | each {|p| {value: $p.name, description: $p.version} } } catch { [] } +} + +# Dependencies declared in the current Cargo.toml (for `cargo remove`, `cargo update -p`, `cargo tree -i`). +@non-destructive +export def "nu-complete cargo dependencies" [] { + try { + let m = open Cargo.toml + [dependencies dev-dependencies build-dependencies] + | each {|section| $m | get -o $section | default {} | columns | each {|d| {value: $d, description: $section} } } + | flatten + | uniq-by value + } catch { [] } +} + +# Packages installed with `cargo install`. +@non-destructive +export def "nu-complete cargo installed" [] { + try { ^cargo install --list | lines | where $it !~ '^\s' | parse '{value} v{description}:' } catch { [] } +} + +# Features of the workspace (narrowed to `--package`); `[features]` of Cargo.toml as a fallback. +@non-destructive +export def "nu-complete cargo features" [package?: string] { + try { + let found = workspace-packages + | where {|p| $package in [null '' $p.name] } + | each {|p| $p.features | items {|name, enables| {value: $name, description: ($enables | str join ', ')} } } + | flatten + | uniq-by value + if ($found | is-empty) { + open Cargo.toml | get -o features | default {} | columns + } else { $found } + } catch { [] } +} + +# Built-in profiles plus the custom `[profile.*]` tables of the manifest. +@non-destructive +export def "nu-complete cargo profiles" [manifest?: string] { + let file = $manifest | default Cargo.toml + let custom = try { open $file | get -o profile | default {} | columns } catch { [] } + [dev release test bench] ++ $custom | uniq +} + +# Installed subcommands (`cargo --list`). +@non-destructive +export def "nu-complete cargo subcommands" [] { + try { ^cargo --list | lines | skip 1 | parse --regex '^\s+(?\S+)\s*(?.*)$' } catch { [] } +} + +# Rust target triples known to rustup. +@non-destructive +export def "nu-complete cargo targets" [] { + try { ^rustup target list --installed | lines } catch { [] } +} # Cargo aliases export alias "cargo b" = cargo build @@ -592,3 +111,937 @@ export alias "cargo d" = cargo doc export alias "cargo r" = cargo run export alias "cargo rm" = cargo remove export alias "cargo t" = cargo test + +# A comma separated feature list (`--features a,b,c`): every element is a feature name. +export syntax cargo.features over chars { + root = feature: until ", " ("," feature: until ", ")* +} + +export complete [cargo] [ + ...args: text # Its arguments + --version(-V) # Print version info and exit + --list # List installed commands + --explain: text # Run `rustc --explain CODE` + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --config: text # Override a configuration value + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --help(-h) # Print help information + -C: dir cwd # Change to DIRECTORY before doing anything +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + terminal [--help --version] + terminal [--list --explain] +} + +export complete [cargo build] [ + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Build only the specified packages + --workspace # Build all members in the workspace + --exclude: by "nu-complete cargo packages" [manifest: --manifest-path] # Exclude the specified packages + --lib # Build the package's library + --bin: by "nu-complete cargo bins" [package: --package] # Build the specified binary + --bins # Build all binary targets + --example: by "nu-complete cargo examples" [package: --package] # Build the specified example + --examples # Build all example targets + --test: by "nu-complete cargo tests" [package: --package] # Build the specified integration test + --tests # Build all targets in test mode that have the test = true manifest flag set + --bench: by "nu-complete cargo benches" [package: --package] # Build the specified benchmark + --benches # Build all targets in benchmark mode that have the bench = true manifest flag set + --all-targets # Build all targets + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features of all selected packages + --no-default-features # Do not activate the default feature of the selected packages + --target: text # Build for the given architecture. + --release(-r) # Build optimized artifacts with the release profile + --profile: by "nu-complete cargo profiles" [manifest: --manifest-path] # Build with the given profile + --ignore-rust-version # Ignore `rust-version` specification in packages + --timings?: text # Output information how long each compilation takes + --target-dir: path # Directory for all generated artifacts and intermediate files + --out-dir: path # Copy final artifacts to this directory + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --message-format: text # The output format for diagnostic messages + --build-plan # Outputs a series of JSON messages to stdout that indicate the commands to run the build + --manifest-path: path # Path to the Cargo.toml file + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h # Print help information + --help # Print help information + --jobs(-j): text # Number of parallel jobs to run + --future-incompat-report # Displays a future-incompat report for any future-incompatible warnings +] where { + at-most-one [--verbose --quiet] + at-most-one [--release --profile] + at-most-one [--workspace --package] + at-most-one [--locked --frozen] + at-most-one [--lib --bins --all-targets] + at-most-one [--all-features --no-default-features] + terminal [--help] +} + +export complete [cargo check] [ + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Check only the specified packages + --workspace # Check all members in the workspace + --all # Alias for --workspace (deprecated) + --exclude: by "nu-complete cargo packages" [manifest: --manifest-path] # Exclude the specified packages + --lib # Check the package's library + --bin: by "nu-complete cargo bins" [package: --package] # Check the specified binary + --example: by "nu-complete cargo examples" [package: --package] # Check the specified example + --examples # Check all example targets + --test: by "nu-complete cargo tests" [package: --package] # Check the specified integration test + --tests # Check all targets in test mode that have the test = true manifest flag set + --bench: by "nu-complete cargo benches" [package: --package] # Check the specified benchmark + --benches # Check all targets in benchmark mode that have the bench = true manifest flag set + --all-targets # Check all targets + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features + --no-default-features # Do not activate the `default` feature + --target: text # Check for the given architecture + --release(-r) # Check optimized artifacts with the release profile + --profile: by "nu-complete cargo profiles" [manifest: --manifest-path] # Check with the given profile + --ignore-rust-version # Ignore `rust-version` specification in packages + --timings?: text # Output information how long each compilation takes + --target-dir: path # Directory for all generated artifacts and intermediate files + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --message-format: text # The output format for diagnostic messages + --manifest-path: path # Path to the Cargo.toml file + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h # Print help information + --help # Print help information + --jobs(-j): text # Number of parallel jobs to run + --keep-going # Build as many crates in the dependency graph as possible + --future-incompat-report # Displays a future-incompat report for any future-incompatible warnings +] where { + at-most-one [--verbose --quiet] + at-most-one [--release --profile] + at-most-one [--workspace --package] + at-most-one [--locked --frozen] + at-most-one [--lib --all-targets] + at-most-one [--all-features --no-default-features] + terminal [--help] +} + +export complete [cargo clean] [ + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Clean only the specified packages + --doc # Remove only the doc directory in the target directory + --release # Remove all artifacts in the release directory + --profile # Remove all artifacts in the directory with the given profile name + --target-dir: path # Directory for all generated artifacts and intermediate files + --target: text # Clean for the given architecture + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --message-format: text # The output format for diagnostic messages + --manifest-path: path # Path to the Cargo.toml file + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h # Print help information + --help # Print help information +] where { + at-most-one [--verbose --quiet] + at-most-one [--release --profile] + at-most-one [--locked --frozen] + terminal [--help] +} + +export complete [cargo doc] [ + --open # Open the docs in a browser after building them + --no-deps # Do not build documentation for dependency + --document-private-items # Include non-public items in the documentation + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Document only the specified packages + --workspace # Document all members in the workspace + --exclude: by "nu-complete cargo packages" [manifest: --manifest-path] # Exclude the specified packages + --lib: text # Document the package's library + --bin: by "nu-complete cargo bins" [package: --package] # Document the specified binary + --bins # Document all binary targets + --example: by "nu-complete cargo examples" [package: --package] # Document the specified example + --examples # Document all example targets + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features of all selected packages + --no-default-features # Do not activate the default feature of the selected packages + --target: text # Document for the given architecture + --release(-r) # Document optimized artifacts with the release profile + --profile: by "nu-complete cargo profiles" [manifest: --manifest-path] # Document with the given profile + --ignore-rust-version # Ignore `rust-version` specification in packages + --timings?: text # Output information how long each compilation takes + --target-dir: path # Directory for all generated artifacts and intermediate files + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --message-format: text # The output format for diagnostic messages + --manifest-path: path # Path to the Cargo.toml file + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h # Print help information + --help # Print help information + --jobs(-j): text # Number of parallel jobs to run + --keep-going # Build as many crates in the dependency graph as possible +] where { + at-most-one [--verbose --quiet] + at-most-one [--release --profile] + at-most-one [--workspace --package] + at-most-one [--locked --frozen] + at-most-one [--lib --bins] + at-most-one [--all-features --no-default-features] + terminal [--help] +} + +export complete [cargo new] [ + path: path # The directory that will contain the project + --bin # Create a package with a binary target (src/main.rs) (default) + --lib # Create a package with a library target (src/lib.rs) + --edition: text # Specify the Rust edition to use (default: 2021) + --name: text # Set the package name. Defaults to the directory name. + --vcs: words [git hg pijul fossil none] # Initialize a new VCS repository for the given version control system + --registry: text # Name of the registry to use + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h # Print help information + --help # Print help information +] where { + at-most-one [--verbose --quiet] + terminal [--help] + at-most-one [--bin --lib] +} + +export complete [cargo init] [ + path?: path # The directory that will contain the project (default: the current directory) + --bin # Create a package with a binary target (src/main.rs) (default) + --lib # Create a package with a library target (src/lib.rs) + --edition: text # Specify the Rust edition to use (default: 2021) + --name: text # Set the package name. Defaults to the directory name. + --vcs: words [git hg pijul fossil none] # Initialize a new VCS repository for the given version control system + --registry: text # Name of the registry to use + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h # Print help information + --help # Print help information +] where { + at-most-one [--verbose --quiet] + terminal [--help] + at-most-one [--bin --lib] +} + +export complete [cargo run] [ + ...args: text # Arguments to be passed to your program + --bin: by "nu-complete cargo bins" [package: --package] # Name of the bin target to run + --example: by "nu-complete cargo examples" [package: --package] # Name of the example target to run + --quiet(-q) # Do not print cargo log messages + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Package with the target to run + --jobs(-j): text # Number of parallel jobs, defaults to # of CPUs + --release # Build artifacts in release mode, with optimizations + --profile: by "nu-complete cargo profiles" [manifest: --manifest-path] # Build artifacts with the specified profile + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features + --no-default-features # Do not activate the `default` feature + --target: text # Build for the target triple + --target-dir: path # Directory for all generated artifacts + --manifest-path: path # Path to Cargo.toml + --message-format: text # Error format + --unit-graph # Output build graph in JSON (unstable) + --ignore-rust-version # Ignore `rust-version` specification in packages + --verbose(-v) # Use verbose output (-vv very verbose/build.rs output) + --color: words [auto always never] # Control when colored output is used + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --config: text # Override a configuration value (unstable) + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --help(-h) # Prints help information +] where { + at-most-one [--verbose --quiet] + at-most-one [--release --profile] + at-most-one [--locked --frozen] + at-most-one [--all-features --no-default-features] + terminal [--help] + at-most-one [--bin --example] +} + +export complete [cargo test] [ + test_arg_separator?: text + ...args: text # Arguments to be passed to the tests + --no-run # Compile, but don't run tests + --no-fail-fast # Run all tests regardless of failure + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Test only the specified packages + --workspace # Test all members in the workspace + --exclude: by "nu-complete cargo packages" [manifest: --manifest-path] # Exclude the specified packages + --lib # Test the package's library + --bin: by "nu-complete cargo bins" [package: --package] # Test only the specified binary + --bins # Test all binaries + --example: by "nu-complete cargo examples" [package: --package] # Test only the specified example + --examples # Test all examples + --test: by "nu-complete cargo tests" [package: --package] # Test the specified integration test + --tests # Test all targets in test mode that have the test = true manifest flag set + --bench: by "nu-complete cargo benches" [package: --package] # Test the specified benchmark + --benches # Test all targets in benchmark mode that have the bench = true manifest flag set + --all-targets # Test all targets + --doc # Test ONLY the library's documentation + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features of all selected packages + --no-default-features # Do not activate the default feature of the selected packages + --target: text # Test for the given architecture + --release(-r) # Test optimized artifacts with the release profile + --profile: by "nu-complete cargo profiles" [manifest: --manifest-path] # Test with the given profile + --ignore-rust-version # Ignore `rust-version` specification in packages + --timings?: text # Output information how long each compilation takes + --target-dir: path # Directory for all generated artifacts and intermediate files + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --message-format: text # The output format for diagnostic messages + --manifest-path: path # Path to the Cargo.toml file + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --help(-h) # Prints help information + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --jobs(-j): text # Number of parallel jobs to run + --keep-going # Build as many crates in the dependency graph as possible + --future-incompat-report # Displays a future-incompat report for any future-incompatible warnings +] where { + at-most-one [--verbose --quiet] + at-most-one [--release --profile] + at-most-one [--workspace --package] + at-most-one [--locked --frozen] + at-most-one [--lib --bins --all-targets] + at-most-one [--all-features --no-default-features] + terminal [--help] +} + +export complete [cargo bench] [ + bench_option_separator?: text + ...options: text # Options to be passed to the benchmarks + --no-run # Compile, but don't run benchmarks + --no-fail-fast # Run all benchmarks regardless of failure + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Benchmark only the specified packages + --workspace # Benchmark all members in the workspace + --exclude: by "nu-complete cargo packages" [manifest: --manifest-path] # Exclude the specified packages + --lib # Benchmark the package's library + --bin: by "nu-complete cargo bins" [package: --package] # Benchmark only the specified binary + --bins # Benchmark all binary targets + --example: by "nu-complete cargo examples" [package: --package] # Benchmark only the specified example + --examples # Benchmark all example targets + --test: by "nu-complete cargo tests" [package: --package] # Benchmark the specified integration test + --tests # Benchmark all targets in test mode that have the test = true + --bench: by "nu-complete cargo benches" [package: --package] # Benchmark the specified benchmark + --benches # Benchmark all targets in benchmark mode that have the bench = true manifest flag set + --all-targets # Benchmark all targets + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features of all selected packages + --no-default-features # Do not activate the default feature of the selected packages + --target: text # Benchmark for the given architecture + --profile: by "nu-complete cargo profiles" [manifest: --manifest-path] # Build artifacts with the specified profile + --ignore-rust-version # Ignore `rust-version` specification in packages + --timings?: text # Output information how long each compilation takes + --target-dir: path # Directory for all generated artifacts and intermediate files + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --message-format: text # The output format for diagnostic messages + --build-plan # Outputs a series of JSON messages to stdout that indicate the commands to run the build + --manifest-path: path # Path to the Cargo.toml file + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h # Print help information + --help # Print help information + --jobs(-j): text # Number of parallel jobs to run + --keep-going # Build as many crates in the dependency graph as possible +] where { + at-most-one [--verbose --quiet] + at-most-one [--workspace --package] + at-most-one [--locked --frozen] + at-most-one [--lib --bins --all-targets] + at-most-one [--all-features --no-default-features] + terminal [--help] +} + +export complete [cargo update] [ + --package(-p): by "nu-complete cargo dependencies" # Update only the specified packages + --aggressive # Dependencies of the specified packages are forced to update as well + --precise: text # Allows you to specify a specific version number to set the package to + --workspace(-w) # Attempt to update only packages defined in the workspace + --dry-run # Displays what would be updated but doesn't write the lockfile + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --manifest-path: path # Path to the Cargo.toml file + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --help(-h) # Prints help information + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details +] where { + at-most-one [--verbose --quiet] + at-most-one [--workspace --package] + at-most-one [--locked --frozen] + terminal [--help] +} + +export complete [cargo search] [ + query: text # The thing to search + --limit: text # Limit the number of results. (default: 10, max: 100) + --index: text # The URL of the registry index to use + --registry: text # Name of the registry to use + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --help(-h) # Prints help information + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details +] where { + at-most-one [--verbose --quiet] + terminal [--help] +} + +export complete [cargo publish] [ + --dry-run # Perform all checks without uploading + --token: text # API token to use when authenticating + --no-verify # Don't verify the contents by building them + --allow-dirty # Allow working directories with uncommitted VCS changes to be packaged + --index: text # The URL of the registry index to use + --registry: text # Name of the registry to publish to + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # The package to publish + --target: text # Publish for the given architecture + --target-dir: path # Directory for all generated artifacts and intermediate files + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features of all selected packages + --no-default-features # Do not activate the default feature of the selected packages + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --manifest-path: path # Path to the Cargo.toml file + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --help(-h) # Prints help information + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --jobs(-j): text # Number of parallel jobs to run + --keep-going # Build as many crates in the dependency graph as possible +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + at-most-one [--all-features --no-default-features] + terminal [--help] +} + +export complete [cargo install] [ + crate?: text # The crate to install + --version: text # Specify a version to install + --vers: text # Specify a version to install + --git: text # Git URL to install the specified crate from + --branch: text # Branch to use when installing from git + --tag: text # Tag to use when installing from git + --rev: text # Specific commit to use when installing from git + --path: path # Filesystem path to local crate to install + --list # List all installed packages and their versions + --force(-f) # Force overwriting existing crates or binaries + --no-track # Don't keep track of this package + --bin: by "nu-complete cargo bins" # Install only the specified binary + --bins # Install all binaries + --example: by "nu-complete cargo examples" # Install only the specified example + --examples # Install all examples + --root: path # Directory to install packages into + --registry: text # Name of the registry to use + --index: text # The URL of the registry index to use + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features of all selected packages + --no-default-features # Do not activate the default feature of the selected packages + --target: text # Install for the given architecture + --target-dir: path # Directory for all generated artifacts and intermediate files + --debug # Build with the dev profile instead the release profile + --profile: by "nu-complete cargo profiles" # Build artifacts with the specified profile + --timings?: text # Output information how long each compilation takes + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --jobs(-j): text # Number of parallel jobs to run + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --message-format: text # The output format for diagnostic messages + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h # Print help information + --help # Print help information +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + at-most-one [--all-features --no-default-features] + terminal [--help] + at-most-one [--path --git --registry] + at-most-one [--branch --tag --rev] +} + +export complete [cargo uninstall] [ + package?: by "nu-complete cargo installed" # Package to uninstall + --package(-p): by "nu-complete cargo packages" # Package to uninstall + --bin: by "nu-complete cargo bins" [package: --package] # Only uninstall the binary name + --root: path # Directory to uninstall packages from + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h # Print help information + --help # Print help information +] where { + at-most-one [--verbose --quiet] + terminal [--help] +} + +export complete [cargo metadata] [ + --no-deps # Output information only about the workspace members and don't fetch dependencies + --format-version: text # Specify the version of the output format to use. Currently 1 is the only possible value + --filter-platform: text # This filters the resolve output to only include dependencies for the iven target triple + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features of all selected packages + --no-default-features # Do not activate the default feature of the selected packages + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --manifest-path: path # Path to the Cargo.toml file + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --help(-h) # Prints help information + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + at-most-one [--all-features --no-default-features] + terminal [--help] +} + +export complete [cargo fmt] [ + --all # Format all packages in the workspace + --check # Exit with an error if any file is unformatted + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Format only the specified package + --manifest-path: path # Path to the Cargo.toml file + --verbose(-v) # Use verbose output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --help(-h) # Print help information + ...args: text # Options passed to rustfmt +] where { + at-most-one [--verbose --quiet] + terminal [--help] +} + +export complete [cargo fetch] [ + --target: text # Fetch for the given architecture + --manifest-path: path # Path to the Cargo.toml file + --verbose(-v) # Use verbose output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --help(-h) # Print help information +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + terminal [--help] +} + +export complete [cargo info] [ + crate?: text # The crate to look up + --registry: text # Registry to query + --index: text # Registry index URL to query + --verbose(-v) # Use verbose output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --help(-h) # Print help information +] where { + at-most-one [--verbose --quiet] + terminal [--help] +} + +export complete [cargo remove] [ + ...dependency: by "nu-complete cargo dependencies" # The dependencies to remove + --dev # Remove from dev-dependencies + --build # Remove from build-dependencies + --target: text # Remove from target-dependencies + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Package to remove from + --manifest-path: path # Path to the Cargo.toml file + --dry-run(-n) # Do not actually write the manifest + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --frozen # Require Cargo.lock and cache are up to date + --verbose(-v) # Use verbose output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --help(-h) # Print help information +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + terminal [--help] +} + +export complete [cargo tree] [ + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # The package to show the tree for + --invert(-i): by "nu-complete cargo dependencies" # Show the reverse dependencies of this package + --edges(-e): text # The dependency kinds to display (normal, build, dev, all) + --depth(-d): text # The maximum depth to display + --target: text # Filter dependencies by the target platform + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features + --no-default-features # Do not activate the default feature + --duplicates # Show only dependencies that appear more than once + --prune: text # Prune the given package from the tree + --manifest-path: path # Path to the Cargo.toml file + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --frozen # Require Cargo.lock and cache are up to date + --verbose(-v) # Use verbose output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --help(-h) # Print help information +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + at-most-one [--all-features --no-default-features] + terminal [--help] +} + +export complete [cargo fix] [ + --broken-code # Fix code even if it already has compiler errors + --edition # Apply the fixes for the 2021 edition idioms + --edition-idioms # Apply the fixes for the 2021 edition idioms + --allow-dirty # Allow fixing when the working tree is dirty + --allow-staged # Allow fixing when the index has staged changes + --allow-no-vcs # Allow fixing when there is no VCS + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Fix only the specified packages + --workspace # Fix all members of the workspace + --exclude: by "nu-complete cargo packages" [manifest: --manifest-path] # Exclude the specified packages + --lib # Fix the package's library + --bin: by "nu-complete cargo bins" [package: --package] # Fix the specified binary + --bins # Fix all binary targets + --example: by "nu-complete cargo examples" [package: --package] # Fix the specified example + --examples # Fix all example targets + --test: by "nu-complete cargo tests" [package: --package] # Fix the specified integration test + --tests # Fix all test targets + --bench: by "nu-complete cargo benches" [package: --package] # Fix the specified benchmark + --benches # Fix all benchmark targets + --all-targets # Fix all targets + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features + --no-default-features # Do not activate the default feature + --release # Fix optimized artifacts with the release profile + --profile: by "nu-complete cargo profiles" [manifest: --manifest-path] # Fix with the given profile + --target: text # Fix for the given architecture + --manifest-path: path # Path to the Cargo.toml file + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --frozen # Require Cargo.lock and cache are up to date + --verbose(-v) # Use verbose output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --help(-h) # Print help information +] where { + at-most-one [--verbose --quiet] + at-most-one [--release --profile] + at-most-one [--workspace --package] + at-most-one [--locked --frozen] + at-most-one [--lib --bins --all-targets] + at-most-one [--all-features --no-default-features] + terminal [--help] +} + +export complete [cargo package] [ + --list # List the files included in the package and exit + --no-verify # Do not verify the package by building it + --no-metadata # Ignore the existing lockfile and do not write one + --allow-dirty # Allow packaging a dirty working tree + --exclude: text # Exclude the given files from the package + --include: text # Include only the given files in the package + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Package only the specified package + --target: text # Package for the given architecture + --keep-vcs # Do not remove the VCS files from the package + --manifest-path: path # Path to the Cargo.toml file + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --frozen # Require Cargo.lock and cache are up to date + --verbose(-v) # Use verbose output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --help(-h) # Print help information +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + terminal [--help] +} + +export complete [cargo login] [ + token?: text # The API token to use + --registry: text # The registry to log in to + --help(-h) # Print help information +] where { + terminal [--help] +} + +export complete [cargo logout] [ + --registry: text # The registry to log out of + --help(-h) # Print help information +] where { + terminal [--help] +} + +export complete [cargo help] [ + subcommand: by "nu-complete cargo subcommands" + --color: words [auto always never] # Control when colored output is used + --config: text # Override a configuration value + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details +] where { + at-most-one [--locked --frozen] +} + +export complete [cargo clippy] [ + --no-deps # Run Clippy only on the given crate, without linting the dependencies + --fix # Automatically apply lint suggestions. This flag implies `--no-deps + --version(-V) # Prints version information + --help(-h) # Prints help information + --warn(-W): text # Set lint warnings + --allow(-A): text # Set lint allowed + --deny(-D): text # Set lint denied + --forbid(-F): text # Set lint forbidden + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Check only the specified packages + --workspace # Check all members in the workspace + --all # Alias for --workspace (deprecated) + --exclude: by "nu-complete cargo packages" [manifest: --manifest-path] # Exclude the specified packages + --lib # Check the package's library + --bin: by "nu-complete cargo bins" [package: --package] # Check the specified binary + --example: by "nu-complete cargo examples" [package: --package] # Check the specified example + --examples # Check all example targets + --test: by "nu-complete cargo tests" [package: --package] # Check the specified integration test + --tests # Check all targets in test mode that have the test = true manifest flag set + --bench: by "nu-complete cargo benches" [package: --package] # Check the specified benchmark + --benches # Check all targets in benchmark mode that have the bench = true manifest flag set + --all-targets # Check all targets + --features: cargo.features with { root.feature: by "nu-complete cargo features" } # Space or comma separated list of features to activate + --all-features # Activate all available features + --no-default-features # Do not activate the `default` feature + --target: text # Check for the given architecture + --release(-r) # Check optimized artifacts with the release profile + --profile: by "nu-complete cargo profiles" [manifest: --manifest-path] # Check with the given profile + --ignore-rust-version # Ignore `rust-version` specification in packages + --timings?: text # Output information how long each compilation takes + --target-dir: path # Directory for all generated artifacts and intermediate files + --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Control when colored output is used + --message-format: text # The output format for diagnostic messages + --manifest-path: path # Path to the Cargo.toml file + --frozen # Require Cargo.lock and cache are up to date + --locked # Require Cargo.lock is up to date + --offline # Run without accessing the network + -Z: text # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --jobs(-j): text # Number of parallel jobs to run + --keep-going # Build as many crates in the dependency graph as possible + --future-incompat-report # Displays a future-incompat report for any future-incompatible warnings +] where { + at-most-one [--verbose --quiet] + at-most-one [--release --profile] + at-most-one [--workspace --package] + at-most-one [--locked --frozen] + at-most-one [--lib --all-targets] + at-most-one [--all-features --no-default-features] + terminal [--help] +} + +export complete [cargo install-update] [ + --all(-a) # Update all packages + --allow-no-update(-i) # Allow for fresh-installing packages + --downdate(-d) # Downdate packages to match latest unyanked registry version + --force(-f) # Update all packages regardless if they need updating + --git(-g) # Also update git packages + --help(-h) # Prints help information + --list(-l) # Don't update packages, only list and check if they need an update (all packages by default) + --quiet(-q) # No output printed to stdout + --version(-V) # Prints version information + --cargo-dir(-c) # The cargo home directory. Default: $CARGO_HOME or $HOME/.cargo + --filter(-s) # Specify a filter a package must match to be considered + --install-cargo(-r) # Specify an alternative cargo to run for installations + --temp-dir(-t) # The temporary directory. Default: $TEMP/cargo-update +] where { + terminal [--help] +} + +export complete [cargo add] [ + ...dep: text # Reference to a package to add as a dependency (name[@version]) + --no-default-features # Disable the default features + --default-features # Re-enable the default features + --features(-F): text # Space or comma separated list of features to activate + --optional # Mark the dependency as optional + --no-optional # Mark the dependency as required + --public # Mark the dependency as public + --no-public # Mark the dependency as private + --rename: text # Rename the dependency + --dry-run(-n) # Don't actually write the manifest + --verbose(-v) # Use verbose output + --quiet(-q) # Do not print cargo log messages + --color: words [auto always never] # Coloring + --config: text # Override a configuration value + -Z: text # Unstable (nightly-only) flags + --manifest-path(-m): path # Path to Cargo.toml + --ignore-rust-version # Ignore `rust-version` specification in packages + --locked # Assert that `Cargo.lock` will remain unchanged + --offline # Run without accessing the network + --frozen # Equivalent to specifying both --locked and --offline + --lockfile-path: path # Path to Cargo.lock (unstable) + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Package to modify + --path: dir # Filesystem path to local crate to add + --base: text # The path base to use when adding a local crate + --git: text # Git repository location + --branch: text # Git branch to download the crate from + --tag: text # Git tag to download the crate from + --rev: text # Git reference to download the crate from + --registry: text # Package registry for this dependency + --dev # Add as development dependency + --build # Add as build dependency + --target: by "nu-complete cargo targets" # Add as dependency to the given target platform + --help(-h) # Print help +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + overrides [--default-features --no-default-features] + overrides [--optional --no-optional] + overrides [--public --no-public] + at-most-one [--dev --build] + at-most-one [--path --git --registry] + at-most-one [--branch --tag --rev] + requires --branch --git + requires --tag --git + requires --rev --git + terminal [--help] +} + +# cargo-nextest: a next-generation test runner for Rust (`cargo install cargo-nextest`). +export complete [cargo nextest] [ + --manifest-path: path # Path to Cargo.toml + --color: words [auto always never] # Produce color output + --verbose(-v) # Verbose output + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help --version] +} + +export complete [cargo nextest run] [ + ...filters: text # Test name filters + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Package to test + --workspace # Test all packages in the workspace + --exclude: by "nu-complete cargo packages" # Exclude packages from the test + --all # Alias for --workspace + --lib # Test only this package's library + --bin: by "nu-complete cargo bins" [package: --package] # Test only the specified binary + --bins # Test all binaries + --example: by "nu-complete cargo examples" [package: --package] # Test only the specified example + --examples # Test all examples + --test: by "nu-complete cargo tests" [package: --package] # Test only the specified test target + --tests # Test all test targets + --bench: by "nu-complete cargo benches" [package: --package] # Test only the specified bench target + --benches # Test all benches + --all-targets # Test all targets + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Features to activate + --all-features # Activate all available features + --no-default-features # Do not activate the `default` feature + --release(-r) # Build artifacts in release mode + --cargo-profile: by "nu-complete cargo profiles" [manifest: --manifest-path] # Build artifacts with the specified Cargo profile + --profile(-P): text # Nextest profile to use + --target: by "nu-complete cargo targets" # Build for the target triple + --target-dir: dir # Directory for all generated artifacts + --manifest-path: path # Path to Cargo.toml + --jobs(-j): text # Number of build jobs to run + --test-threads(-j): text # Number of tests to run simultaneously + --retries: text # Number of retries for failing tests + --fail-fast # Cancel test run on the first failure + --no-fail-fast # Run all tests regardless of failure + --no-capture # Run tests serially and do not capture output + --run-ignored: words [default only all] # Run ignored tests + --filterset(-E): text # Test filterset (see https://nexte.st/docs/filtersets) + --message-format: words [human json json-render-diagnostics] # Build message format + --no-tests: words [fail warn pass] # Behavior if there are no tests to run + --locked # Require Cargo.lock is up to date + --frozen # Require Cargo.lock and cache are up to date + --offline # Run without accessing the network + --verbose(-v) # Verbose output + --color: words [auto always never] # Produce color output + --help(-h) # Print help +] where { + at-most-one [--workspace --package] + at-most-one [--release --cargo-profile] + at-most-one [--locked --frozen] + overrides [--fail-fast --no-fail-fast] + excludes --all-features --no-default-features + terminal [--help] +} + +export complete [cargo nextest list] [ + ...filters: text # Test name filters + --package(-p): by "nu-complete cargo packages" [manifest: --manifest-path] # Package to list + --workspace # List tests of all packages in the workspace + --exclude: by "nu-complete cargo packages" # Exclude packages + --features(-F): cargo.features with { root.feature: by "nu-complete cargo features" } # Features to activate + --all-features # Activate all available features + --release(-r) # Build artifacts in release mode + --cargo-profile: by "nu-complete cargo profiles" [manifest: --manifest-path] # Cargo profile + --message-format: words [human json json-pretty oneline] # Output format + --list-type: words [full binaries-only] # Type of listing + --run-ignored: words [default only all] # Include ignored tests + --filterset(-E): text # Test filterset + --manifest-path: path # Path to Cargo.toml + --help(-h) # Print help +] where { + at-most-one [--workspace --package] + at-most-one [--release --cargo-profile] + terminal [--help] +} + +export complete [cargo nextest archive] [ + --archive-file: path # File to write the archive to + --archive-format: words [auto tar-zst] # Archive format + --package(-p): by "nu-complete cargo packages" # Package to archive + --workspace # Archive all workspace packages + --release(-r) # Build artifacts in release mode + --cargo-profile: by "nu-complete cargo profiles" # Cargo profile + --help(-h) # Print help +] where { + at-most-one [--workspace --package] + at-most-one [--release --cargo-profile] + terminal [--help] +} + +export complete [cargo nextest show-config] [ --help(-h) ] where { terminal [--help] } +export complete [cargo nextest self] [ --help(-h) ] where { terminal [--help] } +export complete [cargo nextest self update] [ --version: text --check --yes(-y) --force(-f) --help(-h) ] where { terminal [--help] } diff --git a/custom-completions/claude/claude-completions.nu b/custom-completions/claude/claude-completions.nu index a5cae743b..5ec8e5b32 100644 --- a/custom-completions/claude/claude-completions.nu +++ b/custom-completions/claude/claude-completions.nu @@ -1,329 +1,452 @@ -# Claude Code CLI completions for Nushell -# Translated from bash completion script - -def "nu-complete claude commands" [] { - [agents auth mcp plugin setup-token doctor update upgrade install] -} - -def "nu-complete claude output-format" [] { - [text json stream-json] -} - -def "nu-complete claude input-format" [] { - [text stream-json] -} - -def "nu-complete claude permission-mode" [] { - [acceptEdits auto bypassPermissions manual dontAsk plan] -} - -def "nu-complete claude models" [] { - [fable opus sonnet haiku claude-fable-5-1 claude-opus-5-5 claude-sonnet-5-5 claude-haiku-5-5] +# Declarative completions for Claude Code (`claude`), checked against `claude --help` 2.1.x. + +# MCP servers configured for the user and for the current project in ~/.claude.json. +@non-destructive +export def "nu-complete claude mcp-servers" [] { + try { + let cfg = open ~/.claude.json + let user = $cfg.mcpServers? | default {} | columns + let project = $cfg.projects? | default {} | get -o (pwd) | get -o mcpServers | default {} | columns + let local = if ('.mcp.json' | path exists) { open .mcp.json | get -o mcpServers | default {} | columns } else { [] } + $user | append $project | append $local | uniq + } catch { [] } } -def "nu-complete claude effort" [] { - [low medium high xhigh max] +# Installed plugins, as `name@marketplace`. +@non-destructive +export def "nu-complete claude plugins" [] { + try { open ~/.claude/plugins/installed_plugins.json | get plugins | columns } catch { [] } } -def "nu-complete claude scope" [] { - [local user project] +# Configured plugin marketplaces. +@non-destructive +export def "nu-complete claude marketplaces" [] { + try { open ~/.claude/plugins/known_marketplaces.json | columns } catch { [] } } -def "nu-complete claude scope-with-managed" [] { - [local user project managed] +# Agents defined in the user and project agent directories. +@non-destructive +export def "nu-complete claude agents" [] { + try { + [~/.claude/agents .claude/agents] + | each {|d| let d = ($d | path expand); if ($d | path exists) { glob $"($d)/*.md" } else { [] } } + | flatten + | each {|f| $f | path parse | get stem } + | uniq + } catch { [] } } -def "nu-complete claude transport" [] { - [stdio sse http] +# Claude Code - starts an interactive session by default, use -p/--print for non-interactive output +export complete [claude] [ + --add-dir: dir # Additional directories to allow tool access to + --agent: by "nu-complete claude agents" # Agent for the current session + --agents: text # JSON object defining custom agents (or a file with --print) + --allow-dangerously-skip-permissions # Make bypassing permission checks available without enabling it + --allowedTools: text # Tool names to allow (e.g. "Bash(git *) Edit") + --allowed-tools: text # Tool names to allow (e.g. "Bash(git *) Edit") + --append-system-prompt: text # Append a system prompt to the default system prompt + --autocompact: text # Auto-compact window size (auto, or 100k–1M tokens) + --ax-screen-reader # Render screen-reader friendly output + --background # Start the session in the background and return immediately + --bg # Alias of --background + --bare # Minimal mode: skip hooks, LSP, plugin sync, auto-memory and CLAUDE.md discovery + --betas: text # Beta headers to include in API requests + --brief # Enable the SendUserMessage tool + --chrome # Enable Claude in Chrome integration + --no-chrome # Disable Claude in Chrome integration + --cloud?: text # Create a cloud session, or attach to one by id or URL + --continue(-c) # Continue the most recent conversation in this directory + --dangerously-skip-permissions # Bypass all permission checks + --debug(-d)?: text # Enable debug mode with optional category filter (e.g. "api,hooks") + --debug-file: path # Write debug logs to this file + --desktop # Open in the Claude Desktop app instead of the terminal + --disable-slash-commands # Disable all skills + --disallowedTools: text # Tool names to deny + --disallowed-tools: text # Tool names to deny + --effort: words [low medium high xhigh max] # Effort level for the current session + --environment: text # Create a cloud session on this self-hosted environment (ccpool_...) + --exclude-dynamic-system-prompt-sections # Move per-machine sections into the first user message + --fallback-model: words [fable opus sonnet haiku claude-fable-5-1 claude-opus-5-5 claude-sonnet-5-5 claude-haiku-5-5] # Fallback model(s) when the default is overloaded + --file: text # File resources to download at startup (file_id:relative_path) + --fork-session # When resuming, create a new session id + --forward-subagent-text # Forward subagent text and thinking blocks (stream-json only) + --from-pr?: text # Resume a session linked to a PR number or URL + --help(-h) # Display help + --ide # Connect to the IDE on startup + --include-hook-events # Include hook lifecycle events in the output stream + --include-partial-messages # Include partial message chunks as they arrive + --input-format: words [text: "Plain text (default)" stream-json: "Realtime streaming input"] # Input format (with --print) + --json-schema: text # JSON Schema for structured output validation + --max-budget-usd: text # Maximum dollar amount to spend on API calls + --mcp-config: path # Load MCP servers from JSON files or strings + --mcp-debug # Enable MCP debug mode (deprecated, use --debug) + --model: words [fable: "Latest Fable" opus: "Latest Opus" sonnet: "Latest Sonnet" haiku: "Latest Haiku" default: "Account default" claude-fable-5-1: "Claude Fable 5.1" claude-opus-5-5: "Claude Opus 5.5" claude-sonnet-5-5: "Claude Sonnet 5.5" claude-haiku-5-5: "Claude Haiku 5.5"] # Model for the current session + --name(-n): text # Display name for this session + --no-session-persistence # Do not save sessions to disk + --output-format: words [text: "Plain text (default)" json: "Single JSON result" stream-json: "Realtime streaming JSON"] # Output format (with --print) + --permission-mode: words [acceptEdits auto bypassPermissions manual dontAsk plan] # Permission mode for the session + --permission-prompt-tool: text # MCP tool that answers permission prompts + --permission-prompts: words [host: "The SDK host or --permission-prompt-tool" none: "Deny anything that would prompt"] # Who answers permission prompts with --print + --plugin-dir: path # Load a plugin from a directory or .zip + --plugin-url: text # Fetch a plugin .zip from a URL for this session + --print(-p) # Print the response and exit + --prompt-suggestions?: text # Enable prompt suggestions + --remote-control?: text # Start an interactive session with Remote Control + --remote-control-session-name-prefix: text # Prefix for Remote Control session names + --replay-user-messages # Re-emit user messages from stdin on stdout + --restricted # Restricted mode: remove the built-in capabilities + --resume(-r)?: text # Resume a conversation by session id, or open the picker + --safe-mode # Start with all customizations disabled + --session-id: text # Use this session id (a UUID) + --setting-sources: words [user project local] # Comma-separated setting sources to load + --settings: path # Settings JSON file or JSON string + --strict-mcp-config # Only use MCP servers from --mcp-config + --system-prompt: text # System prompt for the session + --system-prompt-snapshot: words [on off] # Record the system prompt once per conversation + --teleport?: text # Resume a teleport session + --tmux # Create a tmux session for the worktree + --tools: text # The list of available built-in tools + --verbose # Override the verbose mode setting + --version(-v) # Print the version + --worktree(-w)?: text # Create a new git worktree for this session + prompt?: text # Your prompt +] where { + at-most-one [--continue --resume --from-pr --teleport --cloud] + at-most-one [--background --bg --print] + excludes --chrome --no-chrome + excludes --dangerously-skip-permissions --permission-mode + excludes --system-prompt --append-system-prompt + requires --output-format --print + requires --input-format --print + requires --json-schema --print + requires --max-budget-usd --print + requires --include-partial-messages --print + requires --replay-user-messages --print + requires --permission-prompts --print + requires --forward-subagent-text --print + requires --tmux --worktree + terminal [--help --version] } -def "nu-complete claude install-channel" [] { - [stable latest] +# Manage background agents +export complete [claude agents] [ + --add-dir: dir # Additional directory for dispatched sessions + --agent: by "nu-complete claude agents" # Default agent for dispatched sessions + --all # With --json: include completed background sessions + --allow-dangerously-skip-permissions # Make bypass-permissions mode available + --cwd: dir # Only show sessions started under this path + --dangerously-skip-permissions # Alias for --permission-mode bypassPermissions + --effort: words [low medium high xhigh max] # Default effort level + --json # Print active sessions as JSON and exit + --mcp-config: path # MCP server configuration for dispatched sessions + --model: words [fable opus sonnet haiku default claude-fable-5-1 claude-opus-5-5 claude-sonnet-5-5 claude-haiku-5-5] # Default model for dispatched sessions + --permission-mode: words [acceptEdits auto bypassPermissions manual dontAsk plan] # Default permission mode + --setting-sources: words [user project local] # Setting sources to load + --help(-h) # Display help +] where { + requires --all --json + excludes --dangerously-skip-permissions --permission-mode + terminal [--help] } -# --resume, --from-pr, --worktree and --remote-control take an optional value, -# which a Nushell flag cannot express, so they are declared as switches. A value -# typed after one is passed to claude in place, as a positional: -# `claude --resume` opens the session picker and `claude --resume ` resumes. -# The `--flag=value` spelling is not available for these flags. - -# Claude Code - starts an interactive session by default, use -p/--print for non-interactive output -export extern claude [ - --debug(-d) # Enable debug mode - --debug-file: path # Debug output file - --verbose # Verbose output - --print(-p) # Print mode - --output-format: string@"nu-complete claude output-format" # Output format - --json-schema: string # JSON schema - --include-partial-messages # Include partial messages - --input-format: string@"nu-complete claude input-format" # Input format - --mcp-debug # MCP debug mode - --dangerously-skip-permissions # Skip permissions (dangerous) - --allow-dangerously-skip-permissions # Allow skip permissions - --max-budget-usd: number # Max budget in USD - --replay-user-messages # Replay user messages - --allowedTools: string # Allowed tools (deprecated) - --allowed-tools: string # Allowed tools - --tools: string # Tools - --disallowedTools: string # Disallowed tools (deprecated) - --disallowed-tools: string # Disallowed tools - --mcp-config: path # MCP config file - --system-prompt: string # System prompt - --append-system-prompt: string # Append system prompt - --permission-mode: string@"nu-complete claude permission-mode" # Permission mode - --continue(-c) # Continue last session - --resume(-r) # Resume a session (optional ID or search term) - --fork-session # Fork session - --no-session-persistence # Disable session persistence - --model: string@"nu-complete claude models" # Model to use - --agent: string # Agent name - --betas: string # Beta features - --fallback-model: string@"nu-complete claude models" # Fallback model - --settings: path # Settings file - --add-dir: path # Additional directory - --ide: string # IDE integration - --strict-mcp-config # Strict MCP config - --session-id: string # Session ID - --agents: string # Agents config - --setting-sources: string@"nu-complete claude scope" # Setting sources - --plugin-dir: path # Plugin directory - --disable-slash-commands # Disable slash commands - --chrome # Enable Chrome - --no-chrome # Disable Chrome - --from-pr # Resume a session linked to a PR (optional number or URL) - --file: path # Input file - --worktree(-w) # Create a git worktree (optional name) - --remote-control # Start with Remote Control enabled (optional name) - --tmux # Tmux mode - --effort: string@"nu-complete claude effort" # Effort level - --version(-v) # Show version - --help(-h) # Show help - ...args: string # Command or prompt -] - -# --- auth --- +# Open a background session in this terminal +export complete [claude attach] [ + --help(-h) # Display help + session: text # The short id `claude --bg` prints, or part of its name +] where { terminal [--help] } + +# Print a background session's recent output +export complete [claude logs] [ + --help(-h) # Display help + session: text # The short id or part of the name of the session +] where { terminal [--help] } + +# Restart a background session, or all of them +export complete [claude respawn] [ + --all # Restart every background session + --help(-h) # Display help + session?: text # The session to restart +] where { terminal [--help] } + +# Delete a background session +export complete [claude rm] [ + --help(-h) # Display help + session: text # The session to delete +] where { terminal [--help] } + +# Stop a background session, keeping its conversation +export complete [claude stop] [ + --help(-h) # Display help + session: text # The session to stop +] where { terminal [--help] } + +# Alias of `claude stop` +export complete [claude kill] [ + --help(-h) # Display help + session: text # The session to stop +] where { terminal [--help] } # Manage authentication -export extern "claude auth" [ - --help(-h) - ...args: string -] +export complete [claude auth] [ + --help(-h) # Display help + command?: words [login logout status help] # Auth subcommand +] where { terminal [--help] } # Sign in to your Anthropic account -export extern "claude auth login" [ - --email: string # Login email - --sso # Use SSO login - --help(-h) -] +export complete [claude auth login] [ + --claudeai # Use a Claude subscription (default) + --console # Use Anthropic Console (API usage billing) + --email: text # Pre-populate the email address on the login page + --sso # Force the SSO login flow + --help(-h) # Display help +] where { + excludes --claudeai --console + terminal [--help] +} # Log out from your Anthropic account -export extern "claude auth logout" [ - --help(-h) -] - -def "nu-complete claude auth-status-format" [] { - [json text] -} +export complete [claude auth logout] [ + --help(-h) # Display help +] where { terminal [--help] } # Show authentication status -export extern "claude auth status" [ - --json # Output as JSON - --text # Output as text - --help(-h) -] +export complete [claude auth status] [ + --json # Output as JSON (default) + --text # Output as human-readable text + --help(-h) # Display help +] where { + excludes --json --text + terminal [--help] +} -# --- mcp --- +# Inspect or reset the auto mode classifier configuration +export complete [claude auto-mode] [ + --help(-h) # Display help + command?: words [config critique defaults reset help] # Auto mode subcommand +] where { terminal [--help] } + +# Check the health of your Claude Code installation +export complete [claude doctor] [ + --help(-h) # Display help +] where { terminal [--help] } + +# Run the enterprise auth and telemetry gateway +export complete [claude gateway] [ + --config: path # Path to the gateway YAML configuration + --help(-h) # Display help +] where { terminal [--help] } + +# Import configuration from another AI coding agent +export complete [claude import] [ + --dry-run # Show what would be imported, writing nothing + --yes # Skip the interactive picker + --help(-h) # Display help + source?: words [codex gemini cursor] # The agent to import from +] where { terminal [--help] } + +# Install the Claude Code native build +export complete [claude install] [ + --force # Force installation even if already installed + --help(-h) # Display help + target?: words [stable latest] # Release channel or a specific version +] where { terminal [--help] } # Configure and manage MCP servers -export extern "claude mcp" [ - --help(-h) - ...args: string -] - -# Add an MCP server to Claude Code -export extern "claude mcp add" [ - --scope(-s): string@"nu-complete claude scope" # Scope - --transport(-t): string@"nu-complete claude transport" # Transport type - --env(-e): string # Environment variable - --header(-H): string # Header - --callback-port: int # Callback port - --client-id: string # Client ID - --client-secret # Client secret (interactive prompt) - --help(-h) - ...args: string -] - -# Import MCP servers from Claude Desktop (Mac and WSL only) -export extern "claude mcp add-from-claude-desktop" [ - --scope(-s): string@"nu-complete claude scope" - --help(-h) - ...args: string -] - -# Add an MCP server (stdio or SSE) with a JSON string -export extern "claude mcp add-json" [ - --scope(-s): string@"nu-complete claude scope" - --client-secret # Client secret (interactive prompt) - --help(-h) - ...args: string -] +export complete [claude mcp] [ + --help(-h) # Display help + command?: words [add add-from-claude-desktop add-json get list remove reset-project-choices serve help] # MCP subcommand +] where { terminal [--help] } + +# Add an MCP server +export complete [claude mcp add] [ + --callback-port: text # Fixed port for the OAuth callback + --client-id: text # OAuth client id for HTTP/SSE servers + --client-secret # Prompt for the OAuth client secret + --env(-e): env-assign # Set environment variables (KEY=value) + --header(-H): text # Set headers for HTTP/SSE servers + --scope(-s): words [local user project] # Configuration scope + --transport(-t): words [stdio sse http] # Transport type (default stdio) + --help(-h) # Display help + name: text # Server name + ...command: command # Command (stdio) or URL (sse/http) and its arguments +] where { terminal [--help] } + +# Import MCP servers from Claude Desktop +export complete [claude mcp add-from-claude-desktop] [ + --scope(-s): words [local user project] # Configuration scope + --help(-h) # Display help +] where { terminal [--help] } + +# Add an MCP server with a JSON string +export complete [claude mcp add-json] [ + --client-secret # Prompt for the OAuth client secret + --scope(-s): words [local user project] # Configuration scope + --help(-h) # Display help + name: text # Server name + json: text # Server configuration as JSON +] where { terminal [--help] } # Get details about an MCP server -export extern "claude mcp get" [ - --help(-h) - ...args: string -] +export complete [claude mcp get] [ + --help(-h) # Display help + name: by "nu-complete claude mcp-servers" # Server name +] where { terminal [--help] } # List configured MCP servers -export extern "claude mcp list" [ - --help(-h) -] +export complete [claude mcp list] [ + --help(-h) # Display help +] where { terminal [--help] } # Remove an MCP server -export extern "claude mcp remove" [ - --scope(-s): string@"nu-complete claude scope" - --help(-h) - ...args: string -] +export complete [claude mcp remove] [ + --scope(-s): words [local user project] # Configuration scope + --help(-h) # Display help + name: by "nu-complete claude mcp-servers" # Server name +] where { terminal [--help] } -# Reset all approved and rejected project-scoped (.mcp.json) servers -export extern "claude mcp reset-project-choices" [ - --help(-h) -] +# Reset approved and rejected project-scoped (.mcp.json) servers +export complete [claude mcp reset-project-choices] [ + --help(-h) # Display help +] where { terminal [--help] } # Start the Claude Code MCP server -export extern "claude mcp serve" [ - --debug(-d) - --verbose - --help(-h) -] - -# --- plugin --- +export complete [claude mcp serve] [ + --debug(-d) # Enable debug mode + --verbose # Override the verbose mode setting + --help(-h) # Display help +] where { terminal [--help] } # Manage Claude Code plugins -export extern "claude plugin" [ - --help(-h) - ...args: string -] +export complete [claude plugin] [ + --help(-h) # Display help + command?: words [disable enable install list marketplace uninstall update validate help] # Plugin subcommand +] where { terminal [--help] } # Disable an enabled plugin -export extern "claude plugin disable" [ - --all(-a) # Disable all - --scope(-s): string@"nu-complete claude scope" - --help(-h) - ...args: string -] +export complete [claude plugin disable] [ + --all(-a) # Disable every plugin + --scope(-s): words [user project local] # Installation scope + --help(-h) # Display help + plugin?: by "nu-complete claude plugins" # Plugin to disable +] where { terminal [--help] } # Enable a disabled plugin -export extern "claude plugin enable" [ - --scope(-s): string@"nu-complete claude scope" - --help(-h) - ...args: string -] - -# Install a plugin from available marketplaces -export extern "claude plugin install" [ - --scope(-s): string@"nu-complete claude scope" - --help(-h) - ...args: string -] +export complete [claude plugin enable] [ + --scope(-s): words [user project local] # Installation scope + --help(-h) # Display help + plugin: by "nu-complete claude plugins" # Plugin to enable +] where { terminal [--help] } + +# Install a plugin from the available marketplaces +export complete [claude plugin install] [ + --accept-command: text # Accept the marketplace-declared command (sha256) + --config: text # Set a userConfig option (key=value) + --json # Print one machine-readable result line + --marketplace: by "nu-complete claude marketplaces" # Marketplace to install from + --registry: text # Registry URL for a @npm install + --scope(-s): words [user project local] # Installation scope + --yes(-y) # Accept the displayed marketplace-declared command + --help(-h) # Display help + plugin: text # plugin, plugin@marketplace or package@npm +] where { + excludes --accept-command --yes + terminal [--help] +} # List installed plugins -export extern "claude plugin list" [ - --available - --json - --help(-h) -] - -# Manage Claude Code marketplaces -export extern "claude plugin marketplace" [ - --help(-h) - ...args: string -] - -# Add a marketplace -export extern "claude plugin marketplace add" [ - --help(-h) - ...args: string -] - -# List configured marketplaces -export extern "claude plugin marketplace list" [ - --json - --help(-h) -] - -# Remove a marketplace -export extern "claude plugin marketplace remove" [ - --help(-h) - ...args: string -] - -# Update a marketplace -export extern "claude plugin marketplace update" [ - --help(-h) - ...args: string -] +export complete [claude plugin list] [ + --available # Include plugins available from marketplaces + --json # Output as JSON + --help(-h) # Display help +] where { terminal [--help] } # Uninstall an installed plugin -export extern "claude plugin uninstall" [ - --scope(-s): string@"nu-complete claude scope" - --help(-h) - ...args: string -] +export complete [claude plugin uninstall] [ + --scope(-s): words [user project local] # Installation scope + --help(-h) # Display help + plugin: by "nu-complete claude plugins" # Plugin to uninstall +] where { terminal [--help] } # Update a plugin to the latest version -export extern "claude plugin update" [ - --scope(-s): string@"nu-complete claude scope-with-managed" - --help(-h) - ...args: string -] +export complete [claude plugin update] [ + --scope(-s): words [user project local managed] # Installation scope + --help(-h) # Display help + plugin: by "nu-complete claude plugins" # Plugin to update +] where { terminal [--help] } # Validate a plugin or marketplace manifest -export extern "claude plugin validate" [ - --help(-h) - ...args: string -] - -# --- agents --- +export complete [claude plugin validate] [ + --help(-h) # Display help + path: path # Plugin or marketplace directory +] where { terminal [--help] } -# List configured agents -export extern "claude agents" [ - --setting-sources: string@"nu-complete claude scope" - --help(-h) -] - -# --- setup-token --- - -# Set up a long-lived authentication token (requires Claude subscription) -export extern "claude setup-token" [ - --help(-h) -] - -# --- doctor --- +# Manage Claude Code marketplaces +export complete [claude plugin marketplace] [ + --help(-h) # Display help + command?: words [add list remove update help] # Marketplace subcommand +] where { terminal [--help] } -# Check the health of your Claude Code auto-updater -export extern "claude doctor" [ - --help(-h) -] +# Add a marketplace from a URL, path or GitHub repo +export complete [claude plugin marketplace add] [ + --help(-h) # Display help + source: text # URL, local path or owner/repo +] where { terminal [--help] } -# --- update / upgrade --- +# List configured marketplaces +export complete [claude plugin marketplace list] [ + --json # Output as JSON + --help(-h) # Display help +] where { terminal [--help] } -# Check for updates and install if available -export extern "claude update" [ - --help(-h) -] +# Remove a marketplace +export complete [claude plugin marketplace remove] [ + --help(-h) # Display help + name: by "nu-complete claude marketplaces" # Marketplace to remove +] where { terminal [--help] } + +# Update one marketplace, or all of them +export complete [claude plugin marketplace update] [ + --help(-h) # Display help + name?: by "nu-complete claude marketplaces" # Marketplace to update +] where { terminal [--help] } + +# Delete all Claude Code state for a project +export complete [claude purge] [ + --all # Purge the state of every project + --dry-run # List what would be deleted + --interactive(-i) # Ask before deleting each item + --yes(-y) # Do not ask for confirmation + --help(-h) # Display help + path?: dir # The project to purge (this directory by default) +] where { + excludes --interactive --yes + terminal [--help] +} -# Check for updates and install if available -export extern "claude upgrade" [ - --help(-h) -] +# Set up a long-lived authentication token +export complete [claude setup-token] [ + --help(-h) # Display help +] where { terminal [--help] } + +# Run a cloud-hosted multi-agent code review +export complete [claude ultrareview] [ + --json # Print the raw findings + --post # Post the findings to the PR + --no-post # Do not post the findings (default) + --timeout: text # Minutes to wait for the review + --help(-h) # Display help + target?: text # A PR number or a base branch +] where { + excludes --post --no-post + terminal [--help] +} -# --- install --- +# Check for updates and install them +export complete [claude update] [ + --help(-h) # Display help +] where { terminal [--help] } -# Install Claude Code native build -export extern "claude install" [ - --force - --help(-h) - channel?: string@"nu-complete claude install-channel" # Install channel -] +# Alias of `claude update` +export complete [claude upgrade] [ + --help(-h) # Display help +] where { terminal [--help] } diff --git a/custom-completions/codex/codex-completions.nu b/custom-completions/codex/codex-completions.nu index 8b071394d..f4df4831f 100644 --- a/custom-completions/codex/codex-completions.nu +++ b/custom-completions/codex/codex-completions.nu @@ -1,1712 +1,1237 @@ module completions { - def "nu-complete codex sandbox_mode" [] { - [ "read-only" "workspace-write" "danger-full-access" ] + # Models from the CLI's own cache of the model catalogue. + @non-destructive + export def "nu-complete codex models" [] { + try { + let home = $env.CODEX_HOME? | default ("~/.codex" | path expand) + open ($home | path join models_cache.json) | get models | each {|m| {value: $m.slug, description: ($m.description? | default "")} } + } catch { [] } } - def "nu-complete codex approval_policy" [] { - [ "untrusted" "on-request" "never" ] + # Profiles: `[profiles.]` tables in config.toml and `.config.toml` layers. + @non-destructive + export def "nu-complete codex profiles" [] { + try { + let home = $env.CODEX_HOME? | default ("~/.codex" | path expand) + let tables = try { open ($home | path join config.toml) | get -o profiles | default {} | columns } catch { [] } + let layers = glob ($home | path join "*.config.toml") | each {|f| $f | path basename | str replace '.config.toml' '' } + $tables | append $layers | uniq + } catch { [] } } - # Codex CLI - export extern codex [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --remote: string # Connect the TUI to a remote app server endpoint - --remote-auth-token-env: string # Name of the environment variable containing the bearer token to send to a remote app server websocket - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --image(-i): path # Optional image(s) to attach to the initial prompt - --model(-m): string # Model the agent should use - --oss # Use open-source provider - --local-provider: string # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection - --profile(-p): string # Layer $CODEX_HOME/.config.toml on top of the base user config - --sandbox(-s): string@"nu-complete codex sandbox_mode" # Select the sandbox policy to use when executing model-generated shell commands - --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources - --cd(-C): path # Tell the agent to use the specified directory as its working root - --add-dir: path # Additional directories that should be writable alongside the primary workspace - --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed - --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox - --ask-for-approval(-a): string@"nu-complete codex approval_policy" # Configure when the model requires human approval before executing a command - --search # Enable live web search. When enabled, the native Responses `web_search` tool is available to the model (no per‑call approval) - --no-alt-screen # Disable alternate screen mode - --help(-h) # Print help (see more with '--help') - --version(-V) # Print version - prompt?: string # Optional user prompt to start the session - ] - - # Browse all agent sessions on the shared local app-server daemon - export extern "codex agents" [ - --remote: string # Connect the TUI to a remote app server endpoint - --remote-auth-token-env: string # Name of the environment variable containing the bearer token to send to a remote app server websocket - --cd(-C): path # Use this directory for new tasks on a remote server - --no-alt-screen # Disable alternate screen mode - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - def "nu-complete codex exec sandbox_mode" [] { - [ "read-only" "workspace-write" "danger-full-access" ] - } - - def "nu-complete codex exec color" [] { - [ "always" "never" "auto" ] - } - - # Run Codex non-interactively - export extern "codex exec" [ - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --image(-i): path # Optional image(s) to attach to the initial prompt - --oss # Use open-source provider - --local-provider: string # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection - --profile(-p): string # Layer $CODEX_HOME/.config.toml on top of the base user config - --sandbox(-s): string@"nu-complete codex exec sandbox_mode" # Select the sandbox policy to use when executing model-generated shell commands - --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox - --cd(-C): path # Tell the agent to use the specified directory as its working root - --add-dir: path # Additional directories that should be writable alongside the primary workspace - --model(-m): string # Model the agent should use - --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed - --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources - --skip-git-repo-check # Allow running Codex outside a Git repository - --ephemeral # Run without persisting session files to disk - --ignore-user-config # Do not load `$CODEX_HOME/config.toml`; auth still uses `CODEX_HOME` - --ignore-rules # Do not load user or project execpolicy `.rules` files - --output-schema: path # Path to a JSON Schema file describing the model's final response shape - --color: string@"nu-complete codex exec color" # Specifies color settings for use in the output - --json # Print events to stdout as JSONL - --output-last-message(-o): path # Specifies file where the last message from the agent should be written - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - --version(-V) # Print version - prompt?: string # Initial instructions for the agent. If not provided as an argument (or if `-` is used), instructions are read from stdin. If stdin is piped and a prompt is also provided, stdin is appended as a `` block - ] - - # Resume a previous session by id or pick the most recent with --last - export extern "codex exec resume" [ - --last # Resume the most recent recorded session (newest) without specifying an id - --all # Show all sessions (disables cwd filtering) - --image(-i): path # Optional image(s) to attach to the prompt sent after resuming - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --model(-m): string # Model the agent should use - --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed - --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources - --skip-git-repo-check # Allow running Codex outside a Git repository - --ephemeral # Run without persisting session files to disk - --ignore-user-config # Do not load `$CODEX_HOME/config.toml`; auth still uses `CODEX_HOME` - --ignore-rules # Do not load user or project execpolicy `.rules` files - --output-schema: path # Path to a JSON Schema file describing the model's final response shape - --json # Print events to stdout as JSONL - --output-last-message(-o): path # Specifies file where the last message from the agent should be written - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - session_id?: string # Conversation/session id (UUID) or thread name. UUIDs take precedence if it parses. If omitted, use --last to pick the most recent recorded session - prompt?: string # Prompt to send after resuming the session. If `-` is used, read from stdin - ] - - # Fork a previous session by id into a new session - export extern "codex exec fork" [ - --image(-i): path # Optional image(s) to attach to the prompt sent after forking - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --model(-m): string # Model the agent should use - --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed - --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources - --skip-git-repo-check # Allow running Codex outside a Git repository - --ephemeral # Run without persisting session files to disk - --ignore-user-config # Do not load `$CODEX_HOME/config.toml`; auth still uses `CODEX_HOME` - --ignore-rules # Do not load user or project execpolicy `.rules` files - --output-schema: path # Path to a JSON Schema file describing the model's final response shape - --json # Print events to stdout as JSONL - --output-last-message(-o): path # Specifies file where the last message from the agent should be written - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - session_id: string # Conversation/session id (UUID) or thread name to fork - prompt?: string # Optional prompt to send after forking. If `-` is used, read from stdin - ] - - # Run a code review against the current repository - export extern "codex exec review" [ - --uncommitted # Review staged, unstaged, and untracked changes - --base: string # Review changes against the given base branch - --commit: string # Review the changes introduced by a commit - --title: string # Optional commit title to display in the review summary - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --model(-m): string # Model the agent should use - --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed - --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources - --skip-git-repo-check # Allow running Codex outside a Git repository - --ephemeral # Run without persisting session files to disk - --ignore-user-config # Do not load `$CODEX_HOME/config.toml`; auth still uses `CODEX_HOME` - --ignore-rules # Do not load user or project execpolicy `.rules` files - --output-schema: path # Path to a JSON Schema file describing the model's final response shape - --json # Print events to stdout as JSONL - --output-last-message(-o): path # Specifies file where the last message from the agent should be written - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - prompt?: string # Custom review instructions. If `-` is used, read from stdin - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex exec help" [ - ] - - # Resume a previous session by id or pick the most recent with --last - export extern "codex exec help resume" [ - ] - - # Fork a previous session by id into a new session - export extern "codex exec help fork" [ - ] - - # Run a code review against the current repository - export extern "codex exec help review" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex exec help help" [ - ] - - # Run a code review non-interactively - export extern "codex review" [ - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --uncommitted # Review staged, unstaged, and untracked changes - --base: string # Review changes against the given base branch - --commit: string # Review the changes introduced by a commit - --title: string # Optional commit title to display in the review summary - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - prompt?: string # Custom review instructions. If `-` is used, read from stdin - ] - - # Manage login - export extern "codex login" [ - --with-api-key # Read the API key from stdin (e.g. `printenv OPENAI_API_KEY | codex login --with-api-key`) - --with-access-token # Read the access token from stdin (e.g. `printenv CODEX_ACCESS_TOKEN | codex login --with-access-token`) - --api-key: string # (deprecated) Previously accepted the API key directly; now exits with guidance to use --with-api-key - --device-auth - --experimental_issuer: string # EXPERIMENTAL: Use custom OAuth issuer base URL (advanced) Override the OAuth issuer base URL (advanced) - --experimental_client-id: string # EXPERIMENTAL: Use custom OAuth client ID (advanced) - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Show login status - export extern "codex login status" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex login help" [ - ] - - # Show login status - export extern "codex login help status" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex login help help" [ - ] - - # Remove stored authentication credentials - export extern "codex logout" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Manage external MCP servers for Codex - export extern "codex mcp" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - export extern "codex mcp list" [ - --json # Output the configured servers as JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - export extern "codex mcp get" [ - --json # Output the server configuration as JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - name: string # Name of the MCP server to display - ] - - def "nu-complete codex mcp add oauth_client_registration" [] { - [ "auto" "cimd" "dcr" ] - } - - export extern "codex mcp add" [ - --env: string # Environment variables to set when launching the server. Only valid with stdio servers - --url: string # URL for a streamable HTTP MCP server - --bearer-token-env-var: string # Optional environment variable to read for a bearer token. Only valid with streamable HTTP servers - --oauth-client-id: string # Optional OAuth client identifier to use for this MCP server - --oauth-client-registration: string@"nu-complete codex mcp add oauth_client_registration" # OAuth client-registration strategy for the immediate login only - --oauth-resource: string # Optional OAuth resource parameter to include during MCP login - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - name: string # Name for the MCP server configuration - ...command: string # Command to launch the MCP server. Use --url for a streamable HTTP server - ] - - export extern "codex mcp remove" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - name: string # Name of the MCP server configuration to remove - ] - - def "nu-complete codex mcp login oauth_client_registration" [] { - [ "auto" "cimd" "dcr" ] - } - - export extern "codex mcp login" [ - --scopes: string # Comma-separated list of OAuth scopes to request - --oauth-client-registration: string@"nu-complete codex mcp login oauth_client_registration" # OAuth client-registration strategy for this login only - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - name: string # Name of the MCP server to authenticate with oauth - ] - - export extern "codex mcp logout" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - name: string # Name of the MCP server to deauthenticate - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex mcp help" [ - ] - - export extern "codex mcp help list" [ - ] - - export extern "codex mcp help get" [ - ] - - export extern "codex mcp help add" [ - ] - - export extern "codex mcp help remove" [ - ] - - export extern "codex mcp help login" [ - ] - - export extern "codex mcp help logout" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex mcp help help" [ - ] - - # Manage Codex plugins - export extern "codex plugin" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Install a plugin from a configured marketplace snapshot - export extern "codex plugin add" [ - --marketplace(-m): string # Configured marketplace name to use when PLUGIN does not include @MARKETPLACE - --json # Output install result as JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - plugin: string # Plugin selector to install: either PLUGIN@MARKETPLACE or PLUGIN with --marketplace - ] - - # List plugins available from configured marketplace snapshots - export extern "codex plugin list" [ - --marketplace(-m): string # Only list plugins from this configured marketplace name - --json # Output plugin list as JSON - --available # Include uninstalled marketplace plugins in the JSON output - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Add, list, upgrade, or remove configured plugin marketplaces - export extern "codex plugin marketplace" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Add a local or Git marketplace to the configured marketplace sources - export extern "codex plugin marketplace add" [ - --ref: string # Git ref to fetch for Git marketplace sources - --sparse: string # Sparse checkout path for Git marketplace sources. Can be repeated - --json # Output add result as JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - source: string # Marketplace source: a local path, owner/repo[@ref], HTTPS Git URL, or SSH Git URL - ] - - # List plugin marketplaces Codex is currently considering and their roots - export extern "codex plugin marketplace list" [ - --json # Output marketplace list as JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Refresh configured Git marketplace snapshots - export extern "codex plugin marketplace upgrade" [ - --json # Output upgrade result as JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - marketplace_name?: string # Optional configured marketplace name to upgrade. Omit to upgrade all Git marketplaces - ] - - # Remove a configured marketplace source by name - export extern "codex plugin marketplace remove" [ - --json # Output remove result as JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - marketplace_name: string # Configured marketplace name to remove - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex plugin marketplace help" [ - ] - - # Add a local or Git marketplace to the configured marketplace sources - export extern "codex plugin marketplace help add" [ - ] - - # List plugin marketplaces Codex is currently considering and their roots - export extern "codex plugin marketplace help list" [ - ] - - # Refresh configured Git marketplace snapshots - export extern "codex plugin marketplace help upgrade" [ - ] - - # Remove a configured marketplace source by name - export extern "codex plugin marketplace help remove" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex plugin marketplace help help" [ - ] - - # Remove an installed plugin from local config and cache - export extern "codex plugin remove" [ - --marketplace(-m): string # Marketplace name to use when PLUGIN does not include @MARKETPLACE - --json # Output remove result as JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - plugin: string # Plugin selector to remove: either PLUGIN@MARKETPLACE or PLUGIN with --marketplace - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex plugin help" [ - ] - - # Install a plugin from a configured marketplace snapshot - export extern "codex plugin help add" [ - ] - - # List plugins available from configured marketplace snapshots - export extern "codex plugin help list" [ - ] - - # Add, list, upgrade, or remove configured plugin marketplaces - export extern "codex plugin help marketplace" [ - ] - - # Add a local or Git marketplace to the configured marketplace sources - export extern "codex plugin help marketplace add" [ - ] - - # List plugin marketplaces Codex is currently considering and their roots - export extern "codex plugin help marketplace list" [ - ] - - # Refresh configured Git marketplace snapshots - export extern "codex plugin help marketplace upgrade" [ - ] - - # Remove a configured marketplace source by name - export extern "codex plugin help marketplace remove" [ - ] - - # Remove an installed plugin from local config and cache - export extern "codex plugin help remove" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex plugin help help" [ - ] - - # Start Codex as an MCP server (stdio) - export extern "codex mcp-server" [ - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - def "nu-complete codex app-server ws_auth" [] { - [ "capability-token" "signed-bearer-token" ] - } - - # [experimental] Run the app server or related tooling - export extern "codex app-server" [ - --code-mode-host: string # Connect to a remote code-mode host instead of starting a local host - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --listen: string # Transport endpoint URL. Supported values: `stdio://` (default), `unix://`, `unix://PATH`, `ws://IP:PORT`, `off` - --stdio # Use stdio as the transport (equivalent to `--listen stdio://`) - --remote-control # Enable remote control for this app-server process without changing persistence - --analytics-default-enabled # Controls whether analytics are enabled by default - --ws-auth: string@"nu-complete codex app-server ws_auth" # Websocket auth mode for non-loopback listeners - --ws-token-file: path # Absolute path to the capability-token file - --ws-token-sha256: string # Hex-encoded SHA-256 digest of the capability token - --ws-shared-secret-file: path # Absolute path to the shared secret file for signed JWT bearer tokens - --ws-issuer: string # Expected issuer for signed JWT bearer tokens - --ws-audience: string # Expected audience for signed JWT bearer tokens - --ws-max-clock-skew-seconds: string # Maximum clock skew when validating signed JWT bearer tokens - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Manage the local app-server daemon - export extern "codex app-server daemon" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Install durable local app-server management for SSH-driven use - export extern "codex app-server daemon bootstrap" [ - --remote-control # Launch the managed app-server with remote control enabled - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Start the local app server daemon if it is not already running - export extern "codex app-server daemon start" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Restart the local app server daemon - export extern "codex app-server daemon restart" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Enable remote control for future starts and a currently running managed daemon - export extern "codex app-server daemon enable-remote-control" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Disable remote control for future starts and a currently running managed daemon - export extern "codex app-server daemon disable-remote-control" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Stop the local app server daemon - export extern "codex app-server daemon stop" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Print local CLI and running app-server versions as JSON - export extern "codex app-server daemon version" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # [internal] Run the detached pid-backed standalone updater loop - export extern "codex app-server daemon pid-update-loop" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex app-server daemon help" [ - ] - - # Install durable local app-server management for SSH-driven use - export extern "codex app-server daemon help bootstrap" [ - ] - - # Start the local app server daemon if it is not already running - export extern "codex app-server daemon help start" [ - ] - - # Restart the local app server daemon - export extern "codex app-server daemon help restart" [ - ] - - # Enable remote control for future starts and a currently running managed daemon - export extern "codex app-server daemon help enable-remote-control" [ - ] - - # Disable remote control for future starts and a currently running managed daemon - export extern "codex app-server daemon help disable-remote-control" [ - ] - - # Stop the local app server daemon - export extern "codex app-server daemon help stop" [ - ] - - # Print local CLI and running app-server versions as JSON - export extern "codex app-server daemon help version" [ - ] - - # [internal] Run the detached pid-backed standalone updater loop - export extern "codex app-server daemon help pid-update-loop" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex app-server daemon help help" [ - ] - - # Proxy stdio bytes to the running app-server control socket - export extern "codex app-server proxy" [ - --sock: string # Path to the app-server Unix domain socket to connect to - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # [experimental] Generate TypeScript bindings for the app server protocol - export extern "codex app-server generate-ts" [ - --out(-o): path # Output directory where .ts files will be written - --prettier(-p): path # Optional path to the Prettier executable to format generated files - --experimental # Include experimental methods and fields in the generated output - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # [experimental] Generate JSON Schema for the app server protocol - export extern "codex app-server generate-json-schema" [ - --out(-o): path # Output directory where the schema bundle will be written - --experimental # Include experimental methods and fields in the generated output - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # [internal] Generate internal JSON Schema artifacts for Codex tooling - export extern "codex app-server generate-internal-json-schema" [ - --out(-o): path # Output directory where internal JSON Schema artifacts will be written - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex app-server help" [ - ] - - # Manage the local app-server daemon - export extern "codex app-server help daemon" [ - ] - - # Install durable local app-server management for SSH-driven use - export extern "codex app-server help daemon bootstrap" [ - ] - - # Start the local app server daemon if it is not already running - export extern "codex app-server help daemon start" [ - ] - - # Restart the local app server daemon - export extern "codex app-server help daemon restart" [ - ] - - # Enable remote control for future starts and a currently running managed daemon - export extern "codex app-server help daemon enable-remote-control" [ - ] - - # Disable remote control for future starts and a currently running managed daemon - export extern "codex app-server help daemon disable-remote-control" [ - ] - - # Stop the local app server daemon - export extern "codex app-server help daemon stop" [ - ] - - # Print local CLI and running app-server versions as JSON - export extern "codex app-server help daemon version" [ - ] - - # [internal] Run the detached pid-backed standalone updater loop - export extern "codex app-server help daemon pid-update-loop" [ - ] - - # Proxy stdio bytes to the running app-server control socket - export extern "codex app-server help proxy" [ - ] - - # [experimental] Generate TypeScript bindings for the app server protocol - export extern "codex app-server help generate-ts" [ - ] - - # [experimental] Generate JSON Schema for the app server protocol - export extern "codex app-server help generate-json-schema" [ - ] - - # [internal] Generate internal JSON Schema artifacts for Codex tooling - export extern "codex app-server help generate-internal-json-schema" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex app-server help help" [ - ] - - # [experimental] Manage the app-server daemon with remote control enabled - export extern "codex remote-control" [ - --json # Emit machine-readable JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Start the app-server daemon with remote control enabled - export extern "codex remote-control start" [ - --json # Emit machine-readable JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Stop the app-server daemon - export extern "codex remote-control stop" [ - --json # Emit machine-readable JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Create and print a short-lived manual pairing code - export extern "codex remote-control pair" [ - --json # Emit machine-readable JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex remote-control help" [ - ] - - # Start the app-server daemon with remote control enabled - export extern "codex remote-control help start" [ - ] - - # Stop the app-server daemon - export extern "codex remote-control help stop" [ - ] - - # Create and print a short-lived manual pairing code - export extern "codex remote-control help pair" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex remote-control help help" [ - ] - - def "nu-complete codex completion shell" [] { - [ "bash" "elvish" "fish" "powershell" "zsh" "nushell" ] - } - - # Generate shell completion scripts - export extern "codex completion" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - shell?: string@"nu-complete codex completion shell" # Shell to generate completions for - ] - - # Update Codex to the latest version - export extern "codex update" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Diagnose local Codex installation, config, auth, and runtime health - export extern "codex doctor" [ - --json # Emit a redacted machine-readable report - --summary # Only show grouped check rows and the final count summary - --all # Expand long lists in detailed human output - --no-color # Disable ANSI color in human output - --ascii # Use ASCII status labels and separators in human output - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Run commands within a Codex-provided sandbox - export extern "codex sandbox" [ - --sandbox-state-json: string # JSON value from `codex/sandbox-state-meta` to apply directly - --sandbox-state-readable-root: string # Add a readable root to the supplied sandbox state. Repeat for multiple roots - --sandbox-state-disable-network # Disable direct network access in the supplied sandbox state - --permission-profile(-P): string # Named permissions profile to apply from the active configuration stack - --profile(-p): string # Layer $CODEX_HOME/.config.toml on top of the base user config - --cd(-C): path # Working directory used for profile resolution and command execution - --include-managed-config # Include managed requirements while resolving an explicit permissions profile - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ...command: string # Full command args to run under the Linux sandbox - ] - - # Debugging tools - export extern "codex debug" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Render the raw model catalog as JSON - export extern "codex debug models" [ - --bundled # Skip refresh and dump only the bundled catalog shipped with this binary - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Tooling: helps debug the app server - export extern "codex debug app-server" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - export extern "codex debug app-server send-message-v2" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - user_message: string - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex debug app-server help" [ - ] - - export extern "codex debug app-server help send-message-v2" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex debug app-server help help" [ - ] - - # Render the model-visible prompt input list as JSON - export extern "codex debug prompt-input" [ - --image(-i): path # Optional image(s) to attach to the user prompt - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - prompt?: string # Optional user prompt to append after session context - ] - - # Replay a rollout trace bundle and write reduced state JSON - export extern "codex debug trace-reduce" [ - --output(-o): path # Output path for reduced RolloutTrace JSON. Defaults to TRACE_BUNDLE/state.json - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - trace_bundle: path # Trace bundle directory containing manifest.json and trace.jsonl - ] - - # Internal: reset local memory state for a fresh start - export extern "codex debug clear-memories" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex debug help" [ - ] - - # Render the raw model catalog as JSON - export extern "codex debug help models" [ - ] - - # Tooling: helps debug the app server - export extern "codex debug help app-server" [ - ] - - export extern "codex debug help app-server send-message-v2" [ - ] - - # Render the model-visible prompt input list as JSON - export extern "codex debug help prompt-input" [ - ] - - # Replay a rollout trace bundle and write reduced state JSON - export extern "codex debug help trace-reduce" [ - ] - - # Internal: reset local memory state for a fresh start - export extern "codex debug help clear-memories" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex debug help help" [ - ] - - # Execpolicy tooling - export extern "codex execpolicy" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Check execpolicy files against a command - export extern "codex execpolicy check" [ - --rules(-r): path # Paths to execpolicy rule files to evaluate (repeatable) - --pretty # Pretty-print the JSON output - --resolve-host-executables # Resolve absolute program paths against basename rules, gated by any `host_executable()` definitions in the loaded policy files - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ...command: string # Command tokens to check against the policy - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex execpolicy help" [ - ] - - # Check execpolicy files against a command - export extern "codex execpolicy help check" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex execpolicy help help" [ - ] - - # Apply the latest diff produced by Codex agent as a `git apply` to your local working tree - export extern "codex apply" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - task_id: string - ] - - def "nu-complete codex resume sandbox_mode" [] { - [ "read-only" "workspace-write" "danger-full-access" ] - } - - def "nu-complete codex resume approval_policy" [] { - [ "untrusted" "on-request" "never" ] - } - - # Resume a previous interactive session (picker by default; use --last to continue the most recent) - export extern "codex resume" [ - --last # Continue the most recent session without showing the picker - --all # Show all sessions (disables cwd filtering and shows CWD column) - --include-non-interactive # Include non-interactive sessions in the resume picker and --last selection - --remote: string # Connect the TUI to a remote app server endpoint - --remote-auth-token-env: string # Name of the environment variable containing the bearer token to send to a remote app server websocket - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --image(-i): path # Optional image(s) to attach to the initial prompt - --model(-m): string # Model the agent should use - --oss # Use open-source provider - --local-provider: string # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection - --profile(-p): string # Layer $CODEX_HOME/.config.toml on top of the base user config - --sandbox(-s): string@"nu-complete codex resume sandbox_mode" # Select the sandbox policy to use when executing model-generated shell commands - --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources - --cd(-C): path # Tell the agent to use the specified directory as its working root - --add-dir: path # Additional directories that should be writable alongside the primary workspace - --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed - --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox - --ask-for-approval(-a): string@"nu-complete codex resume approval_policy" # Configure when the model requires human approval before executing a command - --search # Enable live web search. When enabled, the native Responses `web_search` tool is available to the model (no per‑call approval) - --no-alt-screen # Disable alternate screen mode - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - --version(-V) # Print version - session_id?: string # Session id (UUID) or session name. UUIDs take precedence if it parses. If omitted, use --last to pick the most recent recorded session - prompt?: string # Optional user prompt to start the session - ] - - def "nu-complete codex queue sandbox_mode" [] { - [ "read-only" "workspace-write" "danger-full-access" ] - } - - # Queue a message for an existing session - export extern "codex queue" [ - --thread: string # Session UUID or exact session name - --message: string # Message text to queue - --remote: string # Connect the TUI to a remote app server endpoint - --remote-auth-token-env: string # Name of the environment variable containing the bearer token to send to a remote app server websocket - --image(-i): path # Optional image(s) to attach to the initial prompt - --model(-m): string # Model the agent should use - --oss # Use open-source provider - --local-provider: string # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection - --profile(-p): string # Layer $CODEX_HOME/.config.toml on top of the base user config - --sandbox(-s): string@"nu-complete codex queue sandbox_mode" # Select the sandbox policy to use when executing model-generated shell commands - --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox - --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed - --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources - --cd(-C): path # Tell the agent to use the specified directory as its working root - --add-dir: path # Additional directories that should be writable alongside the primary workspace - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - def "nu-complete codex archive sandbox_mode" [] { - [ "read-only" "workspace-write" "danger-full-access" ] - } - - # Archive a saved session by id or session name - export extern "codex archive" [ - --remote: string # Connect the TUI to a remote app server endpoint - --remote-auth-token-env: string # Name of the environment variable containing the bearer token to send to a remote app server websocket - --image(-i): path # Optional image(s) to attach to the initial prompt - --model(-m): string # Model the agent should use - --oss # Use open-source provider - --local-provider: string # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection - --profile(-p): string # Layer $CODEX_HOME/.config.toml on top of the base user config - --sandbox(-s): string@"nu-complete codex archive sandbox_mode" # Select the sandbox policy to use when executing model-generated shell commands - --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox - --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed - --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources - --cd(-C): path # Tell the agent to use the specified directory as its working root - --add-dir: path # Additional directories that should be writable alongside the primary workspace - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - target: string # Session id (UUID) or session name. UUIDs take precedence if it parses - ] - - def "nu-complete codex delete sandbox_mode" [] { - [ "read-only" "workspace-write" "danger-full-access" ] - } - - # Permanently delete a saved session by id or session name - export extern "codex delete" [ - --remote: string # Connect the TUI to a remote app server endpoint - --remote-auth-token-env: string # Name of the environment variable containing the bearer token to send to a remote app server websocket - --image(-i): path # Optional image(s) to attach to the initial prompt - --model(-m): string # Model the agent should use - --oss # Use open-source provider - --local-provider: string # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection - --profile(-p): string # Layer $CODEX_HOME/.config.toml on top of the base user config - --sandbox(-s): string@"nu-complete codex delete sandbox_mode" # Select the sandbox policy to use when executing model-generated shell commands - --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox - --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed - --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources - --cd(-C): path # Tell the agent to use the specified directory as its working root - --add-dir: path # Additional directories that should be writable alongside the primary workspace - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --force # Delete without prompting. SESSION must be a UUID - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - target: string # Session id (UUID) or session name. UUIDs take precedence if it parses - ] - - # Inspect or migrate legacy local sessions to paginated thread history - export extern "codex migrate-rollouts" [ - --apply # Publish the migration. Without this flag the command only reports eligible sessions - --thread: string # Restrict inspection or migration to one or more thread IDs - --max-mib-per-second: string # Limit aggregate rollout read and write throughput, in MiB per second - --json # Emit the complete per-thread report as JSON - --verbose # Print one line for every inspected rollout - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - def "nu-complete codex unarchive sandbox_mode" [] { - [ "read-only" "workspace-write" "danger-full-access" ] - } - - # Unarchive a saved session by id or session name - export extern "codex unarchive" [ - --remote: string # Connect the TUI to a remote app server endpoint - --remote-auth-token-env: string # Name of the environment variable containing the bearer token to send to a remote app server websocket - --image(-i): path # Optional image(s) to attach to the initial prompt - --model(-m): string # Model the agent should use - --oss # Use open-source provider - --local-provider: string # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection - --profile(-p): string # Layer $CODEX_HOME/.config.toml on top of the base user config - --sandbox(-s): string@"nu-complete codex unarchive sandbox_mode" # Select the sandbox policy to use when executing model-generated shell commands - --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox - --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed - --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources - --cd(-C): path # Tell the agent to use the specified directory as its working root - --add-dir: path # Additional directories that should be writable alongside the primary workspace - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - target: string # Session id (UUID) or session name. UUIDs take precedence if it parses - ] - - def "nu-complete codex fork sandbox_mode" [] { - [ "read-only" "workspace-write" "danger-full-access" ] + # Feature flags, with their stage and whether they are on. + @non-destructive + export def "nu-complete codex features" [] { + try { + ^codex features list | lines | parse --regex '^(?\S+)\s+(?.+?)\s{2,}(?true|false)$' + | each {|f| {value: $f.value, description: $"($f.stage) \(($f.on)\)"} } + } catch { [] } } - def "nu-complete codex fork approval_policy" [] { - [ "untrusted" "on-request" "never" ] + # Recent sessions, newest first, from the rollout files under $CODEX_HOME/sessions. + @non-destructive + export def "nu-complete codex sessions" [] { + try { + let home = $env.CODEX_HOME? | default ("~/.codex" | path expand) + glob ($home | path join sessions "*" "*" "*" "rollout-*.jsonl") + | each {|f| $f | path basename | parse --regex '^rollout-(?\d{4}-\d\d-\d\dT\d\d-\d\d-\d\d)-(?.+)\.jsonl$' } + | flatten + | sort-by when --reverse + | first 50 + | each {|s| {value: $s.id, description: $s.when} } + } catch { [] } } - # Fork a previous interactive session (picker by default; use --last to fork the most recent) - export extern "codex fork" [ - --last # Fork the most recent session without showing the picker - --all # Show all sessions (disables cwd filtering and shows CWD column) - --remote: string # Connect the TUI to a remote app server endpoint - --remote-auth-token-env: string # Name of the environment variable containing the bearer token to send to a remote app server websocket - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --image(-i): path # Optional image(s) to attach to the initial prompt - --model(-m): string # Model the agent should use - --oss # Use open-source provider - --local-provider: string # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection - --profile(-p): string # Layer $CODEX_HOME/.config.toml on top of the base user config - --sandbox(-s): string@"nu-complete codex fork sandbox_mode" # Select the sandbox policy to use when executing model-generated shell commands - --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources - --cd(-C): path # Tell the agent to use the specified directory as its working root - --add-dir: path # Additional directories that should be writable alongside the primary workspace - --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed - --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox - --ask-for-approval(-a): string@"nu-complete codex fork approval_policy" # Configure when the model requires human approval before executing a command - --search # Enable live web search. When enabled, the native Responses `web_search` tool is available to the model (no per‑call approval) - --no-alt-screen # Disable alternate screen mode - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - --version(-V) # Print version - session_id?: string # Conversation/session id (UUID). When provided, forks this session. If omitted, use --last to pick the most recent recorded session - prompt?: string # Optional user prompt to start the session - ] - - # [EXPERIMENTAL] Browse tasks from Codex Cloud and apply changes locally - export extern "codex cloud" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - --version(-V) # Print version - ] - - # Submit a new Codex Cloud task without launching the TUI - export extern "codex cloud exec" [ - --env: string # Target environment identifier (see `codex cloud` to browse) - --attempts: string # Number of assistant attempts (best-of-N) - --branch: string # Git branch to run in Codex Cloud (defaults to current branch) - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - query?: string # Task prompt to run in Codex Cloud - ] - - # Show the status of a Codex Cloud task - export extern "codex cloud status" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - task_id: string # Codex Cloud task identifier to inspect - ] - - # List Codex Cloud tasks - export extern "codex cloud list" [ - --env: string # Filter tasks by environment identifier - --limit: string # Maximum number of tasks to return (1-20) - --cursor: string # Pagination cursor returned by a previous call - --json # Emit JSON instead of plain text - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Apply the diff for a Codex Cloud task locally - export extern "codex cloud apply" [ - --attempt: string # Attempt number to apply (1-based) - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - task_id: string # Codex Cloud task identifier to apply - ] - - # Show the unified diff for a Codex Cloud task - export extern "codex cloud diff" [ - --attempt: string # Attempt number to display (1-based) - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - task_id: string # Codex Cloud task identifier to display - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex cloud help" [ - ] - - # Submit a new Codex Cloud task without launching the TUI - export extern "codex cloud help exec" [ - ] - - # Show the status of a Codex Cloud task - export extern "codex cloud help status" [ - ] - - # List Codex Cloud tasks - export extern "codex cloud help list" [ - ] - - # Apply the diff for a Codex Cloud task locally - export extern "codex cloud help apply" [ - ] - - # Show the unified diff for a Codex Cloud task - export extern "codex cloud help diff" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex cloud help help" [ - ] - - # Internal: run the responses API proxy - export extern "codex responses-api-proxy" [ - --port: string # Port to listen on. If not set, an ephemeral port is used - --server-info: path # Path to a JSON file to write startup info (single line). Includes {"port": } - --http-shutdown # Enable HTTP shutdown endpoint at GET /shutdown - --upstream-url: string # Absolute URL the proxy should forward requests to (defaults to OpenAI) - --dump-dir: path # Directory where request/response dumps should be written as JSON - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Internal: relay stdio to a Unix domain socket - export extern "codex stdio-to-uds" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - socket_path: string # Path to the Unix domain socket to connect to - ] - - # [EXPERIMENTAL] Run the standalone exec-server service - export extern "codex exec-server" [ - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --concurrent-requests: string # Maximum number of requests to process concurrently on each connection - --listen: string # Transport endpoint URL. Supported values: `ws://IP:PORT` (default), `stdio`, `stdio://` - --remote: string # Register this exec-server as a remote environment using the given base URL - --environment-id: string # Environment id to attach to when registering remotely - --name: string # Human-readable environment name - --use-agent-identity-auth # Use Agent Identity auth from CODEX_ACCESS_TOKEN for remote registration - --exit-on-stdin-close # Exit when the parent-owned standard-input pipe closes - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Register an existing WebSocket exec-server as a remote environment - export extern "codex exec-server forward" [ - --connect: string # Destination exec-server WebSocket URL - --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex - --remote: string # Register this exec-server as a remote environment using the given base URL - --environment-id: string # Environment id to attach to when registering remotely - --name: string # Human-readable environment name - --use-agent-identity-auth # Use Agent Identity auth from CODEX_ACCESS_TOKEN for remote registration - --exit-on-stdin-close # Exit when the parent-owned standard-input pipe closes - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex exec-server help" [ - ] - - # Register an existing WebSocket exec-server as a remote environment - export extern "codex exec-server help forward" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex exec-server help help" [ - ] - - # Inspect feature flags - export extern "codex features" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # List known features with their stage and effective state - export extern "codex features list" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - ] - - # Enable a feature in config.toml - export extern "codex features enable" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - feature: string # Feature key to update (for example: unified_exec) - ] - - # Disable a feature in config.toml - export extern "codex features disable" [ - --config(-c): string # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal - --enable: string # Enable a feature (repeatable). Equivalent to `-c features.=true` - --disable: string # Disable a feature (repeatable). Equivalent to `-c features.=false` - --help(-h) # Print help (see more with '--help') - feature: string # Feature key to update (for example: unified_exec) - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex features help" [ - ] - - # List known features with their stage and effective state - export extern "codex features help list" [ - ] - - # Enable a feature in config.toml - export extern "codex features help enable" [ - ] - - # Disable a feature in config.toml - export extern "codex features help disable" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex features help help" [ - ] - - # Print this message or the help of the given subcommand(s) - export extern "codex help" [ - ] + # Codex CLI + export complete [codex] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --remote: text # Connect the TUI to a remote app server endpoint + --remote-auth-token-env: env # Name of the environment variable containing the bearer token to send to a remote app server websocket + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --image(-i): path # Optional image(s) to attach to the initial prompt + --model(-m): by "nu-complete codex models" # Model the agent should use + --oss # Use open-source provider + --local-provider: words [lmstudio ollama] # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection + --profile(-p): by "nu-complete codex profiles" # Layer $CODEX_HOME/.config.toml on top of the base user config + --sandbox(-s): words [read-only: "Read files only" workspace-write: "Write inside the workspace" danger-full-access: "No sandbox"] # Select the sandbox policy to use when executing model-generated shell commands + --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources + --cd(-C): dir cwd # Tell the agent to use the specified directory as its working root + --add-dir: dir # Additional directories that should be writable alongside the primary workspace + --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed + --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox + --ask-for-approval(-a): words [untrusted: "Ask for anything not trusted" on-request: "The model decides when to ask" never: "Never ask; failures return to the model"] # Configure when the model requires human approval before executing a command + --search # Enable live web search. When enabled, the native Responses `web_search` tool is available to the model (no per‑call approval) + --no-alt-screen # Disable alternate screen mode + --worktree # Run the session in a new managed Git worktree + --no-daemon # Run without the shared background server + --help(-h) # Print help (see more with '--help') + --version(-V) # Print version + prompt?: text # Optional user prompt to start the session + ] where { + excludes --dangerously-bypass-approvals-and-sandbox --sandbox + excludes --dangerously-bypass-approvals-and-sandbox --ask-for-approval + excludes --dangerously-bypass-approvals-and-sandbox --approve-for-me + excludes --approve-for-me --ask-for-approval + requires --local-provider --oss + terminal [--help --version] + } # Browse all agent sessions on the shared local app-server daemon - export extern "codex help agents" [ - ] + export complete [codex agents] [ + --remote: text # Connect the TUI to a remote app server endpoint + --remote-auth-token-env: env # Name of the environment variable containing the bearer token to send to a remote app server websocket + --cd(-C): dir cwd # Use this directory for new tasks on a remote server + --no-alt-screen # Disable alternate screen mode + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Run Codex non-interactively - export extern "codex help exec" [ - ] + export complete [codex exec] [ + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --image(-i): path # Optional image(s) to attach to the initial prompt + --oss # Use open-source provider + --local-provider: words [lmstudio ollama] # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection + --profile(-p): by "nu-complete codex profiles" # Layer $CODEX_HOME/.config.toml on top of the base user config + --sandbox(-s): words [read-only: "Read files only" workspace-write: "Write inside the workspace" danger-full-access: "No sandbox"] # Select the sandbox policy to use when executing model-generated shell commands + --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox + --cd(-C): dir cwd # Tell the agent to use the specified directory as its working root + --add-dir: dir # Additional directories that should be writable alongside the primary workspace + --model(-m): by "nu-complete codex models" # Model the agent should use + --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed + --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources + --skip-git-repo-check # Allow running Codex outside a Git repository + --ephemeral # Run without persisting session files to disk + --ignore-user-config # Do not load `$CODEX_HOME/config.toml`; auth still uses `CODEX_HOME` + --ignore-rules # Do not load user or project execpolicy `.rules` files + --output-schema: path # Path to a JSON Schema file describing the model's final response shape + --color: words [always never auto] # Specifies color settings for use in the output + --json # Print events to stdout as JSONL + --output-last-message(-o): path # Specifies file where the last message from the agent should be written + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + --version(-V) # Print version + prompt?: text # Initial instructions for the agent. If not provided as an argument (or if `-` is used), instructions are read from stdin. If stdin is piped and a prompt is also provided, stdin is appended as a `` block + ] where { + excludes --dangerously-bypass-approvals-and-sandbox --sandbox + excludes --dangerously-bypass-approvals-and-sandbox --approve-for-me + requires --local-provider --oss + excludes --json --color + terminal [--help --version] + } # Resume a previous session by id or pick the most recent with --last - export extern "codex help exec resume" [ - ] + export complete [codex exec resume] [ + --last # Resume the most recent recorded session (newest) without specifying an id + --all # Show all sessions (disables cwd filtering) + --image(-i): path # Optional image(s) to attach to the prompt sent after resuming + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --model(-m): by "nu-complete codex models" # Model the agent should use + --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed + --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources + --skip-git-repo-check # Allow running Codex outside a Git repository + --ephemeral # Run without persisting session files to disk + --ignore-user-config # Do not load `$CODEX_HOME/config.toml`; auth still uses `CODEX_HOME` + --ignore-rules # Do not load user or project execpolicy `.rules` files + --output-schema: path # Path to a JSON Schema file describing the model's final response shape + --json # Print events to stdout as JSONL + --output-last-message(-o): path # Specifies file where the last message from the agent should be written + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + session_id?: by "nu-complete codex sessions" # Conversation/session id (UUID) or thread name. UUIDs take precedence if it parses. If omitted, use --last to pick the most recent recorded session + prompt?: text # Prompt to send after resuming the session. If `-` is used, read from stdin + ] where { + excludes --last --all + terminal [--help] + } # Fork a previous session by id into a new session - export extern "codex help exec fork" [ - ] + export complete [codex exec fork] [ + --image(-i): path # Optional image(s) to attach to the prompt sent after forking + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --model(-m): by "nu-complete codex models" # Model the agent should use + --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed + --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources + --skip-git-repo-check # Allow running Codex outside a Git repository + --ephemeral # Run without persisting session files to disk + --ignore-user-config # Do not load `$CODEX_HOME/config.toml`; auth still uses `CODEX_HOME` + --ignore-rules # Do not load user or project execpolicy `.rules` files + --output-schema: path # Path to a JSON Schema file describing the model's final response shape + --json # Print events to stdout as JSONL + --output-last-message(-o): path # Specifies file where the last message from the agent should be written + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + session_id: by "nu-complete codex sessions" # Conversation/session id (UUID) or thread name to fork + prompt?: text # Optional prompt to send after forking. If `-` is used, read from stdin + ] where { + terminal [--help] + } # Run a code review against the current repository - export extern "codex help exec review" [ - ] + export complete [codex exec review] [ + --uncommitted # Review staged, unstaged, and untracked changes + --base: text # Review changes against the given base branch + --commit: text # Review the changes introduced by a commit + --title: text # Optional commit title to display in the review summary + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --model(-m): by "nu-complete codex models" # Model the agent should use + --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed + --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources + --skip-git-repo-check # Allow running Codex outside a Git repository + --ephemeral # Run without persisting session files to disk + --ignore-user-config # Do not load `$CODEX_HOME/config.toml`; auth still uses `CODEX_HOME` + --ignore-rules # Do not load user or project execpolicy `.rules` files + --output-schema: path # Path to a JSON Schema file describing the model's final response shape + --json # Print events to stdout as JSONL + --output-last-message(-o): path # Specifies file where the last message from the agent should be written + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + prompt?: text # Custom review instructions. If `-` is used, read from stdin + ] where { + terminal [--help] + } # Run a code review non-interactively - export extern "codex help review" [ - ] + export complete [codex review] [ + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --uncommitted # Review staged, unstaged, and untracked changes + --base: text # Review changes against the given base branch + --commit: text # Review the changes introduced by a commit + --title: text # Optional commit title to display in the review summary + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + prompt?: text # Custom review instructions. If `-` is used, read from stdin + ] where { + terminal [--help] + } # Manage login - export extern "codex help login" [ - ] + export complete [codex login] [ + --with-api-key # Read the API key from stdin (e.g. `printenv OPENAI_API_KEY | codex login --with-api-key`) + --with-access-token # Read the access token from stdin (e.g. `printenv CODEX_ACCESS_TOKEN | codex login --with-access-token`) + --api-key: text # (deprecated) Previously accepted the API key directly; now exits with guidance to use --with-api-key + --device-auth + --experimental_issuer: text # EXPERIMENTAL: Use custom OAuth issuer base URL (advanced) Override the OAuth issuer base URL (advanced) + --experimental_client-id: text # EXPERIMENTAL: Use custom OAuth client ID (advanced) + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Show login status - export extern "codex help login status" [ - ] + export complete [codex login status] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Remove stored authentication credentials - export extern "codex help logout" [ - ] + export complete [codex logout] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Manage external MCP servers for Codex - export extern "codex help mcp" [ - ] + export complete [codex mcp] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } - export extern "codex help mcp list" [ - ] + export complete [codex mcp list] [ + --json # Output the configured servers as JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } - export extern "codex help mcp get" [ - ] + export complete [codex mcp get] [ + --json # Output the server configuration as JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + name: text # Name of the MCP server to display + ] where { + terminal [--help] + } - export extern "codex help mcp add" [ - ] + export complete [codex mcp add] [ + --env: text # Environment variables to set when launching the server. Only valid with stdio servers + --url: text # URL for a streamable HTTP MCP server + --bearer-token-env-var: text # Optional environment variable to read for a bearer token. Only valid with streamable HTTP servers + --oauth-client-id: text # Optional OAuth client identifier to use for this MCP server + --oauth-client-registration: words [auto cimd dcr] # OAuth client-registration strategy for the immediate login only + --oauth-resource: text # Optional OAuth resource parameter to include during MCP login + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + name: text # Name for the MCP server configuration + ...command: text # Command to launch the MCP server. Use --url for a streamable HTTP server + ] where { + terminal [--help] + } - export extern "codex help mcp remove" [ - ] + export complete [codex mcp remove] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + name: text # Name of the MCP server configuration to remove + ] where { + terminal [--help] + } - export extern "codex help mcp login" [ - ] + export complete [codex mcp login] [ + --scopes: text # Comma-separated list of OAuth scopes to request + --oauth-client-registration: words [auto cimd dcr] # OAuth client-registration strategy for this login only + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + name: text # Name of the MCP server to authenticate with oauth + ] where { + terminal [--help] + } - export extern "codex help mcp logout" [ - ] + export complete [codex mcp logout] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + name: text # Name of the MCP server to deauthenticate + ] where { + terminal [--help] + } # Manage Codex plugins - export extern "codex help plugin" [ - ] + export complete [codex plugin] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Install a plugin from a configured marketplace snapshot - export extern "codex help plugin add" [ - ] + export complete [codex plugin add] [ + --marketplace(-m): text # Configured marketplace name to use when PLUGIN does not include @MARKETPLACE + --json # Output install result as JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + plugin: text # Plugin selector to install: either PLUGIN@MARKETPLACE or PLUGIN with --marketplace + ] where { + terminal [--help] + } # List plugins available from configured marketplace snapshots - export extern "codex help plugin list" [ - ] + export complete [codex plugin list] [ + --marketplace(-m): text # Only list plugins from this configured marketplace name + --json # Output plugin list as JSON + --available # Include uninstalled marketplace plugins in the JSON output + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Add, list, upgrade, or remove configured plugin marketplaces - export extern "codex help plugin marketplace" [ - ] + export complete [codex plugin marketplace] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Add a local or Git marketplace to the configured marketplace sources - export extern "codex help plugin marketplace add" [ - ] + export complete [codex plugin marketplace add] [ + --ref: text # Git ref to fetch for Git marketplace sources + --sparse: text # Sparse checkout path for Git marketplace sources. Can be repeated + --json # Output add result as JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + source: text # Marketplace source: a local path, owner/repo[@ref], HTTPS Git URL, or SSH Git URL + ] where { + terminal [--help] + } # List plugin marketplaces Codex is currently considering and their roots - export extern "codex help plugin marketplace list" [ - ] + export complete [codex plugin marketplace list] [ + --json # Output marketplace list as JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Refresh configured Git marketplace snapshots - export extern "codex help plugin marketplace upgrade" [ - ] + export complete [codex plugin marketplace upgrade] [ + --json # Output upgrade result as JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + marketplace_name?: text # Optional configured marketplace name to upgrade. Omit to upgrade all Git marketplaces + ] where { + terminal [--help] + } # Remove a configured marketplace source by name - export extern "codex help plugin marketplace remove" [ - ] + export complete [codex plugin marketplace remove] [ + --json # Output remove result as JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + marketplace_name: text # Configured marketplace name to remove + ] where { + terminal [--help] + } # Remove an installed plugin from local config and cache - export extern "codex help plugin remove" [ - ] + export complete [codex plugin remove] [ + --marketplace(-m): text # Marketplace name to use when PLUGIN does not include @MARKETPLACE + --json # Output remove result as JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + plugin: text # Plugin selector to remove: either PLUGIN@MARKETPLACE or PLUGIN with --marketplace + ] where { + terminal [--help] + } # Start Codex as an MCP server (stdio) - export extern "codex help mcp-server" [ - ] + export complete [codex mcp-server] [ + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # [experimental] Run the app server or related tooling - export extern "codex help app-server" [ - ] + export complete [codex app-server] [ + --code-mode-host: text # Connect to a remote code-mode host instead of starting a local host + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --listen: text # Transport endpoint URL. Supported values: `stdio://` (default), `unix://`, `unix://PATH`, `ws://IP:PORT`, `off` + --stdio # Use stdio as the transport (equivalent to `--listen stdio://`) + --remote-control # Enable remote control for this app-server process without changing persistence + --analytics-default-enabled # Controls whether analytics are enabled by default + --ws-auth: words [capability-token signed-bearer-token] # Websocket auth mode for non-loopback listeners + --ws-token-file: path # Absolute path to the capability-token file + --ws-token-sha256: text # Hex-encoded SHA-256 digest of the capability token + --ws-shared-secret-file: path # Absolute path to the shared secret file for signed JWT bearer tokens + --ws-issuer: text # Expected issuer for signed JWT bearer tokens + --ws-audience: text # Expected audience for signed JWT bearer tokens + --ws-max-clock-skew-seconds: text # Maximum clock skew when validating signed JWT bearer tokens + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Manage the local app-server daemon - export extern "codex help app-server daemon" [ - ] + export complete [codex app-server daemon] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Install durable local app-server management for SSH-driven use - export extern "codex help app-server daemon bootstrap" [ - ] + export complete [codex app-server daemon bootstrap] [ + --remote-control # Launch the managed app-server with remote control enabled + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Start the local app server daemon if it is not already running - export extern "codex help app-server daemon start" [ - ] + export complete [codex app-server daemon start] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Restart the local app server daemon - export extern "codex help app-server daemon restart" [ - ] + export complete [codex app-server daemon restart] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Enable remote control for future starts and a currently running managed daemon - export extern "codex help app-server daemon enable-remote-control" [ - ] + export complete [codex app-server daemon enable-remote-control] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Disable remote control for future starts and a currently running managed daemon - export extern "codex help app-server daemon disable-remote-control" [ - ] + export complete [codex app-server daemon disable-remote-control] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Stop the local app server daemon - export extern "codex help app-server daemon stop" [ - ] + export complete [codex app-server daemon stop] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Print local CLI and running app-server versions as JSON - export extern "codex help app-server daemon version" [ - ] + export complete [codex app-server daemon version] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # [internal] Run the detached pid-backed standalone updater loop - export extern "codex help app-server daemon pid-update-loop" [ - ] + export complete [codex app-server daemon pid-update-loop] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Proxy stdio bytes to the running app-server control socket - export extern "codex help app-server proxy" [ - ] + export complete [codex app-server proxy] [ + --sock: text # Path to the app-server Unix domain socket to connect to + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # [experimental] Generate TypeScript bindings for the app server protocol - export extern "codex help app-server generate-ts" [ - ] + export complete [codex app-server generate-ts] [ + --out(-o): path # Output directory where .ts files will be written + --prettier(-p): path # Optional path to the Prettier executable to format generated files + --experimental # Include experimental methods and fields in the generated output + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # [experimental] Generate JSON Schema for the app server protocol - export extern "codex help app-server generate-json-schema" [ - ] + export complete [codex app-server generate-json-schema] [ + --out(-o): path # Output directory where the schema bundle will be written + --experimental # Include experimental methods and fields in the generated output + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # [internal] Generate internal JSON Schema artifacts for Codex tooling - export extern "codex help app-server generate-internal-json-schema" [ - ] + export complete [codex app-server generate-internal-json-schema] [ + --out(-o): path # Output directory where internal JSON Schema artifacts will be written + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # [experimental] Manage the app-server daemon with remote control enabled - export extern "codex help remote-control" [ - ] + export complete [codex remote-control] [ + --json # Emit machine-readable JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Start the app-server daemon with remote control enabled - export extern "codex help remote-control start" [ - ] + export complete [codex remote-control start] [ + --json # Emit machine-readable JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Stop the app-server daemon - export extern "codex help remote-control stop" [ - ] + export complete [codex remote-control stop] [ + --json # Emit machine-readable JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Create and print a short-lived manual pairing code - export extern "codex help remote-control pair" [ - ] + export complete [codex remote-control pair] [ + --json # Emit machine-readable JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Generate shell completion scripts - export extern "codex help completion" [ - ] + export complete [codex completion] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + shell?: words [bash elvish fish powershell zsh nushell] # Shell to generate completions for + ] where { + terminal [--help] + } # Update Codex to the latest version - export extern "codex help update" [ - ] + export complete [codex update] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Diagnose local Codex installation, config, auth, and runtime health - export extern "codex help doctor" [ - ] + export complete [codex doctor] [ + --json # Emit a redacted machine-readable report + --summary # Only show grouped check rows and the final count summary + --all # Expand long lists in detailed human output + --no-color # Disable ANSI color in human output + --ascii # Use ASCII status labels and separators in human output + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Run commands within a Codex-provided sandbox - export extern "codex help sandbox" [ - ] + export complete [codex sandbox] [ + --sandbox-state-json: text # JSON value from `codex/sandbox-state-meta` to apply directly + --sandbox-state-readable-root: text # Add a readable root to the supplied sandbox state. Repeat for multiple roots + --sandbox-state-disable-network # Disable direct network access in the supplied sandbox state + --permission-profile(-P): text # Named permissions profile to apply from the active configuration stack + --profile(-p): by "nu-complete codex profiles" # Layer $CODEX_HOME/.config.toml on top of the base user config + --cd(-C): dir cwd # Working directory used for profile resolution and command execution + --include-managed-config # Include managed requirements while resolving an explicit permissions profile + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ...command: text # Full command args to run under the Linux sandbox + ] where { + terminal [--help] + } # Debugging tools - export extern "codex help debug" [ - ] + export complete [codex debug] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Render the raw model catalog as JSON - export extern "codex help debug models" [ - ] + export complete [codex debug models] [ + --bundled # Skip refresh and dump only the bundled catalog shipped with this binary + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Tooling: helps debug the app server - export extern "codex help debug app-server" [ - ] + export complete [codex debug app-server] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } - export extern "codex help debug app-server send-message-v2" [ - ] + export complete [codex debug app-server send-message-v2] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + user_message: text + ] where { + terminal [--help] + } # Render the model-visible prompt input list as JSON - export extern "codex help debug prompt-input" [ - ] + export complete [codex debug prompt-input] [ + --image(-i): path # Optional image(s) to attach to the user prompt + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + prompt?: text # Optional user prompt to append after session context + ] where { + terminal [--help] + } # Replay a rollout trace bundle and write reduced state JSON - export extern "codex help debug trace-reduce" [ - ] + export complete [codex debug trace-reduce] [ + --output(-o): path # Output path for reduced RolloutTrace JSON. Defaults to TRACE_BUNDLE/state.json + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + trace_bundle: path # Trace bundle directory containing manifest.json and trace.jsonl + ] where { + terminal [--help] + } # Internal: reset local memory state for a fresh start - export extern "codex help debug clear-memories" [ - ] + export complete [codex debug clear-memories] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Execpolicy tooling - export extern "codex help execpolicy" [ - ] + export complete [codex execpolicy] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Check execpolicy files against a command - export extern "codex help execpolicy check" [ - ] + export complete [codex execpolicy check] [ + --rules(-r): path # Paths to execpolicy rule files to evaluate (repeatable) + --pretty # Pretty-print the JSON output + --resolve-host-executables # Resolve absolute program paths against basename rules, gated by any `host_executable()` definitions in the loaded policy files + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ...command: text # Command tokens to check against the policy + ] where { + terminal [--help] + } # Apply the latest diff produced by Codex agent as a `git apply` to your local working tree - export extern "codex help apply" [ - ] + export complete [codex apply] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + task_id: text + ] where { + terminal [--help] + } # Resume a previous interactive session (picker by default; use --last to continue the most recent) - export extern "codex help resume" [ - ] + export complete [codex resume] [ + --last # Continue the most recent session without showing the picker + --all # Show all sessions (disables cwd filtering and shows CWD column) + --include-non-interactive # Include non-interactive sessions in the resume picker and --last selection + --remote: text # Connect the TUI to a remote app server endpoint + --remote-auth-token-env: env # Name of the environment variable containing the bearer token to send to a remote app server websocket + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --image(-i): path # Optional image(s) to attach to the initial prompt + --model(-m): by "nu-complete codex models" # Model the agent should use + --oss # Use open-source provider + --local-provider: words [lmstudio ollama] # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection + --profile(-p): by "nu-complete codex profiles" # Layer $CODEX_HOME/.config.toml on top of the base user config + --sandbox(-s): words [read-only: "Read files only" workspace-write: "Write inside the workspace" danger-full-access: "No sandbox"] # Select the sandbox policy to use when executing model-generated shell commands + --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources + --cd(-C): dir cwd # Tell the agent to use the specified directory as its working root + --add-dir: dir # Additional directories that should be writable alongside the primary workspace + --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed + --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox + --ask-for-approval(-a): words [untrusted: "Ask for anything not trusted" on-request: "The model decides when to ask" never: "Never ask; failures return to the model"] # Configure when the model requires human approval before executing a command + --search # Enable live web search. When enabled, the native Responses `web_search` tool is available to the model (no per‑call approval) + --no-alt-screen # Disable alternate screen mode + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + --version(-V) # Print version + session_id?: by "nu-complete codex sessions" # Session id (UUID) or session name. UUIDs take precedence if it parses. If omitted, use --last to pick the most recent recorded session + prompt?: text # Optional user prompt to start the session + ] where { + excludes --dangerously-bypass-approvals-and-sandbox --sandbox + excludes --dangerously-bypass-approvals-and-sandbox --ask-for-approval + excludes --dangerously-bypass-approvals-and-sandbox --approve-for-me + excludes --approve-for-me --ask-for-approval + requires --local-provider --oss + excludes --last --all + terminal [--help --version] + } # Queue a message for an existing session - export extern "codex help queue" [ - ] + export complete [codex queue] [ + --thread: text # Session UUID or exact session name + --message: text # Message text to queue + --remote: text # Connect the TUI to a remote app server endpoint + --remote-auth-token-env: env # Name of the environment variable containing the bearer token to send to a remote app server websocket + --image(-i): path # Optional image(s) to attach to the initial prompt + --model(-m): by "nu-complete codex models" # Model the agent should use + --oss # Use open-source provider + --local-provider: words [lmstudio ollama] # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection + --profile(-p): by "nu-complete codex profiles" # Layer $CODEX_HOME/.config.toml on top of the base user config + --sandbox(-s): words [read-only: "Read files only" workspace-write: "Write inside the workspace" danger-full-access: "No sandbox"] # Select the sandbox policy to use when executing model-generated shell commands + --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox + --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed + --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources + --cd(-C): dir cwd # Tell the agent to use the specified directory as its working root + --add-dir: dir # Additional directories that should be writable alongside the primary workspace + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + excludes --dangerously-bypass-approvals-and-sandbox --sandbox + excludes --dangerously-bypass-approvals-and-sandbox --approve-for-me + requires --local-provider --oss + terminal [--help] + } # Archive a saved session by id or session name - export extern "codex help archive" [ - ] + export complete [codex archive] [ + --remote: text # Connect the TUI to a remote app server endpoint + --remote-auth-token-env: env # Name of the environment variable containing the bearer token to send to a remote app server websocket + --image(-i): path # Optional image(s) to attach to the initial prompt + --model(-m): by "nu-complete codex models" # Model the agent should use + --oss # Use open-source provider + --local-provider: words [lmstudio ollama] # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection + --profile(-p): by "nu-complete codex profiles" # Layer $CODEX_HOME/.config.toml on top of the base user config + --sandbox(-s): words [read-only: "Read files only" workspace-write: "Write inside the workspace" danger-full-access: "No sandbox"] # Select the sandbox policy to use when executing model-generated shell commands + --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox + --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed + --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources + --cd(-C): dir cwd # Tell the agent to use the specified directory as its working root + --add-dir: dir # Additional directories that should be writable alongside the primary workspace + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + target: by "nu-complete codex sessions" # Session id (UUID) or session name. UUIDs take precedence if it parses + ] where { + excludes --dangerously-bypass-approvals-and-sandbox --sandbox + excludes --dangerously-bypass-approvals-and-sandbox --approve-for-me + requires --local-provider --oss + terminal [--help] + } # Permanently delete a saved session by id or session name - export extern "codex help delete" [ - ] + export complete [codex delete] [ + --remote: text # Connect the TUI to a remote app server endpoint + --remote-auth-token-env: env # Name of the environment variable containing the bearer token to send to a remote app server websocket + --image(-i): path # Optional image(s) to attach to the initial prompt + --model(-m): by "nu-complete codex models" # Model the agent should use + --oss # Use open-source provider + --local-provider: words [lmstudio ollama] # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection + --profile(-p): by "nu-complete codex profiles" # Layer $CODEX_HOME/.config.toml on top of the base user config + --sandbox(-s): words [read-only: "Read files only" workspace-write: "Write inside the workspace" danger-full-access: "No sandbox"] # Select the sandbox policy to use when executing model-generated shell commands + --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox + --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed + --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources + --cd(-C): dir cwd # Tell the agent to use the specified directory as its working root + --add-dir: dir # Additional directories that should be writable alongside the primary workspace + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --force # Delete without prompting. SESSION must be a UUID + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + target: by "nu-complete codex sessions" # Session id (UUID) or session name. UUIDs take precedence if it parses + ] where { + excludes --dangerously-bypass-approvals-and-sandbox --sandbox + excludes --dangerously-bypass-approvals-and-sandbox --approve-for-me + requires --local-provider --oss + terminal [--help] + } # Inspect or migrate legacy local sessions to paginated thread history - export extern "codex help migrate-rollouts" [ - ] + export complete [codex migrate-rollouts] [ + --apply # Publish the migration. Without this flag the command only reports eligible sessions + --thread: text # Restrict inspection or migration to one or more thread IDs + --max-mib-per-second: text # Limit aggregate rollout read and write throughput, in MiB per second + --json # Emit the complete per-thread report as JSON + --verbose # Print one line for every inspected rollout + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Unarchive a saved session by id or session name - export extern "codex help unarchive" [ - ] + export complete [codex unarchive] [ + --remote: text # Connect the TUI to a remote app server endpoint + --remote-auth-token-env: env # Name of the environment variable containing the bearer token to send to a remote app server websocket + --image(-i): path # Optional image(s) to attach to the initial prompt + --model(-m): by "nu-complete codex models" # Model the agent should use + --oss # Use open-source provider + --local-provider: words [lmstudio ollama] # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection + --profile(-p): by "nu-complete codex profiles" # Layer $CODEX_HOME/.config.toml on top of the base user config + --sandbox(-s): words [read-only: "Read files only" workspace-write: "Write inside the workspace" danger-full-access: "No sandbox"] # Select the sandbox policy to use when executing model-generated shell commands + --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox + --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed + --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources + --cd(-C): dir cwd # Tell the agent to use the specified directory as its working root + --add-dir: dir # Additional directories that should be writable alongside the primary workspace + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + target: by "nu-complete codex sessions" # Session id (UUID) or session name. UUIDs take precedence if it parses + ] where { + excludes --dangerously-bypass-approvals-and-sandbox --sandbox + excludes --dangerously-bypass-approvals-and-sandbox --approve-for-me + requires --local-provider --oss + terminal [--help] + } # Fork a previous interactive session (picker by default; use --last to fork the most recent) - export extern "codex help fork" [ - ] + export complete [codex fork] [ + --last # Fork the most recent session without showing the picker + --all # Show all sessions (disables cwd filtering and shows CWD column) + --remote: text # Connect the TUI to a remote app server endpoint + --remote-auth-token-env: env # Name of the environment variable containing the bearer token to send to a remote app server websocket + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --image(-i): path # Optional image(s) to attach to the initial prompt + --model(-m): by "nu-complete codex models" # Model the agent should use + --oss # Use open-source provider + --local-provider: words [lmstudio ollama] # Specify which local provider to use (lmstudio or ollama). If not specified with --oss, will use config default or show selection + --profile(-p): by "nu-complete codex profiles" # Layer $CODEX_HOME/.config.toml on top of the base user config + --sandbox(-s): words [read-only: "Read files only" workspace-write: "Write inside the workspace" danger-full-access: "No sandbox"] # Select the sandbox policy to use when executing model-generated shell commands + --dangerously-bypass-hook-trust # Run enabled hooks without requiring persisted hook trust for this invocation. DANGEROUS. Intended only for automation that already vets hook sources + --cd(-C): dir cwd # Tell the agent to use the specified directory as its working root + --add-dir: dir # Additional directories that should be writable alongside the primary workspace + --dangerously-bypass-approvals-and-sandbox # Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed + --approve-for-me # Route approval requests through automatic review using the workspace-write sandbox + --ask-for-approval(-a): words [untrusted: "Ask for anything not trusted" on-request: "The model decides when to ask" never: "Never ask; failures return to the model"] # Configure when the model requires human approval before executing a command + --search # Enable live web search. When enabled, the native Responses `web_search` tool is available to the model (no per‑call approval) + --no-alt-screen # Disable alternate screen mode + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + --version(-V) # Print version + session_id?: by "nu-complete codex sessions" # Conversation/session id (UUID). When provided, forks this session. If omitted, use --last to pick the most recent recorded session + prompt?: text # Optional user prompt to start the session + ] where { + excludes --dangerously-bypass-approvals-and-sandbox --sandbox + excludes --dangerously-bypass-approvals-and-sandbox --ask-for-approval + excludes --dangerously-bypass-approvals-and-sandbox --approve-for-me + excludes --approve-for-me --ask-for-approval + requires --local-provider --oss + excludes --last --all + terminal [--help --version] + } # [EXPERIMENTAL] Browse tasks from Codex Cloud and apply changes locally - export extern "codex help cloud" [ - ] + export complete [codex cloud] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + --version(-V) # Print version + ] where { + terminal [--help --version] + } # Submit a new Codex Cloud task without launching the TUI - export extern "codex help cloud exec" [ - ] + export complete [codex cloud exec] [ + --env: text # Target environment identifier (see `codex cloud` to browse) + --attempts: text # Number of assistant attempts (best-of-N) + --branch: text # Git branch to run in Codex Cloud (defaults to current branch) + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + query?: text # Task prompt to run in Codex Cloud + ] where { + terminal [--help] + } # Show the status of a Codex Cloud task - export extern "codex help cloud status" [ - ] + export complete [codex cloud status] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + task_id: text # Codex Cloud task identifier to inspect + ] where { + terminal [--help] + } # List Codex Cloud tasks - export extern "codex help cloud list" [ - ] + export complete [codex cloud list] [ + --env: text # Filter tasks by environment identifier + --limit: text # Maximum number of tasks to return (1-20) + --cursor: text # Pagination cursor returned by a previous call + --json # Emit JSON instead of plain text + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Apply the diff for a Codex Cloud task locally - export extern "codex help cloud apply" [ - ] + export complete [codex cloud apply] [ + --attempt: text # Attempt number to apply (1-based) + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + task_id: text # Codex Cloud task identifier to apply + ] where { + terminal [--help] + } # Show the unified diff for a Codex Cloud task - export extern "codex help cloud diff" [ - ] + export complete [codex cloud diff] [ + --attempt: text # Attempt number to display (1-based) + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + task_id: text # Codex Cloud task identifier to display + ] where { + terminal [--help] + } # Internal: run the responses API proxy - export extern "codex help responses-api-proxy" [ - ] + export complete [codex responses-api-proxy] [ + --port: text # Port to listen on. If not set, an ephemeral port is used + --server-info: path # Path to a JSON file to write startup info (single line). Includes {"port": } + --http-shutdown # Enable HTTP shutdown endpoint at GET /shutdown + --upstream-url: text # Absolute URL the proxy should forward requests to (defaults to OpenAI) + --dump-dir: path # Directory where request/response dumps should be written as JSON + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Internal: relay stdio to a Unix domain socket - export extern "codex help stdio-to-uds" [ - ] + export complete [codex stdio-to-uds] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + socket_path: text # Path to the Unix domain socket to connect to + ] where { + terminal [--help] + } # [EXPERIMENTAL] Run the standalone exec-server service - export extern "codex help exec-server" [ - ] + export complete [codex exec-server] [ + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --concurrent-requests: text # Maximum number of requests to process concurrently on each connection + --listen: text # Transport endpoint URL. Supported values: `ws://IP:PORT` (default), `stdio`, `stdio://` + --remote: text # Register this exec-server as a remote environment using the given base URL + --environment-id: text # Environment id to attach to when registering remotely + --name: text # Human-readable environment name + --use-agent-identity-auth # Use Agent Identity auth from CODEX_ACCESS_TOKEN for remote registration + --exit-on-stdin-close # Exit when the parent-owned standard-input pipe closes + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Register an existing WebSocket exec-server as a remote environment - export extern "codex help exec-server forward" [ - ] + export complete [codex exec-server forward] [ + --connect: text # Destination exec-server WebSocket URL + --strict-config # Error out when config.toml contains fields that are not recognized by this version of Codex + --remote: text # Register this exec-server as a remote environment using the given base URL + --environment-id: text # Environment id to attach to when registering remotely + --name: text # Human-readable environment name + --use-agent-identity-auth # Use Agent Identity auth from CODEX_ACCESS_TOKEN for remote registration + --exit-on-stdin-close # Exit when the parent-owned standard-input pipe closes + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Inspect feature flags - export extern "codex help features" [ - ] + export complete [codex features] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # List known features with their stage and effective state - export extern "codex help features list" [ - ] + export complete [codex features list] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + ] where { + terminal [--help] + } # Enable a feature in config.toml - export extern "codex help features enable" [ - ] + export complete [codex features enable] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + feature: text # Feature key to update (for example: unified_exec) + ] where { + terminal [--help] + } # Disable a feature in config.toml - export extern "codex help features disable" [ - ] + export complete [codex features disable] [ + --config(-c): text # Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as TOML. If it fails to parse as TOML, the raw string is used as a literal + --enable: by "nu-complete codex features" # Enable a feature (repeatable). Equivalent to `-c features.=true` + --disable: by "nu-complete codex features" # Disable a feature (repeatable). Equivalent to `-c features.=false` + --help(-h) # Print help (see more with '--help') + feature: text # Feature key to update (for example: unified_exec) + ] where { + terminal [--help] + } # Print this message or the help of the given subcommand(s) - export extern "codex help help" [ + export complete [codex help] [ + ...command: words [agents exec review login logout mcp plugin app-server remote-control app completion update doctor sandbox debug apply resume queue archive delete migrate-rollouts migrate-nfs-db unarchive fork cloud exec-server features mcp-server execpolicy responses-api-proxy stdio-to-uds] # Subcommand to show help for ] + # Launch the Desktop app (opens the app installer if missing) + export complete [codex app] [ + --config(-c): text # Override a configuration value from config.toml + --help(-h) # Print help + path?: path # Workspace path to open + ] where { + terminal [--help] + } + + # [experimental] Migrate configured SQLite databases to DELETE mode in place + export complete [codex migrate-nfs-db] [ + --config(-c): text # Override a configuration value from config.toml + --staging-dir: path # Directory with room for the database and WAL files + --help(-h) # Print help + ] where { + terminal [--help] + } + } export use completions * diff --git a/custom-completions/composer/composer-completions.nu b/custom-completions/composer/composer-completions.nu index 006cde8f6..83cc13253 100644 --- a/custom-completions/composer/composer-completions.nu +++ b/custom-completions/composer/composer-completions.nu @@ -1,446 +1,404 @@ -# Written for composer v2.7.0 - -def "nu-complete composer installed-packages" [] { - cat composer.lock | from json | get packages | each {get name} +# Declarative completions for Composer, the PHP dependency manager. + +# Packages locked in composer.lock (with their versions), falling back to composer.json requirements. +@non-destructive +export def "nu-complete composer installed-packages" [] { + try { + if ('composer.lock' | path exists) { + let lock = open composer.lock + $lock.packages | append ($lock.packages-dev? | default []) | each {|p| {value: $p.name, description: $p.version} } + } else { + let json = open composer.json + $json.require? | default {} | merge ($json.require-dev? | default {}) | transpose value description + } + } catch { [] } } -def "nu-complete composer installation-modes" [] { - [ - { value: 'dist', description: 'Install from package dist' } - { value: 'source', description: 'Install from package source and include VSC information' } - { value: 'auto', description: 'Use source for dev versions and dist for the rest' } - ] +# Scripts declared in composer.json. +@non-destructive +export def "nu-complete composer scripts" [] { + try { + let json = open composer.json + let desc = $json.scripts-descriptions? | default {} + $json.scripts | columns | each {|s| {value: $s, description: ($desc | get -o $s | default "script")} } + } catch { [] } } -def "nu-complete composer audit-formats" [] { - ['table' 'plain' 'json' 'summary'] -} +# Written for composer v2.7.0 -def "nu-complete composer commands" [] { - composer list --format json | - from json | - get commands | - where {|cmd| not $cmd.hidden} | - each {|cmd| {value: $cmd.name, description: $cmd.description}} +@non-destructive +export def "nu-complete composer commands" [] { + try { + composer list --format json | + from json | + get commands | + where {|cmd| not $cmd.hidden} | + each {|cmd| {value: $cmd.name, description: $cmd.description}} + } catch { [] } } # Composer is a tool for dependency management in PHP. -export extern "composer" [ - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display the application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --profile # Display timing and memory usage information. - --no-plugins # Whether to disable plugins. - --no-scripts # Skips the execution of all scripts defined in composer.json file. - --working-dir(-d): string # If specified, use the given directory as working directory. - --no-cache # Prevent use of the cache. - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -def "nu-complete composer command-description-output-formats" [] { - ['txt', 'xml', 'json', 'md'] +export complete [composer] [ + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display the application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --profile # Display timing and memory usage information. + --no-plugins # Whether to disable plugins. + --no-scripts # Skips the execution of all scripts defined in composer.json file. + --working-dir(-d): dir cwd # If specified, use the given directory as working directory. + --no-cache # Prevent use of the cache. + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + excludes --ansi --no-ansi + excludes --quiet --verbose + terminal [--help --version] } # Shows a short information about Composer. -export extern "composer about" [] - -def "nu-complete composer archive-formats" [] { - ['tar' 'tar.gz' 'tar.bz2' 'zip'] -} +export complete [composer about] [ +] # Creates an archive of this composer package. -export extern "composer archive" [ - --format(-f): string@"nu-complete composer archive-formats" # Format of the resulting archive: tar, tar.gz, tar.gz2, zip. [default: "tar"] - --dir: string # Write the archive to this directory. - --file: string # Write the archive with the given file name. Note that the format will be appended. - --ignore-filters # Ignore filters when saving package. - - package?: string # The package to archive instead of the current project. - version?: string # A versions constraint to find the package to archive. +export complete [composer archive] [ + --format(-f): words [tar tar.gz tar.bz2 zip] # Format of the resulting archive: tar, tar.gz, tar.gz2, zip. [default: "tar"] + --dir: dir # Write the archive to this directory. + --file: path # Write the archive with the given file name. Note that the format will be appended. + --ignore-filters # Ignore filters when saving package. + package?: by "nu-complete composer installed-packages" # The package to archive instead of the current project. + version?: text # A versions constraint to find the package to archive. ] # Checks for security vulnerability advisories for the installed packages. -export extern "composer audit" [ - --no-dev # Disables auditing of require-dev packages. - --format(-f): string@"nu-complete composer audit-formats" # Output format. Must be "table", "plain", "json", or "summary". [default: "table"] - --locked # Audit based on the lock file instead of the installed packages. +export complete [composer audit] [ + --no-dev # Disables auditing of require-dev packages. + --format(-f): words [table plain json summary] # Output format. Must be "table", "plain", "json", or "summary". [default: "table"] + --locked # Audit based on the lock file instead of the installed packages. ] # Opens the package's repository URL or homepage in your browser. -export extern "composer browse" [ - --homepage(-H) # Open the homepage instead of the repository URL. - --show(-s) # Only show the homepage or repository URL. - - ...packages: string # Package(s) to browse to. +export complete [composer browse] [ + --homepage(-H) # Open the homepage instead of the repository URL. + --show(-s) # Only show the homepage or repository URL. + ...packages: by "nu-complete composer installed-packages" # Package(s) to browse to. ] # Increases the lower limit of your composer.json requirements to the currently installed versions. -export extern "composer bump" [ - --dev-only(-D) # Only bump requirements in "require-dev". - --no-dev-only(-R) # Only bump requirements in "require" - --dry-run # Outputs the packages to bump, but will not execute anything. - - ...packages: string@"nu-complete composer installed-packages" # Optional package name(s) to restrict which packages are bumped. -] - -def "nu-complete composer platform-reqs-formats" [] { - ['text' 'json'] +export complete [composer bump] [ + --dev-only(-D) # Only bump requirements in "require-dev". + --no-dev-only(-R) # Only bump requirements in "require" + --dry-run # Outputs the packages to bump, but will not execute anything. + ...packages: by "nu-complete composer installed-packages" # Optional package name(s) to restrict which packages are bumped. +] where { + excludes --dev-only --no-dev-only } # Check that platform requirements are satisfied. -export extern "composer check-platform-reqs" [ - --no-dev # Disables checking of require-dev packages requirements. - --lock # Checks requirements only from the lock file, not from installed packages. - --format(-f): string@"nu-complete composer platform-reqs-formats" # Format of the output: text or json. [default: "text"] +export complete [composer check-platform-reqs] [ + --no-dev # Disables checking of require-dev packages requirements. + --lock # Checks requirements only from the lock file, not from installed packages. + --format(-f): words [text json] # Format of the output: text or json. [default: "text"] ] # [clearcache|cc] Clears composer's internal package cache. -export extern "composer clear-cache" [ - --gc # Only run garbage collection, not a full cache clear. +export complete [composer clear-cache] [ + --gc # Only run garbage collection, not a full cache clear. ] -def "nu-complete composer completion-shells" [] { - ['bash'] -} - # Dump the shell completion script. -export extern "composer completion" [ - --debug # Tail the completion debug log. - shell: string@"nu-complete composer completion-shells" = 'bash' # The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given. +export complete [composer completion] [ + --debug # Tail the completion debug log. + shell: words [bash] # The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given. ] # Sets config options. -export extern "composer config" [ - --global(-g) # Apply command to the global config file. - --editor(-e) # Open editor. - --auth(-a) # Affect auth config file (only used for --editor). - --unset # Unset the given setting-key. - --list(-l) # List configuration settings. - --file(-f): string # If you want to choose a different composer.json or config.json. - --absolute # Returns absolute paths when fetching *-dir config values instead of relative. - --json(-j) # JSON decode the setting value, to be used with extra.* keys. - --merge(-m) # Merge the setting value with the current value, to be used with extra.* keys instead of prepending it (highest priority). - --append # When adding a repository, append it (lowest priority) to the existing ones instead of prepending it (highest priority). - --source # Display where the config value is loaded from. - - settings_key: string - settings_value?: string +export complete [composer config] [ + --global(-g) # Apply command to the global config file. + --editor(-e) # Open editor. + --auth(-a) # Affect auth config file (only used for --editor). + --unset # Unset the given setting-key. + --list(-l) # List configuration settings. + --file(-f): text # If you want to choose a different composer.json or config.json. + --absolute # Returns absolute paths when fetching *-dir config values instead of relative. + --json(-j) # JSON decode the setting value, to be used with extra.* keys. + --merge(-m) # Merge the setting value with the current value, to be used with extra.* keys instead of prepending it (highest priority). + --append # When adding a repository, append it (lowest priority) to the existing ones instead of prepending it (highest priority). + --source # Display where the config value is loaded from. + settings_key: text + settings_value?: text ] # Creates a new project from a package into a given directory. -export extern "composer create-project" [ - --stability(-s) # Minimum-stability allowed (unless as version is specified). - - --prefer-source # Forces installation from package sources when possible, including VCS information. - --prefer-dist # Forces installation from package dist (default behavior). - --prefer-install: string@"nu-complete composer installation-modes" # Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest). - - --repository: string # Add custom repositories to look the package up, either by URL or using JSON arrays (multiple values allowed). - --add-repository # Add the custom repository in the composer.json. If a lockfile is present it will be deleted and an update will be run instead of install. - - --no-dev # Disables installation of require-dev packages. - --no-scripts # Skips the execution of all scripts defined in composer.json file. - --no-progress # Do not output download progress. - --no-secure-http # Disable the secure-http config option temporarily while installing the root package. Use at your own risk. Using this flag is a bad idea. - --keep-vcs # Whether to prevent deleting the vcs folder. - --remove-vcs # Whether to force deletion of the vcs folder without prompting. - --no-install # Whether to skip installation of the package dependencies. - --no-audit # Whether to skip auditing of the installed package dependencies (can also be set via the COMPOSER_NO_AUDIT=1 env var). - --audit-format: string@"nu-complete composer audit-formats" # Audit output format. Must be "table", "plain", "json" or "summary". [default: "summary"] - --ignore-platform-req: string # Ignore a specific platform requirement (php & ext- packages). (multiple values allowed). - --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). - --ask # Whether to ask for project directory. - - package?: string # Package name to be installed. - directory?: string # Directory where the files should be created. - version?: string # Version, will default to latest. -] +export complete [composer create-project] [ + --stability(-s) # Minimum-stability allowed (unless as version is specified). + --prefer-source # Forces installation from package sources when possible, including VCS information. + --prefer-dist # Forces installation from package dist (default behavior). + --prefer-install: words [dist: "Install from package dist" source: "Install from package source and include VSC information" auto: "Use source for dev versions and dist for the rest"] # Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest). + --repository: text # Add custom repositories to look the package up, either by URL or using JSON arrays (multiple values allowed). + --add-repository # Add the custom repository in the composer.json. If a lockfile is present it will be deleted and an update will be run instead of install. + --no-dev # Disables installation of require-dev packages. + --no-scripts # Skips the execution of all scripts defined in composer.json file. + --no-progress # Do not output download progress. + --no-secure-http # Disable the secure-http config option temporarily while installing the root package. Use at your own risk. Using this flag is a bad idea. + --keep-vcs # Whether to prevent deleting the vcs folder. + --remove-vcs # Whether to force deletion of the vcs folder without prompting. + --no-install # Whether to skip installation of the package dependencies. + --no-audit # Whether to skip auditing of the installed package dependencies (can also be set via the COMPOSER_NO_AUDIT=1 env var). + --audit-format: words [table plain json summary] # Audit output format. Must be "table", "plain", "json" or "summary". [default: "summary"] + --ignore-platform-req: text # Ignore a specific platform requirement (php & ext- packages). (multiple values allowed). + --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). + --ask # Whether to ask for project directory. + package?: text # Package name to be installed. + directory?: text # Directory where the files should be created. + version?: text # Version, will default to latest. +] where { + at-most-one [--prefer-dist --prefer-source --prefer-install] + excludes --ignore-platform-req --ignore-platform-reqs +} # [why] Shows which packages cause the given package to be installed. -export extern "composer depends" [ - --recursive(-r) # Recursively resolves up to the root package. - --tree(-t) # Prints the results as a nested tree. - --locked # Read dependency information from composer.lock. - - package: string # Package to inspect. +export complete [composer depends] [ + --recursive(-r) # Recursively resolves up to the root package. + --tree(-t) # Prints the results as a nested tree. + --locked # Read dependency information from composer.lock. + package: by "nu-complete composer installed-packages" # Package to inspect. ] # Diagnoses the system to identify common errors. -export extern "composer diagnose" [] +export complete [composer diagnose] [ +] # [dumpautoload] Dumps the autoloader. -export extern "composer dump-autoload" [ - --optimize(-o) # Optimizes PSR0 and PSR4 packages to be loaded with classmaps too, good for production. - --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables `--optimize`. - --apcu # Use APCu to cache found/not-found classes. - --apcu-prefix: string # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu - - --dry-run # Outputs the operations but will not execute anything. - --dev # Enables autoload-dev rules. Composer will by default infer this automatically according to the last install or update --no-dev state. - --no-dev # Disables autoload-dev rules. Composer will by default inf er this automatically according to the last install or update --no-dev state. - - --ignore-platform-req: string # Ignore a specific platform requirement (php & ext- package es). (multiple values allowed). - --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). - --strict-psr # Return a failed status code (1) if PSR-4 or PSR-0 mapping errors are present. Requires --optimize to work. -] +export complete [composer dump-autoload] [ + --optimize(-o) # Optimizes PSR0 and PSR4 packages to be loaded with classmaps too, good for production. + --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables `--optimize`. + --apcu # Use APCu to cache found/not-found classes. + --apcu-prefix: text # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu + --dry-run # Outputs the operations but will not execute anything. + --dev # Enables autoload-dev rules. Composer will by default infer this automatically according to the last install or update --no-dev state. + --no-dev # Disables autoload-dev rules. Composer will by default inf er this automatically according to the last install or update --no-dev state. + --ignore-platform-req: text # Ignore a specific platform requirement (php & ext- package es). (multiple values allowed). + --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). + --strict-psr # Return a failed status code (1) if PSR-4 or PSR-0 mapping errors are present. Requires --optimize to work. +] where { + excludes --dev --no-dev + excludes --ignore-platform-req --ignore-platform-reqs +} -def "nu-complete composer exec-scripts" [] { - composer exec --list | - split row (char newline) | - skip 1 | - str trim --char '-' | - str trim +@non-destructive +export def "nu-complete composer exec-scripts" [] { + try { + composer exec --list | + split row (char newline) | + skip 1 | + str trim --char '-' | + str trim + } catch { [] } } # Executes a vendored binary/script. -export extern "composer exec" [ - --list(-l) # List all executable scripts. - - script?: string@"nu-complete composer exec-scripts" # The binary to run, e.g. phpunit. - ...args: string # Arguments to pass to the binary. Use `--` to separate from composer arguments. +export complete [composer exec] [ + --list(-l) # List all executable scripts. + script?: by "nu-complete composer exec-scripts" # The binary to run, e.g. phpunit. + ...args: text # Arguments to pass to the binary. Use `--` to separate from composer arguments. ] -def "nu-complete composer fund-formats" [] { - ['text' 'json'] -} - # Discover how to help fund the maintenance of your dependencies. -export extern "composer fund" [ - --format(-f): string@"nu-complete composer fund-formats" # Format of the output: text or json. [default: "text"] +export complete [composer fund] [ + --format(-f): words [text json] # Format of the output: text or json. [default: "text"] ] # Allows running commands in the global composer dir ($COMPOSER_HOME). -export extern "composer global" [ - command_name: string@"nu-complete composer commands" - ...args: string +export complete [composer global] [ + command_name: by "nu-complete composer commands" + ...args: text ] # Display help for a command. -export extern "composer help" [ - --raw # To output raw command help. - --format: string@"nu-complete composer command-description-output-formats" # The output format (txt, xml, json, or md) [default: "txt"]. - - command?: string@"nu-complete composer commands" # The command name. [default: "help"] +export complete [composer help] [ + --raw # To output raw command help. + --format: words [txt xml json md] # The output format (txt, xml, json, or md) [default: "txt"]. + command?: by "nu-complete composer commands" # The command name. [default: "help"] ] -def "nu-complete composer project-types" [] { - ['library' 'project' 'metapackage' 'composer-plugin'] -} - # Creates a basic composer.json file in current directory. -export extern "composer init" [ - --name: string # Name of the package. - --description: string # Description of package. - --author: string # Author name of package. - --type: string@"nu-complete composer project-types" # Type of package (e.g. library, project, metapackage, composer-plugin). - --homepage: string # Homepage of package. - --require: string # Package to require with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0" (multiple values allowed). - --require-dev: string #-DEV Package to require for development with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0" (multiple values allowed). - -s, --stability: string # Minimum stability (empty or one of: stable, RC, beta, alpha, dev). - -l, --license: string # License of package. - --repository: string # Add custom repositories, either by URL or using JSON arrays (multiple values allowed). - --autoload(-a): string # Add PSR-4 autoload mapping. Maps your package's namespace to the provided directory. (Expects a relative path, e.g. src/). +export complete [composer init] [ + --name: text # Name of the package. + --description: text # Description of package. + --author: text # Author name of package. + --type: words [library project metapackage composer-plugin] # Type of package (e.g. library, project, metapackage, composer-plugin). + --homepage: text # Homepage of package. + --require: text # Package to require with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0" (multiple values allowed). + --require-dev: text # -DEV Package to require for development with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0" (multiple values allowed). + --repository: text # Add custom repositories, either by URL or using JSON arrays (multiple values allowed). + --autoload(-a): text # Add PSR-4 autoload mapping. Maps your package's namespace to the provided directory. (Expects a relative path, e.g. src/). ] # [i] Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json -export extern "composer install" [ - --prefer-source # Forces installation from package sources when possible, including VCS information. - --prefer-dist # Forces installation from package dist (default behavior). - --prefer-install: string@"nu-complete composer installation-modes" # Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest). - - --dry-run # Outputs the operations but will not execute anything (implicitly enables --verbose). - --download-only # Download only, do not install packages. - --no-dev # Disables installation of require-dev packages. - --no-autoloader # Skips autoloader generation. - --no-progress # Do not output download progress. - - --audit # Run an audit after installation is complete. - --audit-format: string@"nu-complete composer audit-formats" # Audit output format. Must be "table", "plain", "json", or "summary". [default: "summary"] - - --optimize-autoloader(-o) # Optimize autoloader during autoloader dump. - --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables --apcu-autoloader - --apcu-autoloader # Use APCu to cache found/not-found classes. - --apcu-autoloader-prefix: string # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader. - - --ignore-platform-req: string # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). - --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). -] - -def "nu-complete composer licenses-formats" [] { - ['text' 'json' 'summary'] +export complete [composer install] [ + --prefer-source # Forces installation from package sources when possible, including VCS information. + --prefer-dist # Forces installation from package dist (default behavior). + --prefer-install: words [dist: "Install from package dist" source: "Install from package source and include VSC information" auto: "Use source for dev versions and dist for the rest"] # Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest). + --dry-run # Outputs the operations but will not execute anything (implicitly enables --verbose). + --download-only # Download only, do not install packages. + --no-dev # Disables installation of require-dev packages. + --no-autoloader # Skips autoloader generation. + --no-progress # Do not output download progress. + --audit # Run an audit after installation is complete. + --audit-format: words [table plain json summary] # Audit output format. Must be "table", "plain", "json", or "summary". [default: "summary"] + --optimize-autoloader(-o) # Optimize autoloader during autoloader dump. + --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables --apcu-autoloader + --apcu-autoloader # Use APCu to cache found/not-found classes. + --apcu-autoloader-prefix: text # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader. + --ignore-platform-req: text # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). + --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). +] where { + at-most-one [--prefer-dist --prefer-source --prefer-install] + excludes --ignore-platform-req --ignore-platform-reqs } # Shows information about licenses of dependencies. -export extern "composer licenses" [ - --format(-f): string@"nu-complete composer licenses-formats" # Format of the output: text, json or summary. [default: "text"] - --no-dev # Disables search in require-dev packages. +export complete [composer licenses] [ + --format(-f): words [text json summary] # Format of the output: text, json or summary. [default: "text"] + --no-dev # Disables search in require-dev packages. ] # List commands -export extern "composer list" [ - --raw # To output raw command list. - --format: string@"nu-complete composer command-description-output-formats" # The output format (txt, xml, json, or md) [default: "txt"]. - --short # To skip describing commands' arguments. +export complete [composer list] [ + --raw # To output raw command list. + --format: words [txt xml json md] # The output format (txt, xml, json, or md) [default: "txt"]. + --short # To skip describing commands' arguments. ] -def "nu-complete composer show-formats" [] { - ['text' 'json'] -} - # Shows a list of installed packages that have updates available, including their latest version. -export extern "composer outdated" [ - --outdated(-o) # Show only packages that are outdated (this is the default, but present here for compat with `show`) - --all(-a) # Show all installed packages with their latest versions - --locked # Shows updates for packages from the lock file, regardless of what is currently in vendor dir - --direct(-D) # Shows only packages that are directly required by the root package - --strict # Return a non-zero exit code when there are outdated packages - --major-only(-M) # Show only packages that have major SemVer-compatible updates. - --minor-only(-m) # Show only packages that have minor SemVer-compatible updates. - --patch-only(-p) # Show only packages that have patch SemVer-compatible updates. - --sort-by-age(-A) # Displays the installed version's age, and sorts packages oldest first. - --format(-f): string@"nu-complete composer show-formats" # Format of the output: text or json [default: "text"] - --ignore: string # Ignore specified package(s). Can contain wildcards (*). Use it if you don't want to be informed about new versions of some packages. (multiple values allowed) - --no-dev # Disables search in require-dev packages. - - --ignore-platform-req: string # Ignore a specific platform requirement (php & ext- packages). Use with the --outdated option (multiple values allowed). - --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). Use with the --outdated option - - package?: string # Package to inspect. Or a name including a wildcard (*) to filter lists of packages instead. -] +export complete [composer outdated] [ + --outdated(-o) # Show only packages that are outdated (this is the default, but present here for compat with `show`) + --all(-a) # Show all installed packages with their latest versions + --locked # Shows updates for packages from the lock file, regardless of what is currently in vendor dir + --direct(-D) # Shows only packages that are directly required by the root package + --strict # Return a non-zero exit code when there are outdated packages + --major-only(-M) # Show only packages that have major SemVer-compatible updates. + --minor-only(-m) # Show only packages that have minor SemVer-compatible updates. + --patch-only(-p) # Show only packages that have patch SemVer-compatible updates. + --sort-by-age(-A) # Displays the installed version's age, and sorts packages oldest first. + --format(-f): words [text json] # Format of the output: text or json [default: "text"] + --ignore: by "nu-complete composer installed-packages" # Ignore specified package(s). Can contain wildcards (*). Use it if you don't want to be informed about new versions of some packages. (multiple values allowed) + --no-dev # Disables search in require-dev packages. + --ignore-platform-req: text # Ignore a specific platform requirement (php & ext- packages). Use with the --outdated option (multiple values allowed). + --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). Use with the --outdated option + package?: by "nu-complete composer installed-packages" # Package to inspect. Or a name including a wildcard (*) to filter lists of packages instead. +] where { + at-most-one [--major-only --minor-only --patch-only] + excludes --ignore-platform-req --ignore-platform-reqs +} # [why-not] Shows which packages prevent the given package from being installed -export extern "composer prohibits" [ - --recursive(-r) # Recursively resolves up to the root package. - --tree(-t) # Prints the results as a nested tree. - --locked # Read dependency information from composer.lock. - - package: string # Package to inspect. - version?: string # Version constraint, which version you expected to be installed. +export complete [composer prohibits] [ + --recursive(-r) # Recursively resolves up to the root package. + --tree(-t) # Prints the results as a nested tree. + --locked # Read dependency information from composer.lock. + package: by "nu-complete composer installed-packages" # Package to inspect. + version?: text # Version constraint, which version you expected to be installed. ] # Uninstalls and reinstalls the given package names. -export extern "composer reinstall" [ - --prefer-source # Forces installation from package sources when possible, including VCS information. - --prefer-dist # Forces installation from package dist (default behavior). - --prefer-install: string@"nu-complete composer installation-modes" # Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest). - - --no-autoloader # Skips autoloader generation. - --no-progress # Do not output download progress. - - --optimize-autoloader(-o) # Optimize autoloader during autoloader dump. - --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables --apcu-autoloader - --apcu-autoloader # Use APCu to cache found/not-found classes. - --apcu-autoloader-prefix: string # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader. - - --ignore-platform-req: string # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). - --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). - - ...packages: string@"nu-complete composer installed-packages" # List of package names to reinstall, can include a wildcard (*) to match any substring. -] +export complete [composer reinstall] [ + --prefer-source # Forces installation from package sources when possible, including VCS information. + --prefer-dist # Forces installation from package dist (default behavior). + --prefer-install: words [dist: "Install from package dist" source: "Install from package source and include VSC information" auto: "Use source for dev versions and dist for the rest"] # Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest). + --no-autoloader # Skips autoloader generation. + --no-progress # Do not output download progress. + --optimize-autoloader(-o) # Optimize autoloader during autoloader dump. + --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables --apcu-autoloader + --apcu-autoloader # Use APCu to cache found/not-found classes. + --apcu-autoloader-prefix: text # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader. + --ignore-platform-req: text # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). + --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). + ...packages: by "nu-complete composer installed-packages" # List of package names to reinstall, can include a wildcard (*) to match any substring. +] where { + at-most-one [--prefer-dist --prefer-source --prefer-install] + excludes --ignore-platform-req --ignore-platform-reqs +} # [rm] Removes a package from the require or require-dev -export extern "composer remove" [ - --dev # Removes a package from the require-dev section. - --dry-run # Outputs the operations but will not execute anything (implicitly enables --verbose). - - --no-progress # Do not output download progress. - --no-update # Disables the automatic update of the dependencies (implies --no-install). - --no-install # Skip the install step after update the composer.lock file. - --no-audit # Skip the audit step after updating the composer.lock file (can also be set via the COMPOSER_NO_AUDIT=1 env var). - --audit-format: string@"nu-complete composer audit-formats" # Audit output format. Must be "table", "plain", "json", or "summary". [default: "summary"] - --update-no-dev # Run the dependency update with the --no-dev option. - --update-with-dependencies(-w) # Allows inherited dependencies to be updated, except those that are root requirements. - --update-with-all-dependencies(-W) # Allows all inherited dependencies to be updated, including those that are root requirements. - --with-dependencies # Alias for --update-with-dependencies - --with-all-dependencies # Alias for --update-with-all-dependencies - - --minimal-changes(-M) # During an update with -w/-W, only perform absolutely necessary changes to transitive dependencies (can also be set via the COMPOSER_MINIMAL_CHANGES=1 env var). - - --unused # Remove all packages which are locked but not required by any other package. - - --ignore-platform-req: string # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). - --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). - - --optimize-autoloader(-o) # Optimize autoloader during autoloader dump. - --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables --apcu-autoloader - --apcu-autoloader # Use APCu to cache found/not-found classes. - --apcu-autoloader-prefix: string # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader. - - ...packages: string@"nu-complete composer installed-packages" # Packages that should be removed. -] +export complete [composer remove] [ + --dev # Removes a package from the require-dev section. + --dry-run # Outputs the operations but will not execute anything (implicitly enables --verbose). + --no-progress # Do not output download progress. + --no-update # Disables the automatic update of the dependencies (implies --no-install). + --no-install # Skip the install step after update the composer.lock file. + --no-audit # Skip the audit step after updating the composer.lock file (can also be set via the COMPOSER_NO_AUDIT=1 env var). + --audit-format: words [table plain json summary] # Audit output format. Must be "table", "plain", "json", or "summary". [default: "summary"] + --update-no-dev # Run the dependency update with the --no-dev option. + --update-with-dependencies(-w) # Allows inherited dependencies to be updated, except those that are root requirements. + --update-with-all-dependencies(-W) # Allows all inherited dependencies to be updated, including those that are root requirements. + --with-dependencies # Alias for --update-with-dependencies + --with-all-dependencies # Alias for --update-with-all-dependencies + --minimal-changes(-M) # During an update with -w/-W, only perform absolutely necessary changes to transitive dependencies (can also be set via the COMPOSER_MINIMAL_CHANGES=1 env var). + --unused # Remove all packages which are locked but not required by any other package. + --ignore-platform-req: text # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). + --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). + --optimize-autoloader(-o) # Optimize autoloader during autoloader dump. + --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables --apcu-autoloader + --apcu-autoloader # Use APCu to cache found/not-found classes. + --apcu-autoloader-prefix: text # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader. + ...packages: by "nu-complete composer installed-packages" # Packages that should be removed. +] where { + excludes --ignore-platform-req --ignore-platform-reqs +} # [r|req] Adds required packages to your composer.json and installs them -export extern "composer require" [ - --dev # Add requirement to require-dev. - --dry-run # Outputs the operations but will not execute anything (implicitly enables --verbose). - - --prefer-source # Forces installation from package sources when possible, including VCS information. - --prefer-dist # Forces installation from package dist (default behavior). - --prefer-install: string@"nu-complete composer installation-modes" # Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest). - - --fixed # Write fixed version to the composer.json. - - --no-progress # Do not output download progress. - --no-update # Disables the automatic update of the dependencies (implies --no-install). - --no-install # Skip the install step after update the composer.lock file. - --no-audit # Skip the audit step after updating the composer.lock file (can also be set via the COMPOSER_NO_AUDIT=1 env var). - --audit-format: string@"nu-complete composer audit-formats" # Audit output format. Must be "table", "plain", "json", or "summary". [default: "summary"] - --update-no-dev # Run the dependency update with the --no-dev option. - --update-with-dependencies(-w) # Allows inherited dependencies to be updated, except those that are root requirements. - --update-with-all-dependencies(-W) # Allows all inherited dependencies to be updated, including those that are root requirements. - --with-dependencies # Alias for --update-with-dependencies - --with-all-dependencies # Alias for --update-with-all-dependencies - - --ignore-platform-req: string # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). - --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). - - --prefer-stable # Prefer stable versions of dependencies (can also be set via the COMPOSER_PREFER_STABLE=1 env var) - --prefer-lowest # Prefer lowest versions of dependencies (can also be set via the COMPOSER_PREFER_LOWEST=1 env var) - - --minimal-changes(-M) # During an update with -w/-W, only perform absolutely necessary changes to transitive dependencies (can also be set via the COMPOSER_MINIMAL_CHANGES=1 env var). - --sort-packages # Sorts packages when adding/updateing a new dependency. - - --optimize-autoloader(-o) # Optimize autoloader during autoloader dump. - --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables --apcu-autoloader - --apcu-autoloader # Use APCu to cache found/not-found classes. - --apcu-autoloader-prefix: string # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader. - - ...packages: string -] - -def "nu-complete composer scripts" [] { - do { composer run --list } | - complete | - get stdout | - split row (char newline) | - parse ' {value} {description}' | - str trim +export complete [composer require] [ + --dev # Add requirement to require-dev. + --dry-run # Outputs the operations but will not execute anything (implicitly enables --verbose). + --prefer-source # Forces installation from package sources when possible, including VCS information. + --prefer-dist # Forces installation from package dist (default behavior). + --prefer-install: words [dist: "Install from package dist" source: "Install from package source and include VSC information" auto: "Use source for dev versions and dist for the rest"] # Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest). + --fixed # Write fixed version to the composer.json. + --no-progress # Do not output download progress. + --no-update # Disables the automatic update of the dependencies (implies --no-install). + --no-install # Skip the install step after update the composer.lock file. + --no-audit # Skip the audit step after updating the composer.lock file (can also be set via the COMPOSER_NO_AUDIT=1 env var). + --audit-format: words [table plain json summary] # Audit output format. Must be "table", "plain", "json", or "summary". [default: "summary"] + --update-no-dev # Run the dependency update with the --no-dev option. + --update-with-dependencies(-w) # Allows inherited dependencies to be updated, except those that are root requirements. + --update-with-all-dependencies(-W) # Allows all inherited dependencies to be updated, including those that are root requirements. + --with-dependencies # Alias for --update-with-dependencies + --with-all-dependencies # Alias for --update-with-all-dependencies + --ignore-platform-req: text # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). + --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). + --prefer-stable # Prefer stable versions of dependencies (can also be set via the COMPOSER_PREFER_STABLE=1 env var) + --prefer-lowest # Prefer lowest versions of dependencies (can also be set via the COMPOSER_PREFER_LOWEST=1 env var) + --minimal-changes(-M) # During an update with -w/-W, only perform absolutely necessary changes to transitive dependencies (can also be set via the COMPOSER_MINIMAL_CHANGES=1 env var). + --sort-packages # Sorts packages when adding/updateing a new dependency. + --optimize-autoloader(-o) # Optimize autoloader during autoloader dump. + --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables --apcu-autoloader + --apcu-autoloader # Use APCu to cache found/not-found classes. + --apcu-autoloader-prefix: text # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader. + ...packages: text +] where { + at-most-one [--prefer-dist --prefer-source --prefer-install] + excludes --ignore-platform-req --ignore-platform-reqs } # [run] Runs the scripts defined in composer.json. -export extern "composer run-script" [ - --timeout: int # Sets script timeout in seconds, or 0 for never. - --dev # Sets the dev mode. - --list(-l) # List scripts. - script?: string@"nu-complete composer scripts" # Script name to run. - ...args: string +export complete [composer run-script] [ + --timeout: text # Sets script timeout in seconds, or 0 for never. + --dev # Sets the dev mode. + --list(-l) # List scripts. + script?: by "nu-complete composer scripts" # Script name to run. + ...args: text ] -def "nu-complete composer search-formats" [] { - ['text' 'json'] -} - # Searches for packages -export extern "composer search" [ - --only-name(-N) # Search only in package name - --only-vendor(-O) # Search only for vendor / organization names, returns only "vendor" as result. - --type(-t): string@"nu-complete composer project-types" # Search for a specific package type. - --format(-f): string@"nu-complete composer search-formats" # Format of the output: text or json. [default: "text"] - - ...tokens: string # Tokens to search for. +export complete [composer search] [ + --only-name(-N) # Search only in package name + --only-vendor(-O) # Search only for vendor / organization names, returns only "vendor" as result. + --type(-t): words [library project metapackage composer-plugin] # Search for a specific package type. + --format(-f): words [text json] # Format of the output: text or json. [default: "text"] + ...tokens: text # Tokens to search for. ] ## TODO: find a way to specify --1 --2 --2.2 flags for self-update command @@ -449,103 +407,94 @@ export extern "composer search" [ # --2.2 # Force an update to the stable channel, but only use 2.2.x LTS versions # [selfupdate] Updates composer.phar to the latest version. -export extern "composer self-update" [ - --rollback(-r) # Revert to an older installation of composer - --clean-backups # Delete old backups during an update. This makes the current version of compsoer the only backup available after the update. - --no-progress # Do not output download progress. - --update-keys # Prompt user for a key update. - --stable # Force an update to the stable channel. - --preview # Force an update to the preview channel. - --snapshot # Force an update to the snapshot channel. - --set-channel-only # Only store the channel as the default one and then exit. - - version?: string # The version to update to +export complete [composer self-update] [ + --rollback(-r) # Revert to an older installation of composer + --clean-backups # Delete old backups during an update. This makes the current version of compsoer the only backup available after the update. + --no-progress # Do not output download progress. + --update-keys # Prompt user for a key update. + --stable # Force an update to the stable channel. + --preview # Force an update to the preview channel. + --snapshot # Force an update to the snapshot channel. + --set-channel-only # Only store the channel as the default one and then exit. + version?: text # The version to update to ] # [info] Shows information about packages. -export extern "composer show" [ - --outdated(-o) # Show only packages that are outdated (this is the default, but present here for compat with `show`) - --all(-a) # Show all installed packages with their latest versions - --locked # Shows updates for packages from the lock file, regardless of what is currently in vendor dir - --direct(-D) # Shows only packages that are directly required by the root package - --strict # Return a non-zero exit code when there are outdated packages - --major-only(-M) # Show only packages that have major SemVer-compatible updates. - --minor-only(-m) # Show only packages that have minor SemVer-compatible updates. - --patch-only(-p) # Show only packages that have patch SemVer-compatible updates. - --sort-by-age(-A) # Displays the installed version's age, and sorts packages oldest first. - --format(-f): string@"nu-complete composer show-formats" # Format of the output: text or json [default: "text"] - --ignore: string # Ignore specified package(s). Can contain wildcards (*). Use it if you don't want to be informed about new versions of some packages. (multiple values allowed) - --no-dev # Disables search in require-dev packages. - - --ignore-platform-req: string # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). - --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). - - package?: string # Package to inspect. Or a name including a wildcard (*) to filter lists of packages instead. - version?: string # Version constraint, which version you expected to be installed. -] +export complete [composer show] [ + --outdated(-o) # Show only packages that are outdated (this is the default, but present here for compat with `show`) + --all(-a) # Show all installed packages with their latest versions + --locked # Shows updates for packages from the lock file, regardless of what is currently in vendor dir + --direct(-D) # Shows only packages that are directly required by the root package + --strict # Return a non-zero exit code when there are outdated packages + --major-only(-M) # Show only packages that have major SemVer-compatible updates. + --minor-only(-m) # Show only packages that have minor SemVer-compatible updates. + --patch-only(-p) # Show only packages that have patch SemVer-compatible updates. + --sort-by-age(-A) # Displays the installed version's age, and sorts packages oldest first. + --format(-f): words [text json] # Format of the output: text or json [default: "text"] + --ignore: by "nu-complete composer installed-packages" # Ignore specified package(s). Can contain wildcards (*). Use it if you don't want to be informed about new versions of some packages. (multiple values allowed) + --no-dev # Disables search in require-dev packages. + --ignore-platform-req: text # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). + --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). + package?: by "nu-complete composer installed-packages" # Package to inspect. Or a name including a wildcard (*) to filter lists of packages instead. + version?: text # Version constraint, which version you expected to be installed. +] where { + at-most-one [--major-only --minor-only --patch-only] + excludes --ignore-platform-req --ignore-platform-reqs +} # Shows a list of locally modified packages. -export extern "composer status" [] +export complete [composer status] [ +] # Shows package suggestions. -export extern "composer suggest" [ - --by-package # Groups output by suggesting package (default) - --by-suggestion # Groups output by suggested package - --all(-a) # Show suggestions from all dependencies, including transitive ones - --list # Show only list of suggested package names - --no-dev # Exclude suggestions from require-dev packages - - ...packages: string # Packages that you want to list suggestions from. +export complete [composer suggest] [ + --by-package # Groups output by suggesting package (default) + --by-suggestion # Groups output by suggested package + --all(-a) # Show suggestions from all dependencies, including transitive ones + --list # Show only list of suggested package names + --no-dev # Exclude suggestions from require-dev packages + ...packages: text # Packages that you want to list suggestions from. ] # [u|upgrade] Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file. -export extern "composer update" [ - --with: string # Temporary version constraint to add, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 (multiple values allowed) - - --prefer-source # Forces installation from package sources when possible, including VCS information. - --prefer-dist # Forces installation from package dist (default behavior). - --prefer-install: string@"nu-complete composer installation-modes" # Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest). - - --dry-run # Outputs the packages to bump, but will not execute anything. - --no-dev # Disables installation of require-dev packages - - --lock # Overwrites the lock file hash to suppress warning about the lock file being out of date without updating package versions. Package metadata like mirrors and URLs are updated if they changed. - - --no-audit # Skip the audit step after updating the composer.lock file (can also be set via the COMPOSER_NO_AUDIT=1 env var). - --audit-format: string@"nu-complete composer audit-formats" # Audit output format. Must be "table", "plain", "json", or "summary". [default: "summary"] - --update-no-dev # Run the dependency update with the --no-dev option. - --with-dependencies(-w) # Update also dependencies of packages in the argument list, except those which are root requirements. - --with-all-dependencies(-W) # Update also dependencies of packages in the argument list, including those which are root requirements. - - - --optimize-autoloader(-o) # Optimize autoloader during autoloader dump. - --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables --apcu-autoloader - --apcu-autoloader # Use APCu to cache found/not-found classes. - --apcu-autoloader-prefix: string # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader. - - --ignore-platform-req: string # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). - --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). - - --prefer-source # Forces installation from package sources when possible, including VCS information. - --prefer-dist # Forces installation from package dist (default behavior). - --prefer-install: string@"nu-complete composer installation-modes" # Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest). - - --minimal-changes(-M) # During an update with -w/-W, only perform absolutely necessary changes to transitive dependencies (can also be set via the COMPOSER_MINIMAL_CHANGES=1 env var). - - --interactive(-i) # Interactive interface with autocompletion to select the packages to update. - --root-reqs # Restricts the update to your first degree dependencies. - - ...packages: string@"nu-complete composer installed-packages" -] +export complete [composer update] [ + --with: text # Temporary version constraint to add, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 (multiple values allowed) + --prefer-source # Forces installation from package sources when possible, including VCS information. + --prefer-dist # Forces installation from package dist (default behavior). + --prefer-install: words [dist: "Install from package dist" source: "Install from package source and include VSC information" auto: "Use source for dev versions and dist for the rest"] # Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest). + --dry-run # Outputs the packages to bump, but will not execute anything. + --no-dev # Disables installation of require-dev packages + --lock # Overwrites the lock file hash to suppress warning about the lock file being out of date without updating package versions. Package metadata like mirrors and URLs are updated if they changed. + --no-audit # Skip the audit step after updating the composer.lock file (can also be set via the COMPOSER_NO_AUDIT=1 env var). + --audit-format: words [table plain json summary] # Audit output format. Must be "table", "plain", "json", or "summary". [default: "summary"] + --update-no-dev # Run the dependency update with the --no-dev option. + --with-dependencies(-w) # Update also dependencies of packages in the argument list, except those which are root requirements. + --with-all-dependencies(-W) # Update also dependencies of packages in the argument list, including those which are root requirements. + --optimize-autoloader(-o) # Optimize autoloader during autoloader dump. + --classmap-authoritative(-a) # Autoload classes from the classmap only. Implicitly enables --apcu-autoloader + --apcu-autoloader # Use APCu to cache found/not-found classes. + --apcu-autoloader-prefix: text # Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader. + --ignore-platform-req: text # Ignore a specific platform requirements (php & ext- packages). (multiple values allowed). + --ignore-platform-reqs # Ignore all platform requirements (php & ext- packages). + --minimal-changes(-M) # During an update with -w/-W, only perform absolutely necessary changes to transitive dependencies (can also be set via the COMPOSER_MINIMAL_CHANGES=1 env var). + --interactive(-i) # Interactive interface with autocompletion to select the packages to update. + --root-reqs # Restricts the update to your first degree dependencies. + ...packages: by "nu-complete composer installed-packages" +] where { + at-most-one [--prefer-dist --prefer-source --prefer-install] + excludes --ignore-platform-req --ignore-platform-reqs +} # Validates a composer.json and composer.lock. -export extern "composer validate" [ - --no-check-all # Do not validate requires for overly strict/loose constraints. - --check-lock # Check if lock file is up to date (even when config.lock is false). - --no-check-lock # Do not check if lock file is up to date. - --no-check-publish # Do not check for publish errors. - --no-check-version # Do not report a warning if the version field is present. - --with-dependencies(-A) # Also validate the composer.json of all installed dependencies. - --strict # Return a non-zero exit code for warnings as well as errors. - file?: string = "composer.json" -] +export complete [composer validate] [ + --no-check-all # Do not validate requires for overly strict/loose constraints. + --check-lock # Check if lock file is up to date (even when config.lock is false). + --no-check-lock # Do not check if lock file is up to date. + --no-check-publish # Do not check for publish errors. + --no-check-version # Do not report a warning if the version field is present. + --with-dependencies(-A) # Also validate the composer.json of all installed dependencies. + --strict # Return a non-zero exit code for warnings as well as errors. + file?: text +] where { + excludes --check-lock --no-check-lock +} diff --git a/custom-completions/croc/croc-completions.nu b/custom-completions/croc/croc-completions.nu index e46d5444b..e1a3b8ef2 100644 --- a/custom-completions/croc/croc-completions.nu +++ b/custom-completions/croc/croc-completions.nu @@ -1,67 +1,73 @@ -# author: David Telenko +# Declarative completions for croc, a tool to send files between computers. -def "nu-complete croc curve" [] { - [p521, p256, p384, siec] +# Global options come before the subcommand; a bare code receives a transfer. +export complete [croc] [ + code?: text # Code to receive with, in place of a subcommand + --internal-dns # Use a built-in DNS stub resolver + --remember # Save these settings for next time + --debug # Toggle debug mode + --yes # Agree to all prompts automatically + --stdout # Redirect the received file to stdout + --no-compress # Disable compression + --ask # Prompt both sender and recipient + --local # Use only local connections + --ignore-stdin # Ignore piped stdin + --overwrite # Overwrite without prompting + --testing # Flag for testing purposes + --quiet # Disable all output + --classic # Toggle the classic (insecure) mode + --multicast: text # Multicast address for local discovery + --curve: words [p521 p256 p384 siec] # Encryption curve (default p256) + --ip: text # Sender IP if known, e.g. 10.0.0.1:9009 + --relay: hosts # Relay address (env CROC_RELAY) + --relay6: hosts # IPv6 relay address (env CROC_RELAY6) + --out: dir # Folder to receive files into (default .) + --pass: text # Relay password (env CROC_PASS) + --socks5: text # SOCKS5 proxy (env SOCKS5_PROXY) + --connect: text # HTTP proxy (env HTTP_PROXY) + --throttleUpload: text # Throttle the upload speed, e.g. 500k + --help(-h) # Show help + --version(-v) # Print the version +] where { + terminal [--help --version] } -def "nu-complete croc subcommands" [] { - [send, relay, help] +# Send files, folders or text. +export complete [croc send] [ + --zip # Zip a folder before sending + --code(-c): text # Code phrase used to connect to the relay + --hash: words [xxhash imohash md5] # Hash algorithm (default xxhash) + --text(-t): text # Send some text instead of files + --no-local # Disable the local relay + --no-multi # Disable multiplexing + --git # Respect .gitignore and skip ignored files + --exclude: text # Comma-separated names to exclude + --qrcode # Show the receive code as a QR code + --qr # Alias of --qrcode + --port: text # Base port for the relay (default 9009) + --transfers: text # Number of transfer ports (default 4) + --help(-h) # Show help + ...files: path # Files or folders to send +] where { + excludes --text --zip + terminal [--help] } -def "nu-complete croc hash" [] { - [xxhash, imohash, md5] +# Start your own relay. +export complete [croc relay] [ + --host: text # Host of the relay + --ports: text # Relay ports (default 9009,9010,9011,9012,9013) + --help(-h) # Show help +] where { + terminal [--help] } -export extern "croc" [ - --internal-dns # Use a built-in DNS stub resolver rather than the host operating system (default: false) - --remember # Save these settings to reuse next time (default: false) - --debug # Toggle debug mode (default: false) - --yes # Automatically agree to all prompts (default: false) - --stdout # Redirect file to stdout (default: false) - --no-compress # Disable compression (default: false) - --ask # Make sure sender and recipient are prompted (default: false) - --local # Force to use only local connections (default: false) - --ignore-stdin # Ignore piped stdin (default: false) - --overwrite # Do not prompt to overwrite (default: false) - --testing # Flag for testing purposes (default: false) - --curve: string@"nu-complete croc curve" # choose an encryption curve (p521, p256, p384, siec) (default: "p256") - --ip: string # Set sender ip if known e.g. 10.0.0.1:9009, [::1]:9009 - --relay: string # Address of the relay (default: "5.78.91.237:9009") [%CROC_RELAY%] - --relay6: string # Ipv6 address of the relay [%CROC_RELAY6%] - --out: path # Specify an output folder to receive the file (default: ".") - --pass: string # Password for the relay (default: "pass123") [%CROC_PASS%] - --socks5: string # Add a socks5 proxy [%SOCKS5_PROXY%] - --connect: string # Add a http proxy [%HTTP_PROXY%] - --throttleUpload: string # throttle the upload speed e.g. 500k - --help(-h) # Show help (default: false) - --version(-v) # Print the version (default: false) +# Show the commands, or the help of one command. +export complete [croc help] [ + command?: words [send relay help] # Command to describe ] -# Send file(s), or folder (see options with croc send -h) -export extern "croc send" [ - --zip # Zip folder before sending (default: false) - --code(-c): string # Codephrase used to connect to relay - --hash:string@"nu-complete croc hash" # Hash algorithm (xxhash, imohash, md5) (default: "xxhash") - --text(-t): string # Send some text - --no-local # Disable local relay when sending (default: false) - --no-multi # Disable multiplexing (default: false) - --git # Enable .gitignore respect / don't send ignored files (default: false) - --port: int # Base port for the relay (default: 9009) - --transfers: int # Number of ports to use for transfers (default: 4) -] - -# Start your own relay (optional) -export extern "croc relay" [ - --host: string # host of the relay - --ports: string # ports of the relay (default: "9009,9010,9011,9012,9013") -] - -# Shows a list of commands or help for one command -export extern "croc help" [ - subcommand?: string@"nu-complete croc subcommands" -] - -# Shows a list of commands or help for one command -export extern "croc h" [ - subcommand?: string@"nu-complete croc subcommands" +# Alias of `croc help`. +export complete [croc h] [ + command?: words [send relay help] # Command to describe ] diff --git a/custom-completions/curl/curl-completions.nu b/custom-completions/curl/curl-completions.nu index 46131b91c..a274a70b6 100644 --- a/custom-completions/curl/curl-completions.nu +++ b/custom-completions/curl/curl-completions.nu @@ -1,460 +1,297 @@ -# (HTTP) Connect through an abstract Unix domain socket -extern "curl" [ - --abstract-unix-socket # (HTTP) Connect through an abstract Unix domain socket - --anyauth # (HTTP) Use most secure authentication method automatically - --append(-a) # (FTP SFTP) Upload: append to the target file - --basic # (HTTP) Use HTTP Basic authentication - --cacert # (TLS) Use the specified certificate file - --capath # (TLS) Use the specified certificate directory - --cert-status # (TLS) Use Certificate Status Request (aka OCSP stapling) - --cert-type # (TLS) Set type of the provided client certificate - --cert(-E) # (TLS) Use this cert - --ciphers # (TLS) Specifies which ciphers to use - --compressed-ssh # (SCP SFTP) Enables built-in SSH compression - --compressed # (HTTP) Request a compressed response - --config(-K) # Specify a text file to read curl arguments from - --connect-timeout # Maximum time in seconds you allow connection to take - --connect-to # For a request to the given HOST1:PORT1 pair, connect to HOST2:PORT2 instead - --continue-at(-C) # Continue/Resume a previous file transfer at the given offset - --cookie-jar(-c) # (HTTP) Write all cookies to this file - --cookie(-b) # (HTTP) Pass the data to the HTTP server in the Cookie header - --create-dirs # Create dirs for -o/--output - --crlf # (FTP SMTP) Convert LF to CRLF in upload. Useful for MVS (OS/390) - --crlfile # (TLS) Provide a file using PEM format with a Certificate Revocation List - --data-ascii # (HTTP) Alias for -d, --data - --data-binary # (HTTP) Post data exactly as specified with no processing - --data-raw # (HTTP) Post data like --data but without interpreting "@ - --data-urlencode # (HTTP) Post data URL-encoded - --data(-d) # (HTTP) Sends the specified data in a POST request to the HTTP server - --delegation # (GSS/kerberos) Tell the server how much it can delegate for user creds - --digest # (HTTP) Enables HTTP Digest authentication - --disable-eprt # (FTP) Dont use EPRT and LPRT commands in active FTP - --disable-epsv # (FTP) Dont use EPSV in passive FTP - --disable(-q) # Disable curlrc - --disallow-username-in-url # (HTTP) Exit if passed a url containing a username - --dns-interface # (DNS) Send outgoing DNS requests through - --dns-ipv4-addr # (DNS) Bind to when making IPv4 DNS requests - --dns-ipv6-addr # (DNS) Bind to when making IPv6 DNS requests - --dns-servers # Set the list of DNS servers to use - --doh-url # (all) Specify which DNS-over-HTTPS (DOH) server to use to resolve hostnames - --dump-header(-D) # (HTTP FTP) Write the received protocol headers to the specified file - --egd-file # (TLS) Specify the path name to the Entropy Gathering Daemon socket - --engine # (TLS) Select the OpenSSL crypto engine to use for cipher operations - --expect100-timeout # (HTTP) Maximum time in seconds to wait for a 100-continue - --fail-early # Fail and exit on the first detected transfer error - --fail(-f) # (HTTP) Fail silently (no output at all) on server errors - --false-start # (TLS) Use false start during the TLS handshake - --form-string # (HTTP SMTP IMAP) Like --form except using value string literally - --form(-F) # (HTTP SMTP IMAP) Emulate pressing submit on filled-in form - --ftp-account # (FTP) Data for the ACCT command - --ftp-alternative-to-user # (FTP) If USER and PASS commands fail, send this command - --ftp-create-dirs # (FTP SFTP) Create missing dirs with ftp - --ftp-method # (FTP) Control what method curl should use to reach a file on an FTP(S) server - --ftp-pasv # (FTP) Use passive mode for the data connection - --ftp-port(-P) # (FTP) Reverses the default initiator/listener roles when connecting with FTP - --ftp-pret # (FTP) Tell curl to send a PRET command before PASV (and EPSV) - --ftp-skip-pasv-ip # (FTP) Use same IP instead of IP the server suggests in response to PASV - --ftp-ssl-ccc-mode # (FTP) Sets the CCC mode - --ftp-ssl-ccc # (FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after auth - --ftp-ssl-control # (FTP) Require SSL/TLS for the FTP login, clear for transfer - --get(-G) # Use GET instead of POST - --globoff(-g) # This option switches off the "URL globbing parser - --happy-eyeballs-timeout-ms # Attempt to connect to both IPv4 and IPv6 in parallel - --haproxy-protocol # (HTTP) Use HAProxy PROXY protocol - --head(-I) # (HTTP FTP FILE) Fetch the headers only - --header(-H) # (HTTP) Extra header to include in the request when sending HTTP to a server - --help(-h) # Usage help - --hostpubmd5 # (SFTP SCP) Pass a string containing 32 hexadecimal digits - # these commands break the nu's parser - #--http0.9 # (HTTP) Accept HTTP version 0.9 response - #--http1.0(-0) # (HTTP) Use HTTP version 1 - #--http1.1 # (HTTP) Use HTTP version 1.1 - --http2-prior-knowledge # (HTTP) Use HTTP/2 immediately (without trying HTTP1) - --http2 # (HTTP) Use HTTP version 2 - --ignore-content-length # (FTP HTTP) Ignore the Content-Length header - --include(-i) # Include the HTTP response headers in the output - --insecure(-k) # (TLS) Allow insecure connections - --interface # Perform an operation using a specified interface - --ipv4(-4) # Use IPv4 only - --ipv6(-6) # Use IPv6 only - --junk-session-cookies(-j) # (HTTP) Discard all session cookies - --keepalive-time # Specify idle time before keepalive is sent - --key-type # (TLS) Private key file type - --key # (TLS SSH) Private key file name - --krb # (FTP) Enable Kerberos authentication and use - --libcurl # Write C-code equivalent to the invocation to the given file - --limit-rate # Limit bandwidth (Examples: 200K, 3m and 1G) - --list-only(-l) # (FTP POP3) (FTP) Use name-only view when listing - --local-port # Set a preferred single number or range (FROM-TO) of local ports to use - --location-trusted # (HTTP) Like -L, --location, but allow sending the name + password - --location(-L) # (HTTP) Follow redirects - --login-options # (IMAP POP3 SMTP) Specify the login options - --mail-auth # (SMTP) Specify a single address - --mail-from # (SMTP) Specify a single address that the given mail should get sent from - --mail-rcpt # (SMTP) Specify a single address, user name or mailing list name - --manual(-M) # Manual. Display the huge help text - --max-filesize # Specify the maximum size (in bytes) of a file to download - --max-redirs # (HTTP) Set maximum number of redirection-followings allowed - --max-time(-m) # Maximum time in seconds that you allow the whole operation to take - --metalink # Process URI as Metalink file - --negotiate # (HTTP) Enables Negotiate (SPNEGO) authentication - --netrc-file # Use this netrc file - --netrc-optional # Make netrc optional - --netrc(-n) # Use ~/.netrc - --next # Use a separate operation for the following URL - --no-alpn # (HTTPS) Disable the ALPN TLS extension - --no-buffer(-N) # Disable the buffering of the output stream - --no-keepalive # Disable use of keepalive messages on the TCP connection - --no-npn # (HTTPS) Disable NPN TLS extension - --no-sessionid # (TLS) Disable use of SSL session-ID caching - --noproxy # Comma-separated list of hosts which do not use a proxy - --ntlm-wb # (HTTP) Enable NTLM, but hand over auth to separate ntlmauth binary - --ntlm # (HTTP) Enable NTLM authentication - --oauth2-bearer # (IMAP POP3 SMTP) Specify the Bearer Token for OAUTH 2 - --output(-o) # Write output to instead of stdout - --pass # (SSH TLS) Passphrase for the private key - --path-as-is # Do not handle sequences of /../ or /./ in the given URL path - --pinnedpubkey # (TLS) Use the specified public key file (or hashes) - --post301 # (HTTP) Respect RFC 7231/6.4 - --post302 # (HTTP) Respect RFC 7231/6.4 - --post303 # (HTTP) Violate RFC 7231/6.4 - --preproxy # Use the specified SOCKS proxy before connecting to HTTP(S) proxy - --progress-bar # Display progress as a simple progress bar - # --progress-bar(-#) # (this short flag breaks nu parser) Display progress as a simple progress bar - --proto-default # Use this protocol for any URL missing a scheme name - --proto-redir # Limit what protocols it may use on redirect - --proto # Limit what protocols it may use in the transfer - --proxy-anyauth # Like --anyauth but for the proxy - --proxy-basic # Use HTTP Basic authentication to communicate with proxy - --proxy-cacert # Same as --cacert but used in HTTPS proxy context - --proxy-capath # Same as --capath but used in HTTPS proxy context - --proxy-cert-type # Same as --cert-type but used in HTTPS proxy context - --proxy-cert # Same as -E, --cert but used in HTTPS proxy context - --proxy-ciphers # Same as --ciphers but used in HTTPS proxy context - --proxy-crlfile # Same as --crlfile but used in HTTPS proxy context - --proxy-digest # Use HTTP Digest authentication to communicate with proxy - --proxy-header # (HTTP) Extra header to include in the request when sending HTTP to a proxy - --proxy-insecure # Same as -k, --insecure but used in HTTPS proxy context - --proxy-key-type # Same as --key-type but used in HTTPS proxy context - --proxy-key # Same as --key but used in HTTPS proxy context - --proxy-negotiate # Use HTTP Negotiate authentication to communicate with proxy - --proxy-ntlm # Use HTTP NTLM authentication when to communicate with proxy - --proxy-pass # Same as --pass but used in HTTPS proxy context - --proxy-pinnedpubkey # (TLS) Use specified public key file or hashes to verify proxy - --proxy-service-name # This option allows you to change the service name for proxy negotiation - --proxy-ssl-allow-beast # Same as --ssl-allow-beast but used in HTTPS proxy context - --proxy-tls13-ciphers # (TLS) Specify cipher suites for TLS 1.3 proxy connection - --proxy-tlsauthtype # Same as --tlsauthtype but used in HTTPS proxy context - --proxy-tlspassword # Same as --tlspassword but used in HTTPS proxy context - --proxy-tlsuser # Same as --tlsuser but used in HTTPS proxy context - --proxy-tlsv1 # Same as -1, --tlsv1 but used in HTTPS proxy context - --proxy-user(-U) # Specify the user name and password to use for proxy authentication - --proxy(-x) # Use the specified proxy - # --proxy1.0 # This breaks nu parser. Use the specified HTTP 1.0 proxy - --proxytunnel(-p) # If HTTP proxy is used, make curl tunnel through it - --pubkey # (SFTP SCP) Public key file name - --quote(-Q) # (FTP SFTP) Send an arbitrary command to the remote FTP or SFTP server - --random-file # Specify file containing random data - --range(-r) # (HTTP FTP SFTP FILE) Retrieve a byte range - --raw # (HTTP) Pass raw data (no HTTP decoding or transfer encoding) - --referer(-e) # (HTTP) Sends the "Referrer Page" information to the HTTP server - --remote-header-name(-J) # (HTTP) Save output to filename from Content-Disposition - --remote-name-all # For every URL write output to local file by default - --remote-name(-O) # Write output to a local file named like the remote file we get - --remote-time(-R) # Use timestamp of remote file on output - --request-target # (HTTP) Use an alternative request target - --request(-X) # (HTTP) Specifies a custom HTTP method - --resolve # Provide a custom address for a specific host and port pair - --retry-connrefused # Consider ECONNREFUSED a transient error - --retry-delay # Time to wait between transfer retries - --retry-max-time # The retry timer is reset before the first transfer attempt - --retry # Number of retries when transient error occurs - --sasl-ir # Enable initial response in SASL authentication - --service-name # This option allows you to change the service name for SPNEGO - --show-error(-S) # When used with -s, --silent, it makes curl show an error message if it fails - --silent(-s) # Silent or quiet mode. Dont show progress meter or error messages - --socks4 # Use the specified SOCKS4 proxy - --socks4a # Use the specified SOCKS4a proxy - --socks5-basic # Use username/password authentication to connect to SOCKS5 proxy - --socks5-gssapi-nec # As part of the GSS-API negotiation a protection mode is negotiated - --socks5-gssapi-service # The default service name for a socks server is rcmd/server-fqdn - --socks5-gssapi # Tells curl to use GSS-API authentication when connecting to a SOCKS5 proxy - --socks5-hostname # Use the specified SOCKS5 proxy (and let the proxy resolve the host name) - --socks5 # Use the specified SOCKS5 proxy - but resolve the host name locally - --speed-limit(-Y) # Abort download if its slower than given speed (Bps) for speed-time - --speed-time(-y) # Abort download if its slower than speed for given speed-time (s) - --ssl-allow-beast # Dont work around BEAST security flaw in SSL3 and TLS1.0 - --ssl-no-revoke # (Schannel) This option tells curl to disable certificate revocation checks - --ssl-reqd # (FTP IMAP POP3 SMTP) Require SSL/TLS for the connection - --ssl # (FTP IMAP POP3 SMTP) Try to use SSL/TLS for the connection - --sslv2(-2) # (SSL) Use SSL version 2 - --sslv3(-3) # (SSL) Use SSL version 3 - --stderr # Redirect all writes to stderr to the specified file instead - --styled-output # Use bold font styles when writing HTTP headers to terminal - --suppress-connect-headers # Dont print response headers for CONNECT request if -p is set - --tcp-fastopen # Enable use of TCP Fast Open - --tcp-nodelay # Turn on the TCP_NODELAY option - --telnet-option(-t) # Pass options to the telnet protocol - --tftp-blksize # (TFTP) Set TFTP BLKSIZE option (must be >512) - --tftp-no-options # (TFTP) Tells curl not to send TFTP options requests - --time-cond(-z) # (HTTP FTP) Request file modified before or later than given time - --tls-max # (SSL) VERSION defines maximum supported TLS version - --tls13-ciphers # (TLS) Specifies cipher suites to use for TLS 1.3 - --tlsauthtype # Set TLS authentication type - --tlspassword # Set password for use with the TLS authentication method - --tlsuser # Set username for use with the TLS authentication method - # these commands break the nu's parser - #--tlsv1.0 # (TLS) Forces curl to use TLS version 1.0 - #--tlsv1.1 # (TLS) Forces curl to use TLS version 1.1 - #--tlsv1.2 # (TLS) Forces curl to use TLS version 1.2 - #--tlsv1.3 # (TLS) Forces curl to use TLS version 1.3 - --tlsv1 # (SSL) Tells curl to use at least TLS version 1 - --tr-encoding # (HTTP) Request compressed Transfer-Encoding, uncompress on receive - --trace-ascii # Enables a full trace dump of all incoming and outgoing data - --trace-time # Prepends a time stamp to each trace or verbose line that curl displays - --trace # Enables a full trace dump of all incoming and outgoing data - --unix-socket # (HTTP) Connect through this Unix domain socket, instead of using the network - --upload-file(-T) # This transfers the specified local file to the remote URL - --url # Specify a URL to fetch - --use-ascii(-B) # (FTP LDAP) Enable ASCII transfer - --user-agent(-A) # (HTTP) Specify the User-Agent string to send to the HTTP server - --user(-u) # Specify the user name and password to use for server authentication - --verbose(-v) # Makes curl verbose during the operation - --version(-V) # Displays information about curl and the libcurl version it uses - --write-out(-w) # Make curl display information on stdout after a completed transfer - --no-eprt # for --disable-eprt - --no-epsv # for --disable-epsv - --max-redir # Set maximum number of redirects - --xattr # Store metadata in xattrs (like origin URL) - ...args -] +# nu-version: 0.116.2 +# Declarative completions for curl 8.x, generated from `curl --help all` and tuned by hand. +# Load with `use curl-completions.nu *`. -# (TLS) Set type of the provided client certificate -extern "curl PEM, DER ENG P12" [ - --abstract-unix-socket # (HTTP) Connect through an abstract Unix domain socket - --anyauth # (HTTP) Use most secure authentication method automatically - --append(-a) # (FTP SFTP) Upload: append to the target file - --basic # (HTTP) Use HTTP Basic authentication - --cacert # (TLS) Use the specified certificate file - --capath # (TLS) Use the specified certificate directory - --cert-status # (TLS) Use Certificate Status Request (aka OCSP stapling) - --cert-type # (TLS) Set type of the provided client certificate - --cert(-E) # (TLS) Use this cert - --ciphers # (TLS) Specifies which ciphers to use - --compressed-ssh # (SCP SFTP) Enables built-in SSH compression - --compressed # (HTTP) Request a compressed response - --config(-K) # Specify a text file to read curl arguments from - --connect-timeout # Maximum time in seconds you allow connection to take - --connect-to # For a request to the given HOST1:PORT1 pair, connect to HOST2:PORT2 instead - --continue-at(-C) # Continue/Resume a previous file transfer at the given offset - --cookie-jar(-c) # (HTTP) Write all cookies to this file - --cookie(-b) # (HTTP) Pass the data to the HTTP server in the Cookie header - --create-dirs # Create dirs for -o/--output - --crlf # (FTP SMTP) Convert LF to CRLF in upload. Useful for MVS (OS/390) - --crlfile # (TLS) Provide a file using PEM format with a Certificate Revocation List - --data-ascii # (HTTP) Alias for -d, --data - --data-binary # (HTTP) Post data exactly as specified with no processing - --data-raw # (HTTP) Post data like --data but without interpreting "@ - --data-urlencode # (HTTP) Post data URL-encoded - --data(-d) # (HTTP) Sends the specified data in a POST request to the HTTP server - --delegation # (GSS/kerberos) Tell the server how much it can delegate for user creds - --digest # (HTTP) Enables HTTP Digest authentication - --disable-eprt # (FTP) Dont use EPRT and LPRT commands in active FTP - --disable-epsv # (FTP) Dont use EPSV in passive FTP - --disable(-q) # Disable curlrc - --disallow-username-in-url # (HTTP) Exit if passed a url containing a username - --dns-interface # (DNS) Send outgoing DNS requests through - --dns-ipv4-addr # (DNS) Bind to when making IPv4 DNS requests - --dns-ipv6-addr # (DNS) Bind to when making IPv6 DNS requests - --dns-servers # Set the list of DNS servers to use - --doh-url # (all) Specify which DNS-over-HTTPS (DOH) server to use to resolve hostnames - --dump-header(-D) # (HTTP FTP) Write the received protocol headers to the specified file - --egd-file # (TLS) Specify the path name to the Entropy Gathering Daemon socket - --engine # (TLS) Select the OpenSSL crypto engine to use for cipher operations - --expect100-timeout # (HTTP) Maximum time in seconds to wait for a 100-continue - --fail-early # Fail and exit on the first detected transfer error - --fail(-f) # (HTTP) Fail silently (no output at all) on server errors - --false-start # (TLS) Use false start during the TLS handshake - --form-string # (HTTP SMTP IMAP) Like --form except using value string literally - --form(-F) # (HTTP SMTP IMAP) Emulate pressing submit on filled-in form - --ftp-account # (FTP) Data for the ACCT command - --ftp-alternative-to-user # (FTP) If USER and PASS commands fail, send this command - --ftp-create-dirs # (FTP SFTP) Create missing dirs with ftp - --ftp-method # (FTP) Control what method curl should use to reach a file on an FTP(S) server - --ftp-pasv # (FTP) Use passive mode for the data connection - --ftp-port(-P) # (FTP) Reverses the default initiator/listener roles when connecting with FTP - --ftp-pret # (FTP) Tell curl to send a PRET command before PASV (and EPSV) - --ftp-skip-pasv-ip # (FTP) Use same IP instead of IP the server suggests in response to PASV - --ftp-ssl-ccc-mode # (FTP) Sets the CCC mode - --ftp-ssl-ccc # (FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after auth - --ftp-ssl-control # (FTP) Require SSL/TLS for the FTP login, clear for transfer - --get(-G) # Use GET instead of POST - --globoff(-g) # This option switches off the "URL globbing parser - --happy-eyeballs-timeout-ms # Attempt to connect to both IPv4 and IPv6 in parallel - --haproxy-protocol # (HTTP) Use HAProxy PROXY protocol - --head(-I) # (HTTP FTP FILE) Fetch the headers only - --header(-H) # (HTTP) Extra header to include in the request when sending HTTP to a server - --help(-h) # Usage help - --hostpubmd5 # (SFTP SCP) Pass a string containing 32 hexadecimal digits - # these commands break the nu's parser - #--http0.9 # (HTTP) Accept HTTP version 0.9 response - #--http1.0(-0) # (HTTP) Use HTTP version 1 - #--http1.1 # (HTTP) Use HTTP version 1.1 - --http2-prior-knowledge # (HTTP) Use HTTP/2 immediately (without trying HTTP1) - --http2 # (HTTP) Use HTTP version 2 - --ignore-content-length # (FTP HTTP) Ignore the Content-Length header - --include(-i) # Include the HTTP response headers in the output - --insecure(-k) # (TLS) Allow insecure connections - --interface # Perform an operation using a specified interface - --ipv4(-4) # Use IPv4 only - --ipv6(-6) # Use IPv6 only - --junk-session-cookies(-j) # (HTTP) Discard all session cookies - --keepalive-time # Specify idle time before keepalive is sent - --key-type # (TLS) Private key file type - --key # (TLS SSH) Private key file name - --krb # (FTP) Enable Kerberos authentication and use - --libcurl # Write C-code equivalent to the invocation to the given file - --limit-rate # Limit bandwidth (Examples: 200K, 3m and 1G) - --list-only(-l) # (FTP POP3) (FTP) Use name-only view when listing - --local-port # Set a preferred single number or range (FROM-TO) of local ports to use - --location-trusted # (HTTP) Like -L, --location, but allow sending the name + password - --location(-L) # (HTTP) Follow redirects - --login-options # (IMAP POP3 SMTP) Specify the login options - --mail-auth # (SMTP) Specify a single address - --mail-from # (SMTP) Specify a single address that the given mail should get sent from - --mail-rcpt # (SMTP) Specify a single address, user name or mailing list name - --manual(-M) # Manual. Display the huge help text - --max-filesize # Specify the maximum size (in bytes) of a file to download - --max-redirs # (HTTP) Set maximum number of redirection-followings allowed - --max-time(-m) # Maximum time in seconds that you allow the whole operation to take - --metalink # Process URI as Metalink file - --negotiate # (HTTP) Enables Negotiate (SPNEGO) authentication - --netrc-file # Use this netrc file - --netrc-optional # Make netrc optional - --netrc(-n) # Use ~/.netrc - --next # Use a separate operation for the following URL - --no-alpn # (HTTPS) Disable the ALPN TLS extension - --no-buffer(-N) # Disable the buffering of the output stream - --no-keepalive # Disable use of keepalive messages on the TCP connection - --no-npn # (HTTPS) Disable NPN TLS extension - --no-sessionid # (TLS) Disable use of SSL session-ID caching - --noproxy # Comma-separated list of hosts which do not use a proxy - --ntlm-wb # (HTTP) Enable NTLM, but hand over auth to separate ntlmauth binary - --ntlm # (HTTP) Enable NTLM authentication - --oauth2-bearer # (IMAP POP3 SMTP) Specify the Bearer Token for OAUTH 2 - --output(-o) # Write output to instead of stdout - --pass # (SSH TLS) Passphrase for the private key - --path-as-is # Do not handle sequences of /../ or /./ in the given URL path - --pinnedpubkey # (TLS) Use the specified public key file (or hashes) - --post301 # (HTTP) Respect RFC 7231/6.4 - --post302 # (HTTP) Respect RFC 7231/6.4 - --post303 # (HTTP) Violate RFC 7231/6.4 - --preproxy # Use the specified SOCKS proxy before connecting to HTTP(S) proxy - --progress-bar # Display progress as a simple progress bar - # --progress-bar(-#) # (this short flag breaks nu parser) Display progress as a simple progress bar - --proto-default # Use this protocol for any URL missing a scheme name - --proto-redir # Limit what protocols it may use on redirect - --proto # Limit what protocols it may use in the transfer - --proxy-anyauth # Like --anyauth but for the proxy - --proxy-basic # Use HTTP Basic authentication to communicate with proxy - --proxy-cacert # Same as --cacert but used in HTTPS proxy context - --proxy-capath # Same as --capath but used in HTTPS proxy context - --proxy-cert-type # Same as --cert-type but used in HTTPS proxy context - --proxy-cert # Same as -E, --cert but used in HTTPS proxy context - --proxy-ciphers # Same as --ciphers but used in HTTPS proxy context - --proxy-crlfile # Same as --crlfile but used in HTTPS proxy context - --proxy-digest # Use HTTP Digest authentication to communicate with proxy - --proxy-header # (HTTP) Extra header to include in the request when sending HTTP to a proxy - --proxy-insecure # Same as -k, --insecure but used in HTTPS proxy context - --proxy-key-type # Same as --key-type but used in HTTPS proxy context - --proxy-key # Same as --key but used in HTTPS proxy context - --proxy-negotiate # Use HTTP Negotiate authentication to communicate with proxy - --proxy-ntlm # Use HTTP NTLM authentication when to communicate with proxy - --proxy-pass # Same as --pass but used in HTTPS proxy context - --proxy-pinnedpubkey # (TLS) Use specified public key file or hashes to verify proxy - --proxy-service-name # This option allows you to change the service name for proxy negotiation - --proxy-ssl-allow-beast # Same as --ssl-allow-beast but used in HTTPS proxy context - --proxy-tls13-ciphers # (TLS) Specify cipher suites for TLS 1.3 proxy connection - --proxy-tlsauthtype # Same as --tlsauthtype but used in HTTPS proxy context - --proxy-tlspassword # Same as --tlspassword but used in HTTPS proxy context - --proxy-tlsuser # Same as --tlsuser but used in HTTPS proxy context - --proxy-tlsv1 # Same as -1, --tlsv1 but used in HTTPS proxy context - --proxy-user(-U) # Specify the user name and password to use for proxy authentication - --proxy(-x) # Use the specified proxy - #--proxy1.0 # Use the specified HTTP 1.0 proxy - --proxytunnel(-p) # If HTTP proxy is used, make curl tunnel through it - --pubkey # (SFTP SCP) Public key file name - --quote(-Q) # (FTP SFTP) Send an arbitrary command to the remote FTP or SFTP server - --random-file # Specify file containing random data - --range(-r) # (HTTP FTP SFTP FILE) Retrieve a byte range - --raw # (HTTP) Pass raw data (no HTTP decoding or transfer encoding) - --referer(-e) # (HTTP) Sends the "Referrer Page" information to the HTTP server - --remote-header-name(-J) # (HTTP) Save output to filename from Content-Disposition - --remote-name-all # For every URL write output to local file by default - --remote-name(-O) # Write output to a local file named like the remote file we get - --remote-time(-R) # Use timestamp of remote file on output - --request-target # (HTTP) Use an alternative request target - --request(-X) # (HTTP) Specifies a custom HTTP method - --resolve # Provide a custom address for a specific host and port pair - --retry-connrefused # Consider ECONNREFUSED a transient error - --retry-delay # Time to wait between transfer retries - --retry-max-time # The retry timer is reset before the first transfer attempt - --retry # Number of retries when transient error occurs - --sasl-ir # Enable initial response in SASL authentication - --service-name # This option allows you to change the service name for SPNEGO - --show-error(-S) # When used with -s, --silent, it makes curl show an error message if it fails - --silent(-s) # Silent or quiet mode. Dont show progress meter or error messages - --socks4 # Use the specified SOCKS4 proxy - --socks4a # Use the specified SOCKS4a proxy - --socks5-basic # Use username/password authentication to connect to SOCKS5 proxy - --socks5-gssapi-nec # As part of the GSS-API negotiation a protection mode is negotiated - --socks5-gssapi-service # The default service name for a socks server is rcmd/server-fqdn - --socks5-gssapi # Tells curl to use GSS-API authentication when connecting to a SOCKS5 proxy - --socks5-hostname # Use the specified SOCKS5 proxy (and let the proxy resolve the host name) - --socks5 # Use the specified SOCKS5 proxy - but resolve the host name locally - --speed-limit(-Y) # Abort download if its slower than given speed (Bps) for speed-time - --speed-time(-y) # Abort download if its slower than speed for given speed-time (s) - --ssl-allow-beast # Dont work around BEAST security flaw in SSL3 and TLS1.0 - --ssl-no-revoke # (Schannel) This option tells curl to disable certificate revocation checks - --ssl-reqd # (FTP IMAP POP3 SMTP) Require SSL/TLS for the connection - --ssl # (FTP IMAP POP3 SMTP) Try to use SSL/TLS for the connection - --sslv2(-2) # (SSL) Use SSL version 2 - --sslv3(-3) # (SSL) Use SSL version 3 - --stderr # Redirect all writes to stderr to the specified file instead - --styled-output # Use bold font styles when writing HTTP headers to terminal - --suppress-connect-headers # Dont print response headers for CONNECT request if -p is set - --tcp-fastopen # Enable use of TCP Fast Open - --tcp-nodelay # Turn on the TCP_NODELAY option - --telnet-option(-t) # Pass options to the telnet protocol - --tftp-blksize # (TFTP) Set TFTP BLKSIZE option (must be >512) - --tftp-no-options # (TFTP) Tells curl not to send TFTP options requests - --time-cond(-z) # (HTTP FTP) Request file modified before or later than given time - --tls-max # (SSL) VERSION defines maximum supported TLS version - --tls13-ciphers # (TLS) Specifies cipher suites to use for TLS 1.3 - --tlsauthtype # Set TLS authentication type - --tlspassword # Set password for use with the TLS authentication method - --tlsuser # Set username for use with the TLS authentication method - #--tlsv1.0 # (TLS) Forces curl to use TLS version 1.0 - #--tlsv1.1 # (TLS) Forces curl to use TLS version 1.1 - #--tlsv1.2 # (TLS) Forces curl to use TLS version 1.2 - #--tlsv1.3 # (TLS) Forces curl to use TLS version 1.3 - --tlsv1 # (SSL) Tells curl to use at least TLS version 1 - --tr-encoding # (HTTP) Request compressed Transfer-Encoding, uncompress on receive - --trace-ascii # Enables a full trace dump of all incoming and outgoing data - --trace-time # Prepends a time stamp to each trace or verbose line that curl displays - --trace # Enables a full trace dump of all incoming and outgoing data - --unix-socket # (HTTP) Connect through this Unix domain socket, instead of using the network - --upload-file(-T) # This transfers the specified local file to the remote URL - --url # Specify a URL to fetch - --use-ascii(-B) # (FTP LDAP) Enable ASCII transfer - --user-agent(-A) # (HTTP) Specify the User-Agent string to send to the HTTP server - --user(-u) # Specify the user name and password to use for server authentication - --verbose(-v) # Makes curl verbose during the operation - --version(-V) # Displays information about curl and the libcurl version it uses - --write-out(-w) # Make curl display information on stdout after a completed transfer - --no-eprt # for --disable-eprt - --no-epsv # for --disable-epsv - --max-redir # Set maximum number of redirects - --xattr # Store metadata in xattrs (like origin URL) - ...args -] \ No newline at end of file +# The client certificate types curl understands. +@non-destructive +export def "nu-complete curl cert-types" [...rest: string]: nothing -> list> { + try { + [ + {value: PEM, description: "Privacy Enhanced Mail (default)"} + {value: DER, description: "Distinguished Encoding Rules"} + {value: ENG, description: "OpenSSL crypto engine"} + {value: P12, description: "PKCS#12 bundle"} + ] + } catch { [] } +} + +# The help categories `curl --help ` lists, read live from this curl. +@non-destructive +export def "nu-complete curl help-categories" [...rest: string]: nothing -> list> { + try { + ^curl --help category | lines | skip 1 | str trim | where $it != '' | parse --regex '^(?\S+)\s+(?.+)$' + } catch { [] } +} + +# Transfer data from or to a server, with URL syntax. +export complete [curl] [ + --abstract-unix-socket: text # Connect via abstract Unix domain socket + --alt-svc: path # Enable alt-svc with this cache file + --anyauth # Pick any authentication method + --append(-a) # Append to target file when uploading + --aws-sigv4: text # AWS V4 signature auth + --basic # HTTP Basic Authentication + --ca-native # Load CA certs from the OS + --cacert: path # CA certificate to verify peer against + --capath: dir # CA directory to verify peer against + --cert(-E): text # Client certificate file and password + --cert-status # Verify server cert status OCSP-staple + --cert-type: by "nu-complete curl cert-types" # Certificate type (DER/PEM/ENG/P12) + --ciphers: text # SSL ciphers to use + --compressed # Request compressed response + --compressed-ssh # Enable SSH compression + --config(-K): path # Read config from a file + --connect-timeout: text # Maximum time allowed to connect + --connect-to: text # Connect to host + --continue-at(-C): text # Resumed transfer offset + --cookie(-b): text # Send cookies from string/load from file + --cookie-jar(-c): path # Save cookies to after operation + --create-dirs # Create necessary local directory hierarchy + --create-file-mode: text # File mode for created files + --crlf # Convert LF to CRLF in upload + --crlfile: path # Certificate Revocation list + --curves: text # (EC) TLS key exchange algorithms to request + --data(-d): text # HTTP POST data + --data-ascii: text # HTTP POST ASCII data + --data-binary: text # HTTP POST binary data + --data-raw: text # HTTP POST data, '@' allowed + --data-urlencode: text # HTTP POST data URL encoded + --delegation: words [none policy always] # GSS-API delegation permission + --digest # HTTP Digest Authentication + --disable(-q) # Disable .curlrc + --disable-eprt # Inhibit using EPRT or LPRT + --disable-epsv # Inhibit using EPSV + --disallow-username-in-url # Disallow username in URL + --dns-interface: text # Interface to use for DNS requests + --dns-ipv4-addr: text # IPv4 address to use for DNS requests + --dns-ipv6-addr: text # IPv6 address to use for DNS requests + --dns-servers: text # DNS server addrs to use + --doh-cert-status # Verify DoH server cert status OCSP-staple + --doh-insecure # Allow insecure DoH server connections + --doh-url: text # Resolve hostnames over DoH + --dump-header(-D): path # Write the received headers to + --egd-file: path # EGD socket path for random data + --engine: text # Crypto engine to use + --etag-compare: path # Load ETag from file + --etag-save: path # Parse incoming ETag and save to a file + --expect100-timeout: text # How long to wait for 100-continue + --fail(-f) # Fail fast with no output on HTTP errors + --fail-early # Fail on first transfer error + --fail-with-body # Fail on HTTP errors but save the body + --false-start # Enable TLS False Start + --form(-F): text # Specify multipart MIME data + --form-escape # Escape form fields using backslash + --form-string: text # Specify multipart MIME data + --ftp-account: text # Account data string + --ftp-alternative-to-user: text # String to replace USER [name] + --ftp-create-dirs # Create the remote dirs if not present + --ftp-method: words [multicwd nocwd singlecwd] # Control CWD usage + --ftp-pasv # Send PASV/EPSV instead of PORT + --ftp-port(-P): text # Send PORT instead of PASV + --ftp-pret # Send PRET before PASV + --ftp-skip-pasv-ip # Skip the IP address for PASV + --ftp-ssl-ccc # Send CCC after authenticating + --ftp-ssl-ccc-mode: words [active passive] # Set CCC mode + --ftp-ssl-control # Require TLS for login, clear for transfer + --get(-G) # Put the post data in the URL and use GET + --globoff(-g) # Disable URL globbing with {} and [] + --happy-eyeballs-timeout-ms: text # Time for IPv6 before IPv4 + --haproxy-clientip: text # Set address in HAProxy PROXY + --haproxy-protocol # Send HAProxy PROXY protocol v1 header + --head(-I) # Show document info only + --header(-H): text # Pass custom header(s) to server + --help(-h)?: by "nu-complete curl help-categories" # Get help for commands + --hostpubmd5: text # Acceptable MD5 hash of host public key + --hostpubsha256: text # Acceptable SHA256 hash of host public key + --hsts: path # Enable HSTS with this cache file + --http0.9 # Allow HTTP 0.9 responses + --http1.0(-0) # Use HTTP 1.0 + --http1.1 # Use HTTP 1.1 + --http2 # Use HTTP/2 + --http2-prior-knowledge # Use HTTP 2 without HTTP/1.1 Upgrade + --http3 # Use HTTP v3 + --http3-only # Use HTTP v3 only + --ignore-content-length # Ignore the size of the remote resource + --include(-i) # Include response headers in output + --insecure(-k) # Allow insecure server connections + --interface: text # Use network INTERFACE (or address) + --ipfs-gateway: text # Gateway for IPFS + --ipv4(-4) # Resolve names to IPv4 addresses + --ipv6(-6) # Resolve names to IPv6 addresses + --json: text # HTTP POST JSON + --junk-session-cookies(-j) # Ignore session cookies read from file + --keepalive-time: text # Interval time for keepalive probes + --key: text # Private key filename + --key-type: words [PEM DER ENG] # Private key file type (DER/PEM/ENG) + --krb: text # Enable Kerberos with security + --libcurl: path # Generate libcurl code for this command line + --limit-rate: text # Limit transfer speed to RATE + --list-only(-l) # List only mode + --local-port: text # Use a local port number within RANGE + --location(-L) # Follow redirects + --location-trusted # Like --location, but send auth to other hosts + --login-options: text # Server login options + --mail-auth: text # Originator address of the original email + --mail-from: text # Mail from this address + --mail-rcpt: text # Mail to this address + --mail-rcpt-allowfails # Allow RCPT TO command to fail + --manual(-M) # Display the full manual + --max-filesize: text # Maximum file size to download + --max-redirs: text # Maximum number of redirects allowed + --max-time(-m): text # Maximum time allowed for transfer + --metalink # Process given URLs as metalink XML file + --negotiate # Use HTTP Negotiate (SPNEGO) authentication + --netrc(-n) # Must read .netrc for username and password + --netrc-file: path # Specify FILE for netrc + --netrc-optional # Use either .netrc or URL + --next # Make next URL use its separate set of options + --no-alpn # Disable the ALPN TLS extension + --no-buffer(-N) # Disable buffering of the output stream + --no-clobber # Do not overwrite files that already exist + --no-keepalive # Disable TCP keepalive on the connection + --no-npn # Disable the NPN TLS extension + --no-progress-meter # Do not show the progress meter + --no-sessionid # Disable SSL session-ID reusing + --noproxy: text # List of hosts which do not use proxy + --ntlm # HTTP NTLM authentication + --ntlm-wb # HTTP NTLM authentication with winbind + --oauth2-bearer: text # OAuth 2 Bearer Token + --output(-o): path # Write to file instead of stdout + --output-dir: dir # Directory to save files in + --parallel(-Z) # Perform transfers in parallel + --parallel-immediate # Do not wait for multiplexing (with --parallel) + --parallel-max: text # Maximum concurrency for parallel transfers + --pass: text # Pass phrase for the private key + --path-as-is # Do not squash .. sequences in URL path + --pinnedpubkey: text # FILE/HASHES Public key to verify peer against + --post301 # Do not switch to GET after a 301 redirect + --post302 # Do not switch to GET after a 302 redirect + --post303 # Do not switch to GET after a 303 redirect + --preproxy # [protocol://]host[:port] Use this proxy first + --progress-bar # Display transfer progress as a bar + --proto: text # Enable/disable PROTOCOLS + --proto-default: words [http https ftp ftps sftp scp file] # Use PROTOCOL for any URL missing a scheme + --proto-redir: text # Enable/disable PROTOCOLS on redirect + --proxy(-x) # [protocol://]host[:port] Use this proxy + --proxy-anyauth # Pick any proxy authentication method + --proxy-basic # Use Basic authentication on the proxy + --proxy-ca-native # Load CA certs from the OS to verify proxy + --proxy-cacert: path # CA certificates to verify proxy against + --proxy-capath: dir # CA directory to verify proxy against + --proxy-cert: text # Set client certificate for proxy + --proxy-cert-type: words [PEM DER ENG P12] # Client certificate type for HTTPS proxy + --proxy-ciphers: text # SSL ciphers to use for proxy + --proxy-crlfile: path # Set a CRL list for proxy + --proxy-digest # Digest auth with the proxy + --proxy-header: text # Pass custom header(s) to proxy + --proxy-http2 # Use HTTP/2 with HTTPS proxy + --proxy-insecure # Skip HTTPS proxy cert verification + --proxy-key: text # Private key for HTTPS proxy + --proxy-key-type: words [PEM DER ENG] # Private key file type for proxy + --proxy-negotiate # HTTP Negotiate (SPNEGO) auth with the proxy + --proxy-ntlm # NTLM authentication with the proxy + --proxy-pass: text # Pass phrase for the private key for HTTPS proxy + --proxy-pinnedpubkey: text # FILE/HASHES public key to verify proxy with + --proxy-service-name: text # SPNEGO proxy service name + --proxy-ssl-allow-beast # Allow security flaw for interop for HTTPS proxy + --proxy-ssl-auto-client-cert # Auto client certificate for proxy + --proxy-tls13-ciphers: text # TLS 1.3 proxy cipher suites + --proxy-tlsauthtype: words [SRP] # TLS authentication type for HTTPS proxy + --proxy-tlspassword: text # TLS password for HTTPS proxy + --proxy-tlsuser: text # TLS username for HTTPS proxy + --proxy-tlsv1 # TLSv1 for HTTPS proxy + --proxy-user(-U): text # Proxy user and password + --proxy1.0: text # Use HTTP/1.0 proxy on given port + --proxytunnel(-p) # HTTP proxy tunnel (using CONNECT) + --pubkey: text # SSH Public key filename + --quote(-Q): text # Send command(s) to server before transfer + --random-file: path # File for reading random data from + --range(-r): text # Retrieve only the bytes within RANGE + --rate: text # Request rate for serial transfers + --raw # Do HTTP raw; no transfer decoding + --referer(-e): text # Referrer URL + --remote-header-name(-J) # Use the header-provided filename + --remote-name(-O) # Write output to file named as remote file + --remote-name-all # Use the remote filename for all URLs + --remote-time(-R) # Set remote file's time on local output + --remove-on-error # Remove output file on errors + --request(-X): words [GET POST PUT PATCH DELETE HEAD OPTIONS CONNECT TRACE] # Specify request method to use + --request-target: text # Specify the target for this request + --resolve: text # Resolve host+port to address + --retry: text # Retry request if transient problems occur + --retry-all-errors # Retry all errors (with --retry) + --retry-connrefused # Retry on connection refused (with --retry) + --retry-delay: text # Wait time between retries + --retry-max-time: text # Retry only within this period + --sasl-authzid: text # Identity for SASL PLAIN authentication + --sasl-ir # Initial response in SASL authentication + --service-name: text # SPNEGO service name + --show-error(-S) # Show error even when -s is used + --silent(-s) # Silent mode + --socks4: text # SOCKS4 proxy on given host + port + --socks4a: text # SOCKS4a proxy on given host + port + --socks5: text # SOCKS5 proxy on given host + port + --socks5-basic # Username/password auth for SOCKS5 proxies + --socks5-gssapi # Enable GSS-API auth for SOCKS5 proxies + --socks5-gssapi-nec # Compatibility with NEC SOCKS5 server + --socks5-gssapi-service: text # SOCKS5 proxy service name for GSS-API + --socks5-hostname: text # SOCKS5 proxy, pass hostname to proxy + --speed-limit(-Y): text # Stop transfers slower than this + --speed-time(-y): text # Trigger 'speed-limit' abort after this time + --ssl # Try enabling TLS + --ssl-allow-beast # Allow security flaw to improve interop + --ssl-auto-client-cert # Use auto client certificate (Schannel) + --ssl-no-revoke # Disable cert revocation checks (Schannel) + --ssl-reqd # Require SSL/TLS + --ssl-revoke-best-effort # Ignore missing cert CRL dist points + --sslv2(-2) # SSLv2 + --sslv3(-3) # SSLv3 + --stderr: path # Where to redirect stderr + --styled-output # Enable styled output for HTTP headers + --suppress-connect-headers # Suppress proxy CONNECT response headers + --tcp-fastopen # Use TCP Fast Open + --tcp-nodelay # Set TCP_NODELAY + --telnet-option(-t): text # Set telnet option + --tftp-blksize: text # Set TFTP BLKSIZE option + --tftp-no-options # Do not send any TFTP options + --time-cond(-z): text # Transfer based on a time condition + --tls-max: words [default 1.0 1.1 1.2 1.3] # Maximum allowed TLS version + --tls13-ciphers: text # TLS 1.3 cipher suites to use + --tlsauthtype: words [SRP] # TLS authentication type + --tlspassword: text # TLS password + --tlsuser: text # TLS username + --tlsv1(-1) # TLSv1.0 or greater + --tlsv1.0 # TLSv1.0 or greater + --tlsv1.1 # TLSv1.1 or greater + --tlsv1.2 # TLSv1.2 or greater + --tlsv1.3 # TLSv1.3 or greater + --tr-encoding # Request compressed transfer encoding + --trace: path # Write a debug trace to FILE + --trace-ascii: path # Like --trace, but without hex output + --trace-config: words [all ids time http/2 http/3 ssl tcp] # Details to log in trace/verbose output + --trace-ids # Transfer + connection ids in verbose output + --trace-time # Add time stamps to trace/verbose output + --unix-socket: path # Connect through this Unix domain socket + --upload-file(-T): path # Transfer local FILE to destination + --url: text # URL to work with + --url-query: text # Add a URL query part + --use-ascii(-B) # Use ASCII/text transfer + --user(-u): text # Server user and password + --user-agent(-A): text # Send User-Agent to server + --variable: text # Set variable + --verbose(-v) # Make the operation more talkative + --version(-V) # Show version number and quit + --write-out(-w): text # Output FORMAT after completion + --xattr # Store metadata in extended file attributes + + ...urls: text # URLs to transfer +] where { + at-most-one [--ipv4 --ipv6] + at-most-one [--http0.9 --http1.0 --http1.1 --http2 --http2-prior-knowledge --http3 --http3-only] + at-most-one [--tlsv1.0 --tlsv1.1 --tlsv1.2 --tlsv1.3] + at-most-one [--silent --verbose] + at-most-one [--output --remote-name] + at-most-one [--get --head] + at-most-one [--data --json --form] + terminal [--help --version --manual] +} diff --git a/custom-completions/dart/dart-completions.nu b/custom-completions/dart/dart-completions.nu index fc2bf336d..43756cbff 100644 --- a/custom-completions/dart/dart-completions.nu +++ b/custom-completions/dart/dart-completions.nu @@ -1,77 +1,340 @@ -def "nu-complete dart commands" [context: string, offset: int] { - let commands = [ - {value: "analyze", description: "Analyze the project's Dart code."} - {value: "build", description: "Build a Dart application for production deployment."} - {value: "compile", description: "Compile Dart to various formats."} - {value: "devtools", description: "Open DevTools (optionally connecting to an existing application)."} - {value: "doc", description: "Generate API documentation for Dart projects."} - {value: "fix", description: "Apply automated fixes to Dart source code."} - {value: "format", description: "Idiomatically format Dart source code."} - {value: "info", description: "Show diagnostic information about the installed tooling."} - {value: "run", description: "Run a Dart program."} - {value: "test", description: "Run tests for a project."} - ] - - # Extract the current token from the context using the offset. - # We need this to support completion in subdirectories (e.g. `bin/`). - let token = ($context | str substring 0..$offset | split row ' ' | last) - - # Glob for files matching the token, filtering for directories (for traversal) - # and .dart files (as valid script targets). - let files = (glob $"($token)*" - | where { |item| ($item | path type) == 'dir' or ($item | str ends-with ".dart") } - | each { |item| - let is_dir = ($item | path type) == 'dir' - let relative = (try { $item | path relative-to $env.PWD } catch { $item }) - let final_value = if $is_dir { $"($relative)/" } else { $relative } - { value: $final_value, description: (if $is_dir { "Directory" } else { "Dart script" }) } - }) - - $commands | append $files +# Declarative completions for the Dart tool. + +# Dependencies declared in pubspec.yaml. +@non-destructive +export def "nu-complete dart dependencies" [] { + try { + let spec = open pubspec.yaml + ($spec.dependencies? | default {} | columns | each {|d| {value: $d, description: "dependency"} }) + | append ($spec.dev_dependencies? | default {} | columns | each {|d| {value: $d, description: "dev dependency"} }) + } catch { [] } +} + +# Globally activated packages. +@non-destructive +export def "nu-complete dart global-packages" [] { + try { ^dart pub global list | lines | parse '{value} {description}' } catch { [] } } -def "nu-complete dart pub commands" [] { - [ - {value: "add", description: "Add a dependency to pubspec.yaml."} - {value: "cache", description: "Work with the Pub system cache."} - {value: "deps", description: "Print package dependencies."} - {value: "downgrade", description: "Downgrade packages in a Dart project."} - {value: "get", description: "Get the current package's dependencies."} - {value: "global", description: "Work with globally hosted packages."} - {value: "login", description: "Log into pub.dev."} - {value: "logout", description: "Log out of pub.dev."} - {value: "outdated", description: "Analyze dependencies to find which ones can be upgraded."} - {value: "publish", description: "Publish the current package to pub.dartlang.org."} - {value: "remove", description: "Remove a dependency from the current package."} - {value: "token", description: "Manage authentication tokens for hosted pub repositories."} - {value: "top-level", description: "Print the top-level directory of the current package."} - {value: "unpack", description: "Downloads a package and unpacks it in a directory."} - {value: "upgrade", description: "Upgrade the current package's dependencies to latest versions."} - {value: "workspaces", description: "Work with workspaces."} - ] +# Executables in bin/ of this package. +@non-destructive +export def "nu-complete dart executables" [] { + try { glob bin/*.dart | each {|f| $f | path parse | get stem } } catch { [] } } -def "nu-complete dart templates" [] { - [cli console package server-shelf web] +# Dart scripts under the current directory (four levels deep), as relative paths, so typing a +# directory such as `bin/` narrows to the scripts in it. Hidden and build directories are skipped. +@non-destructive +export def "nu-complete dart scripts" [] { + try { + glob --depth 4 --no-dir '**/*.dart' --exclude ['**/.*/**' '**/build/**'] + | each {|f| {value: ($f | path relative-to $env.PWD), description: "Dart script"} } + | sort-by value + } catch { [] } } -export extern "dart" [ - command?: string@"nu-complete dart commands" - --verbose(-v) # Print detailed logging. - --version # Print the VM version. - --enable-analytics # Enable telemetry reporting. - --disable-analytics # Disable telemetry reporting. - --suppress-analytics # Suppress analytics reporting for the current CLI invocation. -] - -export extern "dart create" [ - directory: string # Output directory - --template(-t): string@"nu-complete dart templates" # The project template to use - --pub # Run "pub get" after creation (default) - --no-pub # Do not run "pub get" - --force # Force project generation, even if the target directory already exists -] - -export extern "dart pub" [ - command?: string@"nu-complete dart pub commands" -] +# The Dart tool. +export complete [dart] [ + --verbose(-v) # Print detailed logging + --version # Print the VM version + --enable-analytics # Enable telemetry reporting + --disable-analytics # Disable telemetry reporting + --suppress-analytics # Suppress analytics reporting for this invocation + --help(-h) # Print usage information + script?: by "nu-complete dart scripts" # A Dart script to run +] where { + excludes --enable-analytics --disable-analytics + terminal [--help --version] +} + +# Analyze the project's Dart code +export complete [dart analyze] [ + --fatal-infos # Treat info-level issues as fatal + --fatal-warnings # Treat warning-level issues as fatal (default) + --no-fatal-warnings # Do not treat warnings as fatal + --format: words [default json machine] # Output format + --help(-h) # Print usage information + ...paths: path # Directories or files to analyze +] where { + excludes --fatal-warnings --no-fatal-warnings + terminal [--help] +} + +# Build a Dart application for production deployment +export complete [dart build] [ + --help(-h) # Print usage information + target?: words [cli: "Build a command-line application"] # Build target +] where { terminal [--help] } + +# Compile Dart to various formats +export complete [dart compile] [ + --help(-h) # Print usage information + format?: words [exe: "Self-contained executable" aot-snapshot: "AOT snapshot" jit-snapshot: "JIT snapshot" kernel: "Kernel module" js: "JavaScript" wasm: "WebAssembly"] # Output format +] where { terminal [--help] } + +export complete [dart compile exe] [ + --output(-o): path # Path of the executable to write + --define(-D): text # Define an environment declaration (key=value) + --target-os: words [linux macos windows android] # Target operating system + --target-arch: words [arm arm64 riscv64 x64] # Target architecture + --verbosity: words [all error info warning] # Compiler message verbosity + --help(-h) # Print usage information + path: path # The Dart entry point +] where { terminal [--help] } + +export complete [dart compile js] [ + --output(-o): path # Output file + --optimization(-O): words [O0 O1 O2 O3 O4] # Optimization level + --minify(-m) # Minify the output + --define(-D): text # Define an environment declaration (key=value) + --help(-h) # Print usage information + path: path # The Dart entry point +] where { terminal [--help] } + +export complete [dart compile wasm] [ + --output(-o): path # Output file + --optimization-level(-O): words [0 1 2 3 4] # Optimization level + --define(-D): text # Define an environment declaration (key=value) + --help(-h) # Print usage information + path: path # The Dart entry point +] where { terminal [--help] } + +# Create a new Dart project +export complete [dart create] [ + --template(-t): words [cli: "Command-line application" console: "Command-line application (simple)" package: "Package with shared Dart libraries" server-shelf: "Server app using package:shelf" web: "Web app using package:web"] # Project template + --pub # Run `pub get` after creation (default) + --no-pub # Do not run `pub get` + --force # Generate even if the directory already exists + --help(-h) # Print usage information + directory: dir # Output directory +] where { + excludes --pub --no-pub + terminal [--help] +} + +# Open DevTools +export complete [dart devtools] [ + --open-browser # Open the browser (default) + --no-open-browser # Do not open the browser + --port: text # Port to serve DevTools on + --help(-h) # Print usage information + uri?: text # VM service URI of an application to connect to +] where { + excludes --open-browser --no-open-browser + terminal [--help] +} + +# Generate API documentation for Dart projects +export complete [dart doc] [ + --output(-o): dir # Output directory (default doc/api) + --dry-run # Validate without writing files + --validate-links # Check for broken links + --help(-h) # Print usage information + directory?: dir # The package directory +] where { terminal [--help] } + +# Apply automated fixes to Dart source code +export complete [dart fix] [ + --apply # Apply the proposed changes + --dry-run(-n) # Show the proposed changes + --code: text # Only apply fixes for this diagnostic code + --help(-h) # Print usage information + directory?: path # The directory or file to fix +] where { + exactly-one [--apply --dry-run] + terminal [--help] +} + +# Idiomatically format Dart source code +export complete [dart format] [ + --output(-o): words [write: "Overwrite formatted files (default)" show: "Print the formatted code" json: "Print code and selection as JSON" none: "Discard output"] # Where to write the output + --set-exit-if-changed # Exit with code 1 if any file changed + --line-length(-l): text # Wrap lines longer than this (default 80) + --language-version: text # Language version of the formatted code + --show: words [all changed none] # Which file names to print + --summary: words [line none profile] # Summary after formatting + --help(-h) # Print usage information + ...paths: path # Files or directories to format +] where { terminal [--help] } + +# Show diagnostic information about the installed tooling +export complete [dart info] [ + --no-remove-file-paths # Do not remove file paths from the output + --help(-h) # Print usage information +] where { terminal [--help] } + +# Run a Dart program +export complete [dart run] [ + --enable-asserts # Enable assertion checks + --define(-D): text # Define an environment declaration (key=value) + --observe # Enable the VM service and pause isolates on exit + --pause-isolates-on-start # Pause isolates on start + --enable-vm-service: text # Enable the VM service on this port + --verbosity: words [all error info warning] # Compiler message verbosity + --help(-h) # Print usage information + target?: by "nu-complete dart executables" # A Dart file, `package:executable` or a bin/ executable + ...args: text # Arguments passed to the program +] where { terminal [--help] } + +# Run tests for a project +export complete [dart test] [ + --name(-n): text # Run only tests whose name matches this regex + --plain-name(-N): text # Run only tests whose name contains this string + --tags(-t): text # Run only tests with these tags + --exclude-tags(-x): text # Skip tests with these tags + --platform(-p): words [vm chrome firefox safari edge node] # Platform to run tests on + --concurrency(-j): text # Number of concurrent test suites + --reporter(-r): words [compact expanded failures-only github json silent] # Output style + --coverage: dir # Collect coverage into this directory + --timeout: text # Default test timeout (e.g. 30s, 2x, none) + --fail-fast # Stop on the first failure + --run-skipped # Run skipped tests instead of skipping them + --help(-h) # Print usage information + ...paths: path # Test files or directories +] where { + excludes --name --plain-name + terminal [--help] +} + +# Work with packages +export complete [dart pub] [ + --help(-h) # Print usage information + command?: words [add cache deps downgrade get global login logout outdated publish remove token unpack upgrade workspace bump] # Pub subcommand +] where { terminal [--help] } + +# Add dependencies to pubspec.yaml +export complete [dart pub add] [ + --dev(-d) # Add as dev dependencies + --dry-run(-n) # Report what would change + --offline # Use cached packages only + --directory(-C): dir cwd # Run in this directory + --help(-h) # Print usage information + ...packages: text # package[:constraint], dev:package or override:package +] where { terminal [--help] } + +# Remove dependencies from pubspec.yaml +export complete [dart pub remove] [ + --dry-run(-n) # Report what would change + --offline # Use cached packages only + --directory(-C): dir cwd # Run in this directory + --help(-h) # Print usage information + ...packages: by "nu-complete dart dependencies" # Packages to remove +] where { terminal [--help] } + +# Get the current package's dependencies +export complete [dart pub get] [ + --offline # Use cached packages only + --dry-run(-n) # Report what would change + --enforce-lockfile # Fail if pubspec.lock does not satisfy pubspec.yaml + --directory(-C): dir cwd # Run in this directory + --help(-h) # Print usage information +] where { terminal [--help] } + +# Upgrade the current package's dependencies +export complete [dart pub upgrade] [ + --offline # Use cached packages only + --dry-run(-n) # Report what would change + --major-versions # Upgrade to the latest resolvable versions, updating constraints + --tighten # Raise lower bounds to the resolved versions + --unlock-transitive # Also upgrade transitive dependencies + --directory(-C): dir cwd # Run in this directory + --help(-h) # Print usage information + ...packages: by "nu-complete dart dependencies" # Packages to upgrade +] where { terminal [--help] } + +# Downgrade packages to their lowest allowed versions +export complete [dart pub downgrade] [ + --offline # Use cached packages only + --dry-run(-n) # Report what would change + --directory(-C): dir cwd # Run in this directory + --help(-h) # Print usage information + ...packages: by "nu-complete dart dependencies" # Packages to downgrade +] where { terminal [--help] } + +# Print package dependencies +export complete [dart pub deps] [ + --style(-s): words [tree list compact] # Output style + --dev # Include dev dependencies (default) + --no-dev # Exclude dev dependencies + --executables # List the available executables + --json # Output as JSON + --directory(-C): dir cwd # Run in this directory + --help(-h) # Print usage information +] where { + excludes --dev --no-dev + excludes --json --style + terminal [--help] +} + +# Find dependencies that can be upgraded +export complete [dart pub outdated] [ + --dependency-overrides # Show resolutions with dependency_overrides (default) + --dev-dependencies # Include dev dependencies (default) + --json # Output as JSON + --show-all # Include up-to-date dependencies + --transitive # Include transitive dependencies + --up-to-date # Include dependencies that are already up to date + --directory(-C): dir cwd # Run in this directory + --help(-h) # Print usage information +] where { terminal [--help] } + +# Publish the current package to pub.dev +export complete [dart pub publish] [ + --dry-run(-n) # Validate without publishing + --force(-f) # Publish without confirmation + --skip-validation # Publish without client-side validation + --directory(-C): dir cwd # Run in this directory + --help(-h) # Print usage information +] where { + excludes --dry-run --force + terminal [--help] +} + +# Work with globally activated packages +export complete [dart pub global] [ + --help(-h) # Print usage information + command?: words [activate deactivate list run] # Global subcommand +] where { terminal [--help] } + +export complete [dart pub global activate] [ + --source(-s): words [git hosted path] # Package source + --executable(-x): text # Executable to place on PATH + --overwrite # Overwrite executables from other packages + --git-path: text # Path of the package within the git repository + --git-ref: text # Git branch or commit + --help(-h) # Print usage information + package: text # The package to activate + constraint?: text # Version constraint +] where { terminal [--help] } + +export complete [dart pub global deactivate] [ + --help(-h) # Print usage information + package: by "nu-complete dart global-packages" # The package to deactivate +] where { terminal [--help] } + +export complete [dart pub global run] [ + --enable-asserts # Enable assertion checks + --help(-h) # Print usage information + executable: by "nu-complete dart global-packages" # package[:executable] + ...args: text # Arguments passed to the program +] where { terminal [--help] } + +# Work with the system cache +export complete [dart pub cache] [ + --help(-h) # Print usage information + command?: words [add clean repair] # Cache subcommand +] where { terminal [--help] } + +# Manage authentication tokens for hosted pub repositories +export complete [dart pub token] [ + --help(-h) # Print usage information + command?: words [add list remove] # Token subcommand +] where { terminal [--help] } + +# Download a package and unpack it in place +export complete [dart pub unpack] [ + --force(-f) # Overwrite an existing directory + --output(-o): dir # Where to unpack the package + --help(-h) # Print usage information + package: text # package[:version] +] where { terminal [--help] } diff --git a/custom-completions/docker/docker-completions.nu b/custom-completions/docker/docker-completions.nu index 45fe9f8c4..c9feb0dff 100644 --- a/custom-completions/docker/docker-completions.nu +++ b/custom-completions/docker/docker-completions.nu @@ -1,691 +1,1791 @@ -def "nu-complete docker containers" [] { - ^docker ps -a --format "{{.ID}} {{.Names}}" | lines - | parse "{value} {description}" +# Declarative completions for docker. +# +# The `export complete` declarations describe each route once; the live providers below +# (all `@non-destructive`, all wrapped in `try`/`catch`) read containers, images, networks, +# volumes, contexts and compose services from `docker ... --format '{{json .}}'`. +# `docker.port` describes `--publish` values: `[ip:]host:container[/proto]`. +# `export def` commands such as `docker-containers` stay user-facing. + +# The containers, running or not, one row each: `id`, `name`, `image`, `state` (running, exited, +# ...) and the human `status` ("Up 2 hours"). Reads only. +# `docker-containers | where name == ` completes the names. +@non-destructive +@example "Names of the containers that are running" { docker-containers | where state == running | get name } +@example "Containers started from an image" { docker-containers | where image =~ nginx } +export def docker-containers []: nothing -> table { + ^docker ps --all --format '{{.ID}}|{{.Names}}|{{.Image}}|{{.State}}|{{.Status}}' + | lines + | parse "{id}|{name}|{image}|{state}|{status}" +} + +# The images, one row each: `id`, `repository`, `tag` and `size`. Reads only. +# `docker-images | where size > ` completes the sizes. +@non-destructive +@example "The images over a gigabyte" { docker-images | where size > 1gb | get repository } +@example "Every tag of one repository" { docker-images | where repository == alpine | get tag } +export def docker-images []: nothing -> table { + ^docker images --format '{{.ID}}|{{.Repository}}|{{.Tag}}|{{.Size}}' + | lines + | parse "{id}|{repository}|{tag}|{size}" + | update size { try { into filesize } catch { 0b } } +} + +# The volumes, one row each: `name` and `driver`. Reads only. +@non-destructive +@example "Names of the local volumes" { docker-volumes | where driver == local | get name } +export def docker-volumes []: nothing -> table { + ^docker volume ls --format '{{.Name}}|{{.Driver}}' + | lines + | parse "{name}|{driver}" +} + +# The networks, one row each: `id`, `name` and `driver`. Reads only. +@non-destructive +@example "Names of the bridge networks" { docker-networks | where driver == bridge | get name } +export def docker-networks []: nothing -> table { + ^docker network ls --format '{{.ID}}|{{.Name}}|{{.Driver}}' + | lines + | parse "{id}|{name}|{driver}" +} + +# --- Live providers --------------------------------------------------------------- + +# Parse `--format '{{json .}}'` output: one JSON object per line. +def json-lines []: string -> list { + lines | where $it != '' | each { from json } +} + +# Running containers, by name, described by image and status. +@non-destructive +export def "nu-complete docker containers" [] { + try { + ^docker ps --format '{{json .}}' | json-lines + | each {|c| {value: $c.Names, description: $"($c.Image) — ($c.Status)"} } + } catch { + [] + } +} + +# Every container, running or not, by name, described by image and status. +@non-destructive +export def "nu-complete docker all-containers" [] { + try { + ^docker ps --all --format '{{json .}}' | json-lines + | each {|c| {value: $c.Names, description: $"($c.Image) — ($c.Status)"} } + } catch { + [] + } +} + +# Local images as `repository:tag` (or the id for untagged ones), described by size and age. +@non-destructive +export def "nu-complete docker images" [] { + try { + ^docker images --format '{{json .}}' | json-lines + | each {|i| + let value = if $i.Repository == '' { $i.ID } else if $i.Tag == '' { $i.Repository } else { $"($i.Repository):($i.Tag)" } + {value: $value, description: $"($i.Size), ($i.CreatedSince)"} + } + } catch { + [] + } +} + +# Networks, by name, described by driver and scope. +@non-destructive +export def "nu-complete docker networks" [] { + try { + ^docker network ls --format '{{json .}}' | json-lines + | each {|n| {value: $n.Name, description: $"($n.Driver), ($n.Scope)"} } + } catch { + [] + } +} + +# Volumes, by name, described by driver. +@non-destructive +export def "nu-complete docker volumes" [] { + try { + ^docker volume ls --format '{{json .}}' | json-lines + | each {|v| {value: $v.Name, description: $v.Driver} } + } catch { + [] + } +} + +# Contexts, by name, described by endpoint (the current one is marked). +@non-destructive +export def "nu-complete docker contexts" [] { + try { + ^docker context ls --format '{{json .}}' | json-lines + | each {|c| {value: $c.Name, description: (if $c.Current { $"current, ($c.DockerEndpoint)" } else { $c.DockerEndpoint })} } + } catch { + [] + } +} + +# The services of the compose project in the current directory. +@non-destructive +export def "nu-complete docker compose services" [] { + try { + ^docker compose config --services | lines | where $it != '' + } catch { + [] + } +} + +# Top-level subcommands, from `docker --help`. +@non-destructive +export def "nu-complete docker subcommands" [] { + try { + ^docker --help | lines | where $it =~ '^ {2}[A-Za-z]' + | parse --regex '^ {2}(?P[^\s*]+)\*?\s+(?P.+)$' + } catch { + [] + } +} + +# Transport protocols a published port may name. +@non-destructive +export def "nu-complete docker protocols" [] { + try { + [[value description]; [tcp "TCP (default)"] [udp UDP] [sctp SCTP]] + } catch { + [] + } +} + +# --- Syntax ----------------------------------------------------------------------- + +# A published port: `[ip:][host[-end]]:container[-end][/proto]`, such as `8080:80` or +# `127.0.0.1:5432:5432/tcp`. +export syntax docker.port over chars { + root = (ip: addr ":")? host: range ":" container: range ("/" proto: words ["tcp" "udp" "sctp"])? + addr = digit+ "." digit+ "." digit+ "." digit+ + range = digit+ ("-" digit+)? +} + +# --- Root ------------------------------------------------------------------------- + +export complete [docker] [ + command?: by "nu-complete docker subcommands" # Subcommand + --config: dir # Location of client config files + --context(-c): by "nu-complete docker contexts" # Name of the context to use to connect to the daemon + --debug(-D) # Enable debug mode + --host(-H): text # Daemon socket to connect to + --log-level(-l): words [debug info warn error fatal] # Set the logging level + --tls # Use TLS; implied by --tlsverify + --tlscacert: path # Trust certs signed only by this CA + --tlscert: path # Path to TLS certificate file + --tlskey: path # Path to TLS key file + --tlsverify # Use TLS and verify the remote + --version(-v) # Print version information and quit + --help # Print usage +] where { + at-most-one [--context --host] + terminal [--version --help] +} + +# --- Containers ------------------------------------------------------------------- + +export complete [docker run] [ + image: by "nu-complete docker images" # The image to create the container from + ...command: command # The command to run inside the container, and its arguments + --detach(-d) # Run container in background and print container ID + --detach-keys: text # Override the key sequence for detaching a container + --sig-proxy # Proxy received signals to the process + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --annotation: text # Add an annotation to the container (passed through to the OCI runtime) + --attach(-a): words [STDIN STDOUT STDERR] # Attach to STDIN, STDOUT or STDERR + --blkio-weight: text # Block IO (relative weight), between 10 and 1000, or 0 to disable + --blkio-weight-device: text # Block IO weight (relative device weight) + --cap-add: text # Add Linux capabilities + --cap-drop: text # Drop Linux capabilities + --cgroup-parent: text # Optional parent cgroup for the container + --cgroupns: words [host private] # Cgroup namespace to use + --cidfile: path # Write the container ID to the file + --cpu-period: text # Limit CPU CFS (Completely Fair Scheduler) period + --cpu-quota: text # Limit CPU CFS (Completely Fair Scheduler) quota + --cpu-rt-period: text # Limit CPU real-time period in microseconds + --cpu-rt-runtime: text # Limit CPU real-time runtime in microseconds + --cpu-shares(-c): text # CPU shares (relative weight) + --cpus: text # Number of CPUs + --cpuset-cpus: text # CPUs in which to allow execution (0-3, 0,1) + --cpuset-mems: text # MEMs in which to allow execution (0-3, 0,1) + --device: path # Add a host device to the container + --device-cgroup-rule: text # Add a rule to the cgroup allowed devices list + --device-read-bps: text # Limit read rate (bytes per second) from a device + --device-read-iops: text # Limit read rate (IO per second) from a device + --device-write-bps: text # Limit write rate (bytes per second) to a device + --device-write-iops: text # Limit write rate (IO per second) to a device + --disable-content-trust # Skip image verification + --dns: text # Set custom DNS servers + --dns-option: text # Set DNS options + --dns-search: text # Set custom DNS search domains + --domainname: text # Container NIS domain name + --entrypoint: text # Overwrite the default ENTRYPOINT of the image + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --expose: text # Expose a port or a range of ports + --gpus: text # GPU devices to add to the container ('all' to pass all GPUs) + --group-add: groups # Add additional groups to join + --health-cmd: text # Command to run to check health + --health-interval: text # Time between running the check (ms|s|m|h) + --health-retries: text # Consecutive failures needed to report unhealthy + --health-start-interval: text # Time between running the check during the start period (ms|s|m|h) + --health-start-period: text # Start period for the container to initialize before starting health-retries countdown + --health-timeout: text # Maximum time to allow one check to run (ms|s|m|h) + --hostname(-h): text # Container host name + --init # Run an init inside the container that forwards signals and reaps processes + --interactive(-i) # Keep STDIN open even if not attached + --ip: text # IPv4 address (e.g., 172.30.100.104) + --ip6: text # IPv6 address (e.g., 2001:db8::33) + --ipc: text # IPC mode to use + --isolation: text # Container isolation technology + --kernel-memory: text # Kernel memory limit (deprecated, ignored by current kernels) + --label(-l): text # Set meta data on a container + --label-file: path # Read in a line delimited file of labels + --link: by "nu-complete docker all-containers" # Add link to another container + --link-local-ip: text # Container IPv4/IPv6 link-local addresses + --log-driver: words [json-file local journald syslog gelf fluentd awslogs splunk etwlogs gcplogs none] # Logging driver for the container + --log-opt: text # Log driver options + --mac-address: text # Container MAC address (e.g., 92:d0:c6:0a:29:33) + --memory(-m): text # Memory limit + --memory-reservation: text # Memory soft limit + --memory-swap: text # Swap limit equal to memory plus swap: '-1' to enable unlimited swap + --memory-swappiness: text # Tune container memory swappiness (0 to 100) + --mount: text # Attach a filesystem mount to the container + --name: text # Assign a name to the container + --network: by "nu-complete docker networks" # Connect a container to a network + --network-alias: text # Add network-scoped alias for the container + --no-healthcheck # Disable any container-specified HEALTHCHECK + --oom-kill-disable # Disable OOM Killer + --oom-score-adj: text # Tune host's OOM preferences (-1000 to 1000) + --pid: text # PID namespace to use + --pids-limit: text # Tune container pids limit (set -1 for unlimited) + --platform: text # Set platform if server is multi-platform capable + --privileged # Give extended privileges to this container + --publish(-p): docker.port with { root.proto: by "nu-complete docker protocols" } # Publish a container's port(s) to the host ([ip:]host:container[/proto]) + --publish-all(-P) # Publish all exposed ports to random ports + --pull: words [always missing never] # Pull image before running + --quiet(-q) # Suppress the pull output + --read-only # Mount the container's root filesystem as read only + --restart: words [no always on-failure unless-stopped] # Restart policy to apply when a container exits + --rm # Automatically remove the container and its associated anonymous volumes when it exits + --runtime: text # Runtime to use for this container + --security-opt: text # Security Options + --shm-size: text # Size of /dev/shm + --stop-signal: signals # Signal to stop the container + --stop-timeout: text # Timeout (in seconds) to stop a container + --storage-opt: text # Storage driver options for the container + --sysctl: text # Sysctl options + --tmpfs: text # Mount a tmpfs directory + --tty(-t) # Allocate a pseudo-TTY + --ulimit: text # Ulimit options + --user(-u): users # Username or UID (format: [:]) + --userns: text # User namespace to use + --uts: text # UTS namespace to use + --volume(-v): text # Bind mount a volume + --volume-driver: text # Optional volume driver for the container + --volumes-from: by "nu-complete docker all-containers" # Mount volumes from the specified container(s) + --workdir(-w): text # Working directory inside the container + --help # Print usage +] where { + at-most-one [--detach --attach] + excludes --rm --restart +} + +export complete [docker container run] [ + image: by "nu-complete docker images" # The image to create the container from + ...command: command # The command to run inside the container, and its arguments + --detach(-d) # Run container in background and print container ID + --detach-keys: text # Override the key sequence for detaching a container + --sig-proxy # Proxy received signals to the process + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --annotation: text # Add an annotation to the container (passed through to the OCI runtime) + --attach(-a): words [STDIN STDOUT STDERR] # Attach to STDIN, STDOUT or STDERR + --blkio-weight: text # Block IO (relative weight), between 10 and 1000, or 0 to disable + --blkio-weight-device: text # Block IO weight (relative device weight) + --cap-add: text # Add Linux capabilities + --cap-drop: text # Drop Linux capabilities + --cgroup-parent: text # Optional parent cgroup for the container + --cgroupns: words [host private] # Cgroup namespace to use + --cidfile: path # Write the container ID to the file + --cpu-period: text # Limit CPU CFS (Completely Fair Scheduler) period + --cpu-quota: text # Limit CPU CFS (Completely Fair Scheduler) quota + --cpu-rt-period: text # Limit CPU real-time period in microseconds + --cpu-rt-runtime: text # Limit CPU real-time runtime in microseconds + --cpu-shares(-c): text # CPU shares (relative weight) + --cpus: text # Number of CPUs + --cpuset-cpus: text # CPUs in which to allow execution (0-3, 0,1) + --cpuset-mems: text # MEMs in which to allow execution (0-3, 0,1) + --device: path # Add a host device to the container + --device-cgroup-rule: text # Add a rule to the cgroup allowed devices list + --device-read-bps: text # Limit read rate (bytes per second) from a device + --device-read-iops: text # Limit read rate (IO per second) from a device + --device-write-bps: text # Limit write rate (bytes per second) to a device + --device-write-iops: text # Limit write rate (IO per second) to a device + --disable-content-trust # Skip image verification + --dns: text # Set custom DNS servers + --dns-option: text # Set DNS options + --dns-search: text # Set custom DNS search domains + --domainname: text # Container NIS domain name + --entrypoint: text # Overwrite the default ENTRYPOINT of the image + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --expose: text # Expose a port or a range of ports + --gpus: text # GPU devices to add to the container ('all' to pass all GPUs) + --group-add: groups # Add additional groups to join + --health-cmd: text # Command to run to check health + --health-interval: text # Time between running the check (ms|s|m|h) + --health-retries: text # Consecutive failures needed to report unhealthy + --health-start-interval: text # Time between running the check during the start period (ms|s|m|h) + --health-start-period: text # Start period for the container to initialize before starting health-retries countdown + --health-timeout: text # Maximum time to allow one check to run (ms|s|m|h) + --hostname(-h): text # Container host name + --init # Run an init inside the container that forwards signals and reaps processes + --interactive(-i) # Keep STDIN open even if not attached + --ip: text # IPv4 address (e.g., 172.30.100.104) + --ip6: text # IPv6 address (e.g., 2001:db8::33) + --ipc: text # IPC mode to use + --isolation: text # Container isolation technology + --kernel-memory: text # Kernel memory limit (deprecated, ignored by current kernels) + --label(-l): text # Set meta data on a container + --label-file: path # Read in a line delimited file of labels + --link: by "nu-complete docker all-containers" # Add link to another container + --link-local-ip: text # Container IPv4/IPv6 link-local addresses + --log-driver: words [json-file local journald syslog gelf fluentd awslogs splunk etwlogs gcplogs none] # Logging driver for the container + --log-opt: text # Log driver options + --mac-address: text # Container MAC address (e.g., 92:d0:c6:0a:29:33) + --memory(-m): text # Memory limit + --memory-reservation: text # Memory soft limit + --memory-swap: text # Swap limit equal to memory plus swap: '-1' to enable unlimited swap + --memory-swappiness: text # Tune container memory swappiness (0 to 100) + --mount: text # Attach a filesystem mount to the container + --name: text # Assign a name to the container + --network: by "nu-complete docker networks" # Connect a container to a network + --network-alias: text # Add network-scoped alias for the container + --no-healthcheck # Disable any container-specified HEALTHCHECK + --oom-kill-disable # Disable OOM Killer + --oom-score-adj: text # Tune host's OOM preferences (-1000 to 1000) + --pid: text # PID namespace to use + --pids-limit: text # Tune container pids limit (set -1 for unlimited) + --platform: text # Set platform if server is multi-platform capable + --privileged # Give extended privileges to this container + --publish(-p): docker.port with { root.proto: by "nu-complete docker protocols" } # Publish a container's port(s) to the host ([ip:]host:container[/proto]) + --publish-all(-P) # Publish all exposed ports to random ports + --pull: words [always missing never] # Pull image before running + --quiet(-q) # Suppress the pull output + --read-only # Mount the container's root filesystem as read only + --restart: words [no always on-failure unless-stopped] # Restart policy to apply when a container exits + --rm # Automatically remove the container and its associated anonymous volumes when it exits + --runtime: text # Runtime to use for this container + --security-opt: text # Security Options + --shm-size: text # Size of /dev/shm + --stop-signal: signals # Signal to stop the container + --stop-timeout: text # Timeout (in seconds) to stop a container + --storage-opt: text # Storage driver options for the container + --sysctl: text # Sysctl options + --tmpfs: text # Mount a tmpfs directory + --tty(-t) # Allocate a pseudo-TTY + --ulimit: text # Ulimit options + --user(-u): users # Username or UID (format: [:]) + --userns: text # User namespace to use + --uts: text # UTS namespace to use + --volume(-v): text # Bind mount a volume + --volume-driver: text # Optional volume driver for the container + --volumes-from: by "nu-complete docker all-containers" # Mount volumes from the specified container(s) + --workdir(-w): text # Working directory inside the container + --help # Print usage +] where { + at-most-one [--detach --attach] + excludes --rm --restart +} + +export complete [docker create] [ + image: by "nu-complete docker images" # The image to create the container from + ...command: command # The command to run inside the container, and its arguments + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --annotation: text # Add an annotation to the container (passed through to the OCI runtime) + --attach(-a): words [STDIN STDOUT STDERR] # Attach to STDIN, STDOUT or STDERR + --blkio-weight: text # Block IO (relative weight), between 10 and 1000, or 0 to disable + --blkio-weight-device: text # Block IO weight (relative device weight) + --cap-add: text # Add Linux capabilities + --cap-drop: text # Drop Linux capabilities + --cgroup-parent: text # Optional parent cgroup for the container + --cgroupns: words [host private] # Cgroup namespace to use + --cidfile: path # Write the container ID to the file + --cpu-period: text # Limit CPU CFS (Completely Fair Scheduler) period + --cpu-quota: text # Limit CPU CFS (Completely Fair Scheduler) quota + --cpu-rt-period: text # Limit CPU real-time period in microseconds + --cpu-rt-runtime: text # Limit CPU real-time runtime in microseconds + --cpu-shares(-c): text # CPU shares (relative weight) + --cpus: text # Number of CPUs + --cpuset-cpus: text # CPUs in which to allow execution (0-3, 0,1) + --cpuset-mems: text # MEMs in which to allow execution (0-3, 0,1) + --device: path # Add a host device to the container + --device-cgroup-rule: text # Add a rule to the cgroup allowed devices list + --device-read-bps: text # Limit read rate (bytes per second) from a device + --device-read-iops: text # Limit read rate (IO per second) from a device + --device-write-bps: text # Limit write rate (bytes per second) to a device + --device-write-iops: text # Limit write rate (IO per second) to a device + --disable-content-trust # Skip image verification + --dns: text # Set custom DNS servers + --dns-option: text # Set DNS options + --dns-search: text # Set custom DNS search domains + --domainname: text # Container NIS domain name + --entrypoint: text # Overwrite the default ENTRYPOINT of the image + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --expose: text # Expose a port or a range of ports + --gpus: text # GPU devices to add to the container ('all' to pass all GPUs) + --group-add: groups # Add additional groups to join + --health-cmd: text # Command to run to check health + --health-interval: text # Time between running the check (ms|s|m|h) + --health-retries: text # Consecutive failures needed to report unhealthy + --health-start-interval: text # Time between running the check during the start period (ms|s|m|h) + --health-start-period: text # Start period for the container to initialize before starting health-retries countdown + --health-timeout: text # Maximum time to allow one check to run (ms|s|m|h) + --hostname(-h): text # Container host name + --init # Run an init inside the container that forwards signals and reaps processes + --interactive(-i) # Keep STDIN open even if not attached + --ip: text # IPv4 address (e.g., 172.30.100.104) + --ip6: text # IPv6 address (e.g., 2001:db8::33) + --ipc: text # IPC mode to use + --isolation: text # Container isolation technology + --kernel-memory: text # Kernel memory limit (deprecated, ignored by current kernels) + --label(-l): text # Set meta data on a container + --label-file: path # Read in a line delimited file of labels + --link: by "nu-complete docker all-containers" # Add link to another container + --link-local-ip: text # Container IPv4/IPv6 link-local addresses + --log-driver: words [json-file local journald syslog gelf fluentd awslogs splunk etwlogs gcplogs none] # Logging driver for the container + --log-opt: text # Log driver options + --mac-address: text # Container MAC address (e.g., 92:d0:c6:0a:29:33) + --memory(-m): text # Memory limit + --memory-reservation: text # Memory soft limit + --memory-swap: text # Swap limit equal to memory plus swap: '-1' to enable unlimited swap + --memory-swappiness: text # Tune container memory swappiness (0 to 100) + --mount: text # Attach a filesystem mount to the container + --name: text # Assign a name to the container + --network: by "nu-complete docker networks" # Connect a container to a network + --network-alias: text # Add network-scoped alias for the container + --no-healthcheck # Disable any container-specified HEALTHCHECK + --oom-kill-disable # Disable OOM Killer + --oom-score-adj: text # Tune host's OOM preferences (-1000 to 1000) + --pid: text # PID namespace to use + --pids-limit: text # Tune container pids limit (set -1 for unlimited) + --platform: text # Set platform if server is multi-platform capable + --privileged # Give extended privileges to this container + --publish(-p): docker.port with { root.proto: by "nu-complete docker protocols" } # Publish a container's port(s) to the host ([ip:]host:container[/proto]) + --publish-all(-P) # Publish all exposed ports to random ports + --pull: words [always missing never] # Pull image before running + --quiet(-q) # Suppress the pull output + --read-only # Mount the container's root filesystem as read only + --restart: words [no always on-failure unless-stopped] # Restart policy to apply when a container exits + --rm # Automatically remove the container and its associated anonymous volumes when it exits + --runtime: text # Runtime to use for this container + --security-opt: text # Security Options + --shm-size: text # Size of /dev/shm + --stop-signal: signals # Signal to stop the container + --stop-timeout: text # Timeout (in seconds) to stop a container + --storage-opt: text # Storage driver options for the container + --sysctl: text # Sysctl options + --tmpfs: text # Mount a tmpfs directory + --tty(-t) # Allocate a pseudo-TTY + --ulimit: text # Ulimit options + --user(-u): users # Username or UID (format: [:]) + --userns: text # User namespace to use + --uts: text # UTS namespace to use + --volume(-v): text # Bind mount a volume + --volume-driver: text # Optional volume driver for the container + --volumes-from: by "nu-complete docker all-containers" # Mount volumes from the specified container(s) + --workdir(-w): text # Working directory inside the container + --help # Print usage +] where { + excludes --rm --restart +} + +export complete [docker container create] [ + image: by "nu-complete docker images" # The image to create the container from + ...command: command # The command to run inside the container, and its arguments + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --annotation: text # Add an annotation to the container (passed through to the OCI runtime) + --attach(-a): words [STDIN STDOUT STDERR] # Attach to STDIN, STDOUT or STDERR + --blkio-weight: text # Block IO (relative weight), between 10 and 1000, or 0 to disable + --blkio-weight-device: text # Block IO weight (relative device weight) + --cap-add: text # Add Linux capabilities + --cap-drop: text # Drop Linux capabilities + --cgroup-parent: text # Optional parent cgroup for the container + --cgroupns: words [host private] # Cgroup namespace to use + --cidfile: path # Write the container ID to the file + --cpu-period: text # Limit CPU CFS (Completely Fair Scheduler) period + --cpu-quota: text # Limit CPU CFS (Completely Fair Scheduler) quota + --cpu-rt-period: text # Limit CPU real-time period in microseconds + --cpu-rt-runtime: text # Limit CPU real-time runtime in microseconds + --cpu-shares(-c): text # CPU shares (relative weight) + --cpus: text # Number of CPUs + --cpuset-cpus: text # CPUs in which to allow execution (0-3, 0,1) + --cpuset-mems: text # MEMs in which to allow execution (0-3, 0,1) + --device: path # Add a host device to the container + --device-cgroup-rule: text # Add a rule to the cgroup allowed devices list + --device-read-bps: text # Limit read rate (bytes per second) from a device + --device-read-iops: text # Limit read rate (IO per second) from a device + --device-write-bps: text # Limit write rate (bytes per second) to a device + --device-write-iops: text # Limit write rate (IO per second) to a device + --disable-content-trust # Skip image verification + --dns: text # Set custom DNS servers + --dns-option: text # Set DNS options + --dns-search: text # Set custom DNS search domains + --domainname: text # Container NIS domain name + --entrypoint: text # Overwrite the default ENTRYPOINT of the image + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --expose: text # Expose a port or a range of ports + --gpus: text # GPU devices to add to the container ('all' to pass all GPUs) + --group-add: groups # Add additional groups to join + --health-cmd: text # Command to run to check health + --health-interval: text # Time between running the check (ms|s|m|h) + --health-retries: text # Consecutive failures needed to report unhealthy + --health-start-interval: text # Time between running the check during the start period (ms|s|m|h) + --health-start-period: text # Start period for the container to initialize before starting health-retries countdown + --health-timeout: text # Maximum time to allow one check to run (ms|s|m|h) + --hostname(-h): text # Container host name + --init # Run an init inside the container that forwards signals and reaps processes + --interactive(-i) # Keep STDIN open even if not attached + --ip: text # IPv4 address (e.g., 172.30.100.104) + --ip6: text # IPv6 address (e.g., 2001:db8::33) + --ipc: text # IPC mode to use + --isolation: text # Container isolation technology + --kernel-memory: text # Kernel memory limit (deprecated, ignored by current kernels) + --label(-l): text # Set meta data on a container + --label-file: path # Read in a line delimited file of labels + --link: by "nu-complete docker all-containers" # Add link to another container + --link-local-ip: text # Container IPv4/IPv6 link-local addresses + --log-driver: words [json-file local journald syslog gelf fluentd awslogs splunk etwlogs gcplogs none] # Logging driver for the container + --log-opt: text # Log driver options + --mac-address: text # Container MAC address (e.g., 92:d0:c6:0a:29:33) + --memory(-m): text # Memory limit + --memory-reservation: text # Memory soft limit + --memory-swap: text # Swap limit equal to memory plus swap: '-1' to enable unlimited swap + --memory-swappiness: text # Tune container memory swappiness (0 to 100) + --mount: text # Attach a filesystem mount to the container + --name: text # Assign a name to the container + --network: by "nu-complete docker networks" # Connect a container to a network + --network-alias: text # Add network-scoped alias for the container + --no-healthcheck # Disable any container-specified HEALTHCHECK + --oom-kill-disable # Disable OOM Killer + --oom-score-adj: text # Tune host's OOM preferences (-1000 to 1000) + --pid: text # PID namespace to use + --pids-limit: text # Tune container pids limit (set -1 for unlimited) + --platform: text # Set platform if server is multi-platform capable + --privileged # Give extended privileges to this container + --publish(-p): docker.port with { root.proto: by "nu-complete docker protocols" } # Publish a container's port(s) to the host ([ip:]host:container[/proto]) + --publish-all(-P) # Publish all exposed ports to random ports + --pull: words [always missing never] # Pull image before running + --quiet(-q) # Suppress the pull output + --read-only # Mount the container's root filesystem as read only + --restart: words [no always on-failure unless-stopped] # Restart policy to apply when a container exits + --rm # Automatically remove the container and its associated anonymous volumes when it exits + --runtime: text # Runtime to use for this container + --security-opt: text # Security Options + --shm-size: text # Size of /dev/shm + --stop-signal: signals # Signal to stop the container + --stop-timeout: text # Timeout (in seconds) to stop a container + --storage-opt: text # Storage driver options for the container + --sysctl: text # Sysctl options + --tmpfs: text # Mount a tmpfs directory + --tty(-t) # Allocate a pseudo-TTY + --ulimit: text # Ulimit options + --user(-u): users # Username or UID (format: [:]) + --userns: text # User namespace to use + --uts: text # UTS namespace to use + --volume(-v): text # Bind mount a volume + --volume-driver: text # Optional volume driver for the container + --volumes-from: by "nu-complete docker all-containers" # Mount volumes from the specified container(s) + --workdir(-w): text # Working directory inside the container + --help # Print usage +] where { + excludes --rm --restart +} + +export complete [docker exec] [ + container: by "nu-complete docker containers" # The running container + ...command: command # The command to run, and its arguments + --detach(-d) # Detached mode: run command in the background + --detach-keys: text # Override the key sequence for detaching a container + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --interactive(-i) # Keep STDIN open even if not attached + --privileged # Give extended privileges to the command + --tty(-t) # Allocate a pseudo-TTY + --user(-u): users # Username or UID (format: "[:]") + --workdir(-w): text # Working directory inside the container + --help # Print usage +] + +export complete [docker container exec] [ + container: by "nu-complete docker containers" # The running container + ...command: command # The command to run, and its arguments + --detach(-d) # Detached mode: run command in the background + --detach-keys: text # Override the key sequence for detaching a container + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --interactive(-i) # Keep STDIN open even if not attached + --privileged # Give extended privileges to the command + --tty(-t) # Allocate a pseudo-TTY + --user(-u): users # Username or UID (format: "[:]") + --workdir(-w): text # Working directory inside the container + --help # Print usage +] + +export complete [docker ps] [ + --all(-a) # Show all containers (default shows just running) + --filter(-f): text # Filter output based on conditions provided + --format: text # Format output using a custom template ('table', 'table TEMPLATE', 'json', 'TEMPLATE') + --last(-n): text # Show n last created containers (includes all states) + --latest(-l) # Show the latest created container (includes all states) + --no-trunc # Don't truncate output + --quiet(-q) # Only display container IDs + --size(-s) # Display total file sizes + --help # Print usage +] where { + overrides [--last --latest] + at-most-one [--quiet --format] +} + +export complete [docker container ls] [ + --all(-a) # Show all containers (default shows just running) + --filter(-f): text # Filter output based on conditions provided + --format: text # Format output using a custom template ('table', 'table TEMPLATE', 'json', 'TEMPLATE') + --last(-n): text # Show n last created containers (includes all states) + --latest(-l) # Show the latest created container (includes all states) + --no-trunc # Don't truncate output + --quiet(-q) # Only display container IDs + --size(-s) # Display total file sizes + --help # Print usage +] where { + overrides [--last --latest] + at-most-one [--quiet --format] +} + +export complete [docker container list] [ + --all(-a) # Show all containers (default shows just running) + --filter(-f): text # Filter output based on conditions provided + --format: text # Format output using a custom template ('table', 'table TEMPLATE', 'json', 'TEMPLATE') + --last(-n): text # Show n last created containers (includes all states) + --latest(-l) # Show the latest created container (includes all states) + --no-trunc # Don't truncate output + --quiet(-q) # Only display container IDs + --size(-s) # Display total file sizes + --help # Print usage +] where { + overrides [--last --latest] + at-most-one [--quiet --format] +} + +export complete [docker container ps] [ + --all(-a) # Show all containers (default shows just running) + --filter(-f): text # Filter output based on conditions provided + --format: text # Format output using a custom template ('table', 'table TEMPLATE', 'json', 'TEMPLATE') + --last(-n): text # Show n last created containers (includes all states) + --latest(-l) # Show the latest created container (includes all states) + --no-trunc # Don't truncate output + --quiet(-q) # Only display container IDs + --size(-s) # Display total file sizes + --help # Print usage +] where { + overrides [--last --latest] + at-most-one [--quiet --format] +} + +export complete [docker logs] [ + container: by "nu-complete docker all-containers" # The container + --details # Show extra details provided to logs + --follow(-f) # Follow log output + --since: text # Show logs since timestamp (e.g. "2013-01-02T13:23:37Z") or relative (e.g. "42m") + --tail(-n): text # Number of lines to show from the end of the logs + --timestamps(-t) # Show timestamps + --until: text # Show logs before a timestamp or relative time + --help # Print usage +] + +export complete [docker container logs] [ + container: by "nu-complete docker all-containers" # The container + --details # Show extra details provided to logs + --follow(-f) # Follow log output + --since: text # Show logs since timestamp (e.g. "2013-01-02T13:23:37Z") or relative (e.g. "42m") + --tail(-n): text # Number of lines to show from the end of the logs + --timestamps(-t) # Show timestamps + --until: text # Show logs before a timestamp or relative time + --help # Print usage +] + +export complete [docker stop] [ + ...containers: by "nu-complete docker containers" # The containers to stop + --signal(-s): signals # Signal to send to the container + --timeout(-t): text # Seconds to wait before killing the container + --time: text # Deprecated alias of --timeout + --help # Print usage +] + +export complete [docker container stop] [ + ...containers: by "nu-complete docker containers" # The containers to stop + --signal(-s): signals # Signal to send to the container + --timeout(-t): text # Seconds to wait before killing the container + --time: text # Deprecated alias of --timeout + --help # Print usage +] + +export complete [docker restart] [ + ...containers: by "nu-complete docker all-containers" # The containers to restart + --signal(-s): signals # Signal to send to the container + --timeout(-t): text # Seconds to wait before killing the container + --time: text # Deprecated alias of --timeout + --help # Print usage +] + +export complete [docker container restart] [ + ...containers: by "nu-complete docker all-containers" # The containers to restart + --signal(-s): signals # Signal to send to the container + --timeout(-t): text # Seconds to wait before killing the container + --time: text # Deprecated alias of --timeout + --help # Print usage +] + +export complete [docker start] [ + ...containers: by "nu-complete docker all-containers" # The containers to start + --attach(-a) # Attach STDOUT/STDERR and forward signals + --checkpoint: text # Restore from this checkpoint + --checkpoint-dir: dir # Use a custom checkpoint storage directory + --detach-keys: text # Override the key sequence for detaching a container + --interactive(-i) # Attach container's STDIN + --help # Print usage +] + +export complete [docker container start] [ + ...containers: by "nu-complete docker all-containers" # The containers to start + --attach(-a) # Attach STDOUT/STDERR and forward signals + --checkpoint: text # Restore from this checkpoint + --checkpoint-dir: dir # Use a custom checkpoint storage directory + --detach-keys: text # Override the key sequence for detaching a container + --interactive(-i) # Attach container's STDIN + --help # Print usage +] + +export complete [docker rm] [ + ...containers: by "nu-complete docker all-containers" # The containers to remove + --force(-f) # Force the removal of a running container (uses SIGKILL) + --link(-l) # Remove the specified link + --volumes(-v) # Remove anonymous volumes associated with the container + --help # Print usage +] + +export complete [docker container rm] [ + ...containers: by "nu-complete docker all-containers" # The containers to remove + --force(-f) # Force the removal of a running container (uses SIGKILL) + --link(-l) # Remove the specified link + --volumes(-v) # Remove anonymous volumes associated with the container + --help # Print usage +] + +export complete [docker kill] [ + ...containers: by "nu-complete docker containers" # The containers to kill + --signal(-s): signals # Signal to send to the container + --help # Print usage +] + +export complete [docker container kill] [ + ...containers: by "nu-complete docker containers" # The containers to kill + --signal(-s): signals # Signal to send to the container + --help # Print usage +] + +export complete [docker attach] [ + container: by "nu-complete docker containers" # The running container + --detach-keys: text # Override the key sequence for detaching a container + --no-stdin # Do not attach STDIN + --sig-proxy # Proxy all received signals to the process + --help # Print usage +] + +export complete [docker container attach] [ + container: by "nu-complete docker containers" # The running container + --detach-keys: text # Override the key sequence for detaching a container + --no-stdin # Do not attach STDIN + --sig-proxy # Proxy all received signals to the process + --help # Print usage +] + +export complete [docker top] [ + container: by "nu-complete docker containers" # The running container + ...ps_options: text # Options passed to ps + --help # Print usage +] + +export complete [docker container top] [ + container: by "nu-complete docker containers" # The running container + ...ps_options: text # Options passed to ps + --help # Print usage +] + +export complete [docker stats] [ + ...containers: by "nu-complete docker containers" # The containers to watch (default: all running) + --all(-a) # Show all containers (default shows just running) + --format: text # Format output using a custom template + --no-stream # Disable streaming stats and only pull the first result + --no-trunc # Do not truncate output + --help # Print usage +] + +export complete [docker container stats] [ + ...containers: by "nu-complete docker containers" # The containers to watch (default: all running) + --all(-a) # Show all containers (default shows just running) + --format: text # Format output using a custom template + --no-stream # Disable streaming stats and only pull the first result + --no-trunc # Do not truncate output + --help # Print usage +] + +export complete [docker cp] [ + source: path # CONTAINER:SRC_PATH, or a local path (- for stdin) + dest: path # CONTAINER:DEST_PATH, or a local path (- for stdout) + --archive(-a) # Archive mode (copy all uid/gid information) + --follow-link(-L) # Always follow symbol link in SRC_PATH + --quiet(-q) # Suppress progress output during copy + --help # Print usage +] + +export complete [docker container cp] [ + source: path # CONTAINER:SRC_PATH, or a local path (- for stdin) + dest: path # CONTAINER:DEST_PATH, or a local path (- for stdout) + --archive(-a) # Archive mode (copy all uid/gid information) + --follow-link(-L) # Always follow symbol link in SRC_PATH + --quiet(-q) # Suppress progress output during copy + --help # Print usage +] + +export complete [docker pause] [ + ...containers: by "nu-complete docker containers" # The containers to pause + --help # Print usage +] + +export complete [docker container pause] [ + ...containers: by "nu-complete docker containers" # The containers to pause + --help # Print usage +] + +export complete [docker unpause] [ + ...containers: by "nu-complete docker all-containers" # The containers to unpause + --help # Print usage +] + +export complete [docker container unpause] [ + ...containers: by "nu-complete docker all-containers" # The containers to unpause + --help # Print usage +] + +export complete [docker port] [ + container: by "nu-complete docker all-containers" # The container + port?: text # PRIVATE_PORT[/PROTO] + --help # Print usage +] + +export complete [docker container port] [ + container: by "nu-complete docker all-containers" # The container + port?: text # PRIVATE_PORT[/PROTO] + --help # Print usage +] + +export complete [docker rename] [ + container: by "nu-complete docker all-containers" # The container to rename + new_name: text # The new name + --help # Print usage +] + +export complete [docker container rename] [ + container: by "nu-complete docker all-containers" # The container to rename + new_name: text # The new name + --help # Print usage +] + +export complete [docker diff] [ + container: by "nu-complete docker all-containers" # The container + --help # Print usage +] + +export complete [docker container diff] [ + container: by "nu-complete docker all-containers" # The container + --help # Print usage +] + +export complete [docker export] [ + container: by "nu-complete docker all-containers" # The container + --output(-o): path # Write to a file, instead of STDOUT + --help # Print usage +] + +export complete [docker container export] [ + container: by "nu-complete docker all-containers" # The container + --output(-o): path # Write to a file, instead of STDOUT + --help # Print usage +] + +export complete [docker commit] [ + container: by "nu-complete docker all-containers" # The container + repository?: text # REPOSITORY[:TAG] for the new image + --author(-a): text # Author (e.g., "John Hannibal Smith ") + --change(-c): text # Apply Dockerfile instruction to the created image + --message(-m): text # Commit message + --pause(-p) # Pause container during commit + --help # Print usage +] + +export complete [docker container commit] [ + container: by "nu-complete docker all-containers" # The container + repository?: text # REPOSITORY[:TAG] for the new image + --author(-a): text # Author (e.g., "John Hannibal Smith ") + --change(-c): text # Apply Dockerfile instruction to the created image + --message(-m): text # Commit message + --pause(-p) # Pause container during commit + --help # Print usage +] + +export complete [docker update] [ + ...containers: by "nu-complete docker all-containers" # The containers to update + --blkio-weight: text # Block IO (relative weight), between 10 and 1000, or 0 to disable + --cpu-period: text # Limit CPU CFS (Completely Fair Scheduler) period + --cpu-quota: text # Limit CPU CFS (Completely Fair Scheduler) quota + --cpu-rt-period: text # Limit the CPU real-time period in microseconds + --cpu-rt-runtime: text # Limit the CPU real-time runtime in microseconds + --cpu-shares(-c): text # CPU shares (relative weight) + --cpus: text # Number of CPUs + --cpuset-cpus: text # CPUs in which to allow execution (0-3, 0,1) + --cpuset-mems: text # MEMs in which to allow execution (0-3, 0,1) + --memory(-m): text # Memory limit + --memory-reservation: text # Memory soft limit + --memory-swap: text # Swap limit equal to memory plus swap: -1 to enable unlimited swap + --pids-limit: text # Tune container pids limit (set -1 for unlimited) + --restart: words [no always on-failure unless-stopped] # Restart policy to apply when a container exits + --help # Print usage +] + +export complete [docker container update] [ + ...containers: by "nu-complete docker all-containers" # The containers to update + --blkio-weight: text # Block IO (relative weight), between 10 and 1000, or 0 to disable + --cpu-period: text # Limit CPU CFS (Completely Fair Scheduler) period + --cpu-quota: text # Limit CPU CFS (Completely Fair Scheduler) quota + --cpu-rt-period: text # Limit the CPU real-time period in microseconds + --cpu-rt-runtime: text # Limit the CPU real-time runtime in microseconds + --cpu-shares(-c): text # CPU shares (relative weight) + --cpus: text # Number of CPUs + --cpuset-cpus: text # CPUs in which to allow execution (0-3, 0,1) + --cpuset-mems: text # MEMs in which to allow execution (0-3, 0,1) + --memory(-m): text # Memory limit + --memory-reservation: text # Memory soft limit + --memory-swap: text # Swap limit equal to memory plus swap: -1 to enable unlimited swap + --pids-limit: text # Tune container pids limit (set -1 for unlimited) + --restart: words [no always on-failure unless-stopped] # Restart policy to apply when a container exits + --help # Print usage +] + +export complete [docker wait] [ + ...containers: by "nu-complete docker containers" # The containers to wait for + --help # Print usage +] + +export complete [docker container wait] [ + ...containers: by "nu-complete docker containers" # The containers to wait for + --help # Print usage +] + +export complete [docker inspect] [ + ...objects: by "nu-complete docker all-containers" # Names or IDs of the objects to inspect + --format(-f): text # Format output using a custom template + --size(-s) # Display total file sizes if the type is container + --type: words [config container image node network plugin secret service task volume] # Only inspect objects of the given type + --help # Print usage +] + +export complete [docker container inspect] [ + ...containers: by "nu-complete docker all-containers" # The containers to inspect + --format(-f): text # Format output using a custom template + --size(-s) # Display total file sizes + --help # Print usage +] + +export complete [docker container prune] [ + --filter: text # Provide filter values (e.g. "until=") + --force(-f) # Do not prompt for confirmation + --help # Print usage +] + +# --- Images ----------------------------------------------------------------------- + +export complete [docker build] [ + context?: path # Build context: a directory, a URL, or - for stdin + --add-host: text # Add a custom host-to-IP mapping ("host:ip") + --allow: text # Allow extra privileged entitlement (e.g., "network.host", "security.insecure") + --annotation: text # Add annotation to the image + --attest: text # Attestation parameters (format: "type=sbom,generator=image") + --build-arg: text # Set build-time variables + --build-context: text # Additional build contexts (e.g., name=path) + --builder: text # Override the configured builder instance + --cache-from: text # External cache sources (e.g., "user/app:cache", "type=local,src=path/to/dir") + --cache-to: text # Cache export destinations (e.g., "user/app:cache", "type=local,dest=path/to/dir") + --call: words [build check outline targets] # Set method for evaluating build + --cgroup-parent: text # Set the parent cgroup for the "RUN" instructions during build + --check # Shorthand for "--call=check" + --compress # Compress the build context using gzip (legacy builder) + --file(-f): path # Name of the Dockerfile (default: "PATH/Dockerfile") + --iidfile: path # Write the image ID to a file + --isolation: text # Container isolation technology (legacy builder) + --label: text # Set metadata for an image + --load # Shorthand for "--output=type=docker" + --metadata-file: path # Write build result metadata to a file + --network: text # Set the networking mode for the "RUN" instructions during build + --no-cache # Do not use cache when building the image + --no-cache-filter: text # Do not cache specified stages + --output(-o): text # Output destination (format: "type=local,dest=path") + --platform: text # Set target platform for build + --progress: words [auto quiet plain tty rawjson] # Set type of progress output + --provenance: text # Shorthand for "--attest=type=provenance" + --pull # Always attempt to pull all referenced images + --push # Shorthand for "--output=type=registry" + --quiet(-q) # Suppress the build output and print image ID on success + --sbom: text # Shorthand for "--attest=type=sbom" + --secret: text # Secret to expose to the build (format: "id=mysecret[,src=/local/secret]") + --shm-size: text # Shared memory size for build containers + --ssh: text # SSH agent socket or keys to expose to the build + --tag(-t): text # Image identifier (format: "[registry/]repository[:tag]") + --target: text # Set the target build stage to build + --ulimit: text # Ulimit options + --help # Print usage +] where { + at-most-one [--quiet --progress] + overrides [--check --call] +} + +export complete [docker image build] [ + context?: path # Build context: a directory, a URL, or - for stdin + --add-host: text # Add a custom host-to-IP mapping ("host:ip") + --allow: text # Allow extra privileged entitlement (e.g., "network.host", "security.insecure") + --annotation: text # Add annotation to the image + --attest: text # Attestation parameters (format: "type=sbom,generator=image") + --build-arg: text # Set build-time variables + --build-context: text # Additional build contexts (e.g., name=path) + --builder: text # Override the configured builder instance + --cache-from: text # External cache sources (e.g., "user/app:cache", "type=local,src=path/to/dir") + --cache-to: text # Cache export destinations (e.g., "user/app:cache", "type=local,dest=path/to/dir") + --call: words [build check outline targets] # Set method for evaluating build + --cgroup-parent: text # Set the parent cgroup for the "RUN" instructions during build + --check # Shorthand for "--call=check" + --compress # Compress the build context using gzip (legacy builder) + --file(-f): path # Name of the Dockerfile (default: "PATH/Dockerfile") + --iidfile: path # Write the image ID to a file + --isolation: text # Container isolation technology (legacy builder) + --label: text # Set metadata for an image + --load # Shorthand for "--output=type=docker" + --metadata-file: path # Write build result metadata to a file + --network: text # Set the networking mode for the "RUN" instructions during build + --no-cache # Do not use cache when building the image + --no-cache-filter: text # Do not cache specified stages + --output(-o): text # Output destination (format: "type=local,dest=path") + --platform: text # Set target platform for build + --progress: words [auto quiet plain tty rawjson] # Set type of progress output + --provenance: text # Shorthand for "--attest=type=provenance" + --pull # Always attempt to pull all referenced images + --push # Shorthand for "--output=type=registry" + --quiet(-q) # Suppress the build output and print image ID on success + --sbom: text # Shorthand for "--attest=type=sbom" + --secret: text # Secret to expose to the build (format: "id=mysecret[,src=/local/secret]") + --shm-size: text # Shared memory size for build containers + --ssh: text # SSH agent socket or keys to expose to the build + --tag(-t): text # Image identifier (format: "[registry/]repository[:tag]") + --target: text # Set the target build stage to build + --ulimit: text # Ulimit options + --help # Print usage +] where { + at-most-one [--quiet --progress] + overrides [--check --call] +} + +export complete [docker builder build] [ + context?: path # Build context: a directory, a URL, or - for stdin + --add-host: text # Add a custom host-to-IP mapping ("host:ip") + --allow: text # Allow extra privileged entitlement (e.g., "network.host", "security.insecure") + --annotation: text # Add annotation to the image + --attest: text # Attestation parameters (format: "type=sbom,generator=image") + --build-arg: text # Set build-time variables + --build-context: text # Additional build contexts (e.g., name=path) + --builder: text # Override the configured builder instance + --cache-from: text # External cache sources (e.g., "user/app:cache", "type=local,src=path/to/dir") + --cache-to: text # Cache export destinations (e.g., "user/app:cache", "type=local,dest=path/to/dir") + --call: words [build check outline targets] # Set method for evaluating build + --cgroup-parent: text # Set the parent cgroup for the "RUN" instructions during build + --check # Shorthand for "--call=check" + --compress # Compress the build context using gzip (legacy builder) + --file(-f): path # Name of the Dockerfile (default: "PATH/Dockerfile") + --iidfile: path # Write the image ID to a file + --isolation: text # Container isolation technology (legacy builder) + --label: text # Set metadata for an image + --load # Shorthand for "--output=type=docker" + --metadata-file: path # Write build result metadata to a file + --network: text # Set the networking mode for the "RUN" instructions during build + --no-cache # Do not use cache when building the image + --no-cache-filter: text # Do not cache specified stages + --output(-o): text # Output destination (format: "type=local,dest=path") + --platform: text # Set target platform for build + --progress: words [auto quiet plain tty rawjson] # Set type of progress output + --provenance: text # Shorthand for "--attest=type=provenance" + --pull # Always attempt to pull all referenced images + --push # Shorthand for "--output=type=registry" + --quiet(-q) # Suppress the build output and print image ID on success + --sbom: text # Shorthand for "--attest=type=sbom" + --secret: text # Secret to expose to the build (format: "id=mysecret[,src=/local/secret]") + --shm-size: text # Shared memory size for build containers + --ssh: text # SSH agent socket or keys to expose to the build + --tag(-t): text # Image identifier (format: "[registry/]repository[:tag]") + --target: text # Set the target build stage to build + --ulimit: text # Ulimit options + --help # Print usage +] where { + at-most-one [--quiet --progress] + overrides [--check --call] +} + +export complete [docker images] [ + repository?: text # Only show images of this repository[:tag] + --all(-a) # Show all images (default hides intermediate images) + --digests # Show digests + --filter(-f): text # Filter output based on conditions provided + --format: text # Format output using a custom template ('table', 'table TEMPLATE', 'json', 'TEMPLATE') + --no-trunc # Don't truncate output + --quiet(-q) # Only show image IDs + --tree # List multi-platform images as a tree + --help # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [docker image ls] [ + repository?: text # Only show images of this repository[:tag] + --all(-a) # Show all images (default hides intermediate images) + --digests # Show digests + --filter(-f): text # Filter output based on conditions provided + --format: text # Format output using a custom template ('table', 'table TEMPLATE', 'json', 'TEMPLATE') + --no-trunc # Don't truncate output + --quiet(-q) # Only show image IDs + --tree # List multi-platform images as a tree + --help # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [docker image list] [ + repository?: text # Only show images of this repository[:tag] + --all(-a) # Show all images (default hides intermediate images) + --digests # Show digests + --filter(-f): text # Filter output based on conditions provided + --format: text # Format output using a custom template ('table', 'table TEMPLATE', 'json', 'TEMPLATE') + --no-trunc # Don't truncate output + --quiet(-q) # Only show image IDs + --tree # List multi-platform images as a tree + --help # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [docker rmi] [ + ...images: by "nu-complete docker images" # The images to remove + --force(-f) # Force removal of the image + --no-prune # Do not delete untagged parents + --platform: text # Remove only the given platform variant + --help # Print usage +] + +export complete [docker image rm] [ + ...images: by "nu-complete docker images" # The images to remove + --force(-f) # Force removal of the image + --no-prune # Do not delete untagged parents + --platform: text # Remove only the given platform variant + --help # Print usage +] + +export complete [docker image remove] [ + ...images: by "nu-complete docker images" # The images to remove + --force(-f) # Force removal of the image + --no-prune # Do not delete untagged parents + --platform: text # Remove only the given platform variant + --help # Print usage +] + +export complete [docker pull] [ + image: by "nu-complete docker images" # NAME[:TAG|@DIGEST] + --all-tags(-a) # Download all tagged images in the repository + --disable-content-trust # Skip image verification + --platform: text # Set platform if server is multi-platform capable + --quiet(-q) # Suppress verbose output + --help # Print usage +] + +export complete [docker image pull] [ + image: by "nu-complete docker images" # NAME[:TAG|@DIGEST] + --all-tags(-a) # Download all tagged images in the repository + --disable-content-trust # Skip image verification + --platform: text # Set platform if server is multi-platform capable + --quiet(-q) # Suppress verbose output + --help # Print usage +] + +export complete [docker push] [ + image: by "nu-complete docker images" # NAME[:TAG] + --all-tags(-a) # Push all tags of an image to the repository + --disable-content-trust # Skip image signing + --platform: text # Push a platform-specific manifest as a single-platform image + --quiet(-q) # Suppress verbose output + --help # Print usage +] where { + at-most-one [--all-tags --platform] } -def "nu-complete docker images" [] { - ^docker images --format "{{.ID}} {{.Repository}}" | lines - | parse "{value} {description}" +export complete [docker image push] [ + image: by "nu-complete docker images" # NAME[:TAG] + --all-tags(-a) # Push all tags of an image to the repository + --disable-content-trust # Skip image signing + --platform: text # Push a platform-specific manifest as a single-platform image + --quiet(-q) # Suppress verbose output + --help # Print usage +] where { + at-most-one [--all-tags --platform] } -def "nu-complete docker run" [] { - (nu-complete docker images) - | append (nu-complete docker containers) +export complete [docker tag] [ + source: by "nu-complete docker images" # SOURCE_IMAGE[:TAG] + target: text # TARGET_IMAGE[:TAG] + --help # Print usage +] + +export complete [docker image tag] [ + source: by "nu-complete docker images" # SOURCE_IMAGE[:TAG] + target: text # TARGET_IMAGE[:TAG] + --help # Print usage +] + +export complete [docker save] [ + ...images: by "nu-complete docker images" # The images to save + --output(-o): path # Write to a file, instead of STDOUT + --platform: text # Save only the given platform variant + --help # Print usage +] + +export complete [docker image save] [ + ...images: by "nu-complete docker images" # The images to save + --output(-o): path # Write to a file, instead of STDOUT + --platform: text # Save only the given platform variant + --help # Print usage +] + +export complete [docker load] [ + --input(-i): path # Read from tar archive file, instead of STDIN + --platform: text # Load only the given platform variant + --quiet(-q) # Suppress the load output + --help # Print usage +] + +export complete [docker image load] [ + --input(-i): path # Read from tar archive file, instead of STDIN + --platform: text # Load only the given platform variant + --quiet(-q) # Suppress the load output + --help # Print usage +] + +export complete [docker history] [ + image: by "nu-complete docker images" # The image + --format: text # Format output using a custom template + --human(-H) # Print sizes and dates in human readable format + --no-trunc # Don't truncate output + --platform: text # Show history for the given platform + --quiet(-q) # Only show image IDs + --help # Print usage +] where { + at-most-one [--quiet --format] } -def "nu-complete docker pull" [] { - [always, missing, never] +export complete [docker image history] [ + image: by "nu-complete docker images" # The image + --format: text # Format output using a custom template + --human(-H) # Print sizes and dates in human readable format + --no-trunc # Don't truncate output + --platform: text # Show history for the given platform + --quiet(-q) # Only show image IDs + --help # Print usage +] where { + at-most-one [--quiet --format] } -def "nu-complete docker remove image" [] { - [local, all] +export complete [docker image inspect] [ + ...images: by "nu-complete docker images" # The images to inspect + --format(-f): text # Format output using a custom template + --platform: text # Inspect a specific platform of a multi-platform image + --help # Print usage +] + +export complete [docker image prune] [ + --all(-a) # Remove all unused images, not just dangling ones + --filter: text # Provide filter values (e.g. "until=") + --force(-f) # Do not prompt for confirmation + --help # Print usage +] + +export complete [docker search] [ + term: text # The search term + --filter(-f): text # Filter output based on conditions provided + --format: text # Pretty-print search using a Go template + --limit: text # Max number of search results + --no-trunc # Don't truncate output + --help # Print usage +] + +# --- Registry, version ------------------------------------------------------------ + +export complete [docker login] [ + server?: hosts # The registry server (default: Docker Hub) + --password(-p): text # Password or Personal Access Token + --password-stdin # Take the password or token from stdin + --username(-u): text # Username + --help # Print usage +] where { + excludes --password --password-stdin } -def "nu-complete local files" [] { - ^ls | lines +export complete [docker logout] [ + server?: hosts # The registry server (default: Docker Hub) + --help # Print usage +] + +export complete [docker version] [ + --format(-f): text # Format output using a custom template + --help # Print usage +] + +export complete [docker info] [ + --format(-f): text # Format output using a custom template + --help # Print usage +] + +# --- Compose ---------------------------------------------------------------------- + +export complete [docker compose] [ + --all-resources # Include all resources, even those not used by services + --ansi: words [never always auto] # Control when to print ANSI control characters + --compatibility # Run compose in backward compatibility mode + --dry-run # Execute command in dry run mode + --env-file: path # Specify an alternate environment file + --file(-f): path # Compose configuration files + --parallel: text # Control max parallelism, -1 for unlimited + --profile: text # Specify a profile to enable + --progress: words [auto tty plain json quiet] # Set type of progress output + --project-directory: dir # Specify an alternate working directory + --project-name(-p): text # Project name + --help # Print usage +] + +export complete [docker compose up] [ + ...services: by "nu-complete docker compose services" # The services to start + --abort-on-container-exit # Stops all containers if any container was stopped + --abort-on-container-failure # Stops all containers if any container exited with failure + --always-recreate-deps # Recreate dependent containers + --attach: by "nu-complete docker compose services" # Restrict attaching to the specified services + --attach-dependencies # Automatically attach to log output of dependent services + --build # Build images before starting containers + --detach(-d) # Detached mode: Run containers in the background + --exit-code-from: by "nu-complete docker compose services" # Return the exit code of the selected service container + --force-recreate # Recreate containers even if their configuration and image haven't changed + --menu # Enable interactive shortcuts when running attached + --no-attach: by "nu-complete docker compose services" # Do not attach (stream logs) to the specified services + --no-build # Don't build an image, even if it's policy + --no-color # Produce monochrome output + --no-deps # Don't start linked services + --no-log-prefix # Don't print prefix in logs + --no-recreate # If containers already exist, don't recreate them + --no-start # Don't start the services after creating them + --pull: words [always missing never] # Pull image before running + --quiet-pull # Pull without printing progress information + --remove-orphans # Remove containers for services not defined in the Compose file + --renew-anon-volumes(-V) # Recreate anonymous volumes instead of retrieving data from the previous containers + --scale: text # Scale SERVICE to NUM instances (SERVICE=NUM) + --timeout(-t): text # Use this timeout in seconds for container shutdown + --timestamps # Show timestamps + --wait # Wait for services to be running|healthy. Implies detached mode + --wait-timeout: text # Maximum duration in seconds to wait for the project to be running|healthy + --watch(-w) # Watch source code and rebuild/refresh containers when files are updated + --yes(-y) # Assume "yes" as answer to all prompts and run non-interactively + --help # Print usage + --dry-run # Execute command in dry run mode +] where { + at-most-one [--detach --abort-on-container-exit] + at-most-one [--no-build --build] + at-most-one [--force-recreate --no-recreate] } -def "nu-complete docker compose ps" [] { - ^docker compose ps -a --format "{{.ID}} {{.Names}}" | lines - | parse "{value} {description}" +export complete [docker compose down] [ + ...services: by "nu-complete docker compose services" # The services to stop and remove + --remove-orphans # Remove containers for services not defined in the Compose file + --rmi: words [all local] # Remove images used by services + --timeout(-t): text # Specify a shutdown timeout in seconds + --volumes(-v) # Remove named volumes declared in the "volumes" section and anonymous volumes + --help # Print usage + --dry-run # Execute command in dry run mode +] + +export complete [docker compose ps] [ + ...services: by "nu-complete docker compose services" # The services to list + --all(-a) # Show all stopped containers + --filter: text # Filter services by a property (supported filters: status) + --format: text # Format output using a custom template ('table', 'table TEMPLATE', 'json', 'TEMPLATE') + --no-trunc # Don't truncate output + --orphans # Include orphaned services (not declared by project) + --quiet(-q) # Only display IDs + --services # Display services + --status: words [paused restarting removing running dead created exited] # Filter services by status + --help # Print usage + --dry-run # Execute command in dry run mode +] where { + at-most-one [--quiet --format] } - -def "nu-complete docker compose service status" [] { - [paused restarting removing running dead created exited] -} - -def "nu-complete docker subcommands" [] { - # ^docker --help | lines | where $it =~ '^ {2}[A-Za-z]' | parse --regex '^ {2}([^\s*]+)\*?\s+.+$' - ^docker --help | lines | where $it =~ '^ {2}[A-Za-z]' | parse --regex '^ {2}(?P[^\s*]+)\*?\s+(?P.+)$' -} - -# Log in to a Docker registry -export extern "docker login" [ - server?: string #Docker registry URL - --password(-p): string #Password - --password-stdin #Take the password from stdin - --username(-u): string #Username -] - -# Log out from a Docker registry -export extern "docker logout" [ - server?: string #Docker registry URL -] - -# Search Docker Hub for images -export extern "docker search" [ - term?: string - --filter(-f): string #Filter output based on conditions provided - --format: string #Pretty-print search using a Go template - --limit: int #Max number of search results - --no-trunc #Don't truncate output -] - -# Show the docker version information -export extern "docker version" [ - --format(-f): string #Format the output using the given Go template - --kubeconfig: string #Kubernetes config file -] - -# Inspect changes to files or directories on a container's filesystem -export extern "docker system events" [ - --filter(-f): string #Filter output based on conditions provided - --format: string #Pretty-print images using a Go template - --since: string #Show all events created since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) - --until: string #Stream events until this timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) -] - -# Attach local standard input, output, and error streams to a running container -export extern "docker container attach" [ - container?: string@"nu-complete docker containers" - --detach-keys:string #Override the key sequence for detaching a container - --no-stdin #Do not attach STDIN - --sig-proxy #Proxy all received signals to the process -] - -# Create a new image from a container's changes -export extern "docker container commit" [ - container?: string@"nu-complete docker containers" - --author(-a): string #Author (e.g., "John Hannibal Smith " - --change(-c): string #Apply Dockerfile instruction to the created image - --message(-m): string #Commit message - --pause(-p) #Pause container during commit (default true) -] - -# Create a new container -export extern "docker container create" [ - image?: string@"nu-complete docker images" #The image to create the container from - command?: string #Command to run inside the container - ...args: string - --add-host: string #Add a custom host-to-IP mapping (host:ip) - --annotation: string #Add an annotation to the container (passed through to the OCI runtime) (default map[]) - --attach: string #Attach to STDIN, STDOUT or STDERR - --blkio-weight: int #Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) - --blkio-weight-device: string #Block IO weight (relative device weight) (default []) - --cap-add: string #Add Linux capabilities - --cap-drop: string #Drop Linux capabilities - --cgroup-parent: string #Optional parent cgroup for the container - --cgroupns: string #Cgroup namespace to use (host|private) - --cidfile: string #Write the container ID to the file - --cpu-period: int #Limit CPU CFS (Completely Fair Scheduler) period - --cpu-quota: int #Limit CPU CFS (Completely Fair Scheduler) quota - --cpu-rt-period: int #Limit CPU real-time period in microseconds - --cpu-rt-runtime: int #Limit CPU real-time runtime in microseconds - --cpu-shares(-c): int #CPU shares (relative weight) - --cpus: int #Number of CPUs - --cpuset-cpus: string #CPUs in which to allow execution (0-3, 0,1) - --cpuset-mems: string #MEMs in which to allow execution (0-3, 0,1) - --detach(-d) #Run container in background and print container ID - --detach-keys: string #Override the key sequence for detaching a container - --device: string #Add a host device to the container - --device-cgroup-rule: string #Add a rule to the cgroup allowed devices list - --device-read-bps: int #Limit read rate (bytes per second) from a device (default []) - --device-read-iops: int #Limit read rate (IO per second) from a device (default []) - --device-write-bps: int #Limit write rate (bytes per second) to a device (default []) - --device-write-iops: int #Limit write rate (IO per second) to a device (default []) - --disable-content-trust #Skip image verification (default true) - --dns: int #Set custom DNS servers - --dns-option: string #Set DNS options - --dns-search: string #Set custom DNS search domains - --domainname: string #Container NIS domain name - --entrypoint: string #Overwrite the default ENTRYPOINT of the image - --env(-e): string #Set environment variables - --env-file: string #Read in a file of environment variables - --expose: string #Expose a port or a range of ports - --gpus: string #GPU devices to add to the container ('all' to pass all GPUs) - --group-add: string #Add additional groups to join - --health-cmd: string #Command to run to check health - --health-interval: duration #Time between running the check (ms|s|m|h) (default 0s) - --health-retries: int #Consecutive failures needed to report unhealthy - --health-start-interval: duration #Time between running the check during the start period (ms|s|m|h) (default 0s) - --health-start-period: duration #Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s) - --health-timeout: duration #Maximum time to allow one check to run (ms|s|m|h) (default 0s) - --help #Print usage - --hostname(-h): string #Container host name - --init #Run an init inside the container that forwards signals and reaps processes - --interactive(-i) #Keep STDIN open even if not attached - --ip: string #IPv4 address (e.g., 172.30.100.104) - --ip6: string #IPv6 address (e.g., 2001:db8::33) - --ipc: string #IPC mode to use - --isolation: string #Container isolation technology - --kernel-memory: int #Kernel memory limit - --label(-l): string #Set meta data on a container - --label-file: string #Read in a line delimited file of labels - --link: string #Add link to another container - --link-local-ip: string #Container IPv4/IPv6 link-local addresses - --log-driver: string #Logging driver for the container - --log-opt: string #Log driver options - --mac-address: string #Container MAC address (e.g., 92:d0:c6:0a:29:33) - --memory(-m): int #Memory limit - --memory-reservation: int #Memory soft limit - --memory-swap: int #Swap limit equal to memory plus swap: '-1' to enable unlimited swap - --memory-swappiness: int #Tune container memory swappiness (0 to 100) (default -1) - --mount: string #Attach a filesystem mount to the container - --name: string #Assign a name to the container - --network: string #Connect a container to a network - --network-alias: string #Add network-scoped alias for the container - --no-healthcheck #Disable any container-specified HEALTHCHECK - --oom-kill-disable #Disable OOM Killer - --oom-score-adj: int #Tune host's OOM preferences (-1000 to 1000) - --pid: string #PID namespace to use - --pids-limit: int #Tune container pids limit (set -1 for unlimited) - --platform: string #Set platform if server is multi-platform capable - --privileged #Give extended privileges to this container - --publish(-p): string #Publish a container's port(s) to the host - --publish-all(-P) #Publish all exposed ports to random ports - --pull: string@"nu-complete docker pull" #Pull image before running ("always", "missing", "never") (default "missing") - --quiet(-q) #Suppress the pull output - --read-only #Mount the container's root filesystem as read only - --restart: string #Restart policy to apply when a container #exits (default "no") - --rm #Automatically remove the container when it exits - --runtime: string #Runtime to use for this container - --security-opt: string #Security Options - --shm-size: int #Size of /dev/shm - --sig-proxy #Proxy received signals to the process (default true) - --stop-signal: string #Signal to stop the container - --stop-timeout: int #Timeout (in seconds) to stop a container - --storage-opt: string #Storage driver options for the container - --sysctl: string #Sysctl options (default map[]) - --tmpfs: string #Mount a tmpfs directory - --tty(-t) #Allocate a pseudo-TTY - --ulimit: int #Ulimit options (default []) - --user(-u): string #Username or UID (format: [:]) - --userns: string #User namespace to use - --uts: string #UTS namespace to use - --volume(-v): string #Bind mount a volume - --volume-driver: string #Optional volume driver for the container - --volumes-from: string #Mount volumes from the specified container(s) - --workdir(-w): string #Working directory inside the container -] - -# Inspect changes to files or directories on a container's filesystem -export extern "docker container diff" [ - container?: string@"nu-complete docker containers" -] - -# Run a command in a running container -export extern "docker container exec" [ - container?: string@"nu-complete docker containers" - --detach(-d) #Detached mode: run command in the background - --env(-e): string #Set environment variables - --interactive(-i) #Keep STDIN open even if not attached - --privileged #Give extended privileges to the command - --tty(-t) #Allocate a pseudo-TTY - --user(-u): string #Username or UID (format: [:]) - --workdir(-w): string #Working directory inside the container -] - -# Export a container's filesystem as a tar archive -export extern "docker container export" [ - container?: string@"nu-complete docker containers" - --output(-o): string #Write to a file, instead of STDOUT -] - -# Display detailed information on one or more containers -export extern "docker container inspect" [ - container?: string@"nu-complete docker containers" - --format(-f):string #Format the output using the given Go template - --size(-s) #Display total file sizes - --type:string #Return JSON for specified type -] - -# Kill one or more running containers -export extern "docker container kill" [ - container?: string@"nu-complete docker containers" - --signal(-s):string #Signal to send to the container -] - -# Fetch the logs of a container -export extern "docker container logs" [ - container?: string@"nu-complete docker containers" - --details #Show extra details provided to logs - --follow(-f) #Follow log output - --since: string #Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) - --tail(-n): string #Number of lines to show from the end of the logs - --timestamps(-t) #Show timestamps - --until: string #Show logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) -] - -# List containers -export extern "docker container ls" [ - --all(-a) #Show all containers (default shows just running) - --filter: string #Filter output based on conditions provided - --format: string #Pretty-print containers using a Go template - --last(-n): int #Show n last created containers (includes all states) (default -1) - --latest(-l) #Show the latest created container (includes all states) - --no-trunc #Don't truncate output - --quiet(-q) #Only display numeric IDs - --size(-s) #Display total file sizes -] - -# Pause all processes within one or more containers -export extern "docker container pause" [ - container?: string@"nu-complete docker containers" -] - -# Remove all stopped containers -export extern "docker container prune" [ - --filter: string #Provide filter values (e.g. 'until=24h') - --force(-f) #Do not prompt for confirmation -] - -# List port mappings or a specific mapping for the container -export extern "docker container port" [ - container?: string@"nu-complete docker containers" -] - -# Rename a container -export extern "docker container rename" [ - container?: string@"nu-complete docker containers" - name?: string -] - -# Restart one or more containers -export extern "docker container restart" [ - container?: string@"nu-complete docker containers" - --time(-t): int #Seconds to wait for stop before killing the container - --signal(-s): string #Signal to stop the container -] - -# Remove one or more containers -export extern "docker container rm" [ - container?: string@"nu-complete docker containers" -] - -# Run a command in a new container -export extern "docker container run" [ - image?: string@"nu-complete docker run" #The image to create the container from - command?: string #Command to run inside the container - ...args: string - --add-host: string #Add a custom host-to-IP mapping (host:ip) - --annotation: string #Add an annotation to the container (passed through to the OCI runtime) (default map[]) - --attach: string #Attach to STDIN, STDOUT or STDERR - --blkio-weight: int #Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) - --blkio-weight-device: string #Block IO weight (relative device weight) (default []) - --cap-add: string #Add Linux capabilities - --cap-drop: string #Drop Linux capabilities - --cgroup-parent: string #Optional parent cgroup for the container - --cgroupns: string #Cgroup namespace to use (host|private) - --cidfile: string #Write the container ID to the file - --cpu-period: int #Limit CPU CFS (Completely Fair Scheduler) period - --cpu-quota: int #Limit CPU CFS (Completely Fair Scheduler) quota - --cpu-rt-period: int #Limit CPU real-time period in microseconds - --cpu-rt-runtime: int #Limit CPU real-time runtime in microseconds - --cpu-shares(-c): int #CPU shares (relative weight) - --cpus: int #Number of CPUs - --cpuset-cpus: string #CPUs in which to allow execution (0-3, 0,1) - --cpuset-mems: string #MEMs in which to allow execution (0-3, 0,1) - --detach(-d) #Run container in background and print container ID - --detach-keys: string #Override the key sequence for detaching a container - --device: string #Add a host device to the container - --device-cgroup-rule: string #Add a rule to the cgroup allowed devices int - --device-read-bps: int #Limit read rate (bytes per second) from a device (default []) - --device-read-iops: int #Limit read rate (IO per second) from a device (default []) - --device-write-bps: int #Limit write rate (bytes per second) to a device (default []) - --device-write-iops: int #Limit write rate (IO per second) to a device (default []) - --disable-content-trust #Skip image verification (default true) - --dns: int #Set custom DNS servers - --dns-option: string #Set DNS options - --dns-search: string #Set custom DNS search domains - --domainname: string #Container NIS domain name - --entrypoint: string #Overwrite the default ENTRYPOINT of the image - --env(-e): string #Set environment variables - --env-file: string #Read in a file of environment variables - --expose: string #Expose a port or a range of ports - --gpus: string #GPU devices to add to the container ('all' to pass all GPUs) - --group-add: string #Add additional groups to join - --health-cmd: string #Command to run to check health - --health-interval: duration #Time between running the check (ms|s|m|h) (default 0s) - --health-retries: int #Consecutive failures needed to report unhealthy - --health-start-interval: duration #Time between running the check during the start period (ms|s|m|h) (default 0s) - --health-start-period: duration #Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s) - --health-timeout: duration #Maximum time to allow one check to run (ms|s|m|h) (default 0s) - --help #Print usage - --hostname(-h): string #Container host name - --init #Run an init inside the container that forwards signals and reaps processes - --interactive(-i) #Keep STDIN open even if not attached - --ip: string #IPv4 address (e.g., 172.30.100.104) - --ip6: string #IPv6 address (e.g., 2001:db8::33) - --ipc: string #IPC mode to use - --isolation: string #Container isolation technology - --kernel-memory: int #Kernel memory limit - --label(-l): string #Set meta data on a container - --label-file: string #Read in a line delimited file of labels - --link: string #Add link to another container - --link-local-ip: string #Container IPv4/IPv6 link-local addresses - --log-driver: string #Logging driver for the container - --log-opt: string #Log driver options - --mac-address: string #Container MAC address (e.g., 92:d0:c6:0a:29:33) - --memory(-m): int #Memory limit - --memory-reservation: int #Memory soft limit - --memory-swap: int #Swap limit equal to memory plus swap: '-1' to enable unlimited swap - --memory-swappiness: int #Tune container memory swappiness (0 to 100) (default -1) - --mount: string #Attach a filesystem mount to the container - --name: string #Assign a name to the container - --network: string #Connect a container to a network - --network-alias: string #Add network-scoped alias for the container - --no-healthcheck #Disable any container-specified HEALTHCHECK - --oom-kill-disable #Disable OOM Killer - --oom-score-adj: int #Tune host's OOM preferences (-1000 to 1000) - --pid: string #PID namespace to use - --pids-limit: int #Tune container pids limit (set -1 for unlimited) - --platform: string #Set platform if server is multi-platform capable - --privileged #Give extended privileges to this container - --publish(-p): string #Publish a container's port(s) to the host - --publish-all(-P) #Publish all exposed ports to random ports - --pull: string@"nu-complete docker pull" #Pull image before running ("always", "missing", "never") (default "missing") - --quiet(-q) #Suppress the pull output - --read-only #Mount the container's root filesystem as read only - --restart: string #Restart policy to apply when a container #exits (default "no") - --rm #Automatically remove the container when it exits - --runtime: string #Runtime to use for this container - --security-opt: string #Security Options - --shm-size: int #Size of /dev/shm - --sig-proxy #Proxy received signals to the process (default true) - --stop-signal: string #Signal to stop the container - --stop-timeout: int #Timeout (in seconds) to stop a container - --storage-opt: string #Storage driver options for the container - --sysctl: string #Sysctl options (default map[]) - --tmpfs: string #Mount a tmpfs directory - --tty(-t) #Allocate a pseudo-TTY - --ulimit: int #Ulimit options (default []) - --user(-u): string #Username or UID (format: [:]) - --userns: string #User namespace to use - --uts: string #UTS namespace to use - --volume(-v): string #Bind mount a volume - --volume-driver: string #Optional volume driver for the container - --volumes-from: string #Mount volumes from the specified container(s) - --workdir(-w): string #Working directory inside the container -] - -# Start one or more stopped containers -export extern "docker container start" [ - container?: string@"nu-complete docker containers" - --attach(-a) #Attach STDOUT/STDERR and forward signals - --interactive(-i) #Attach container's STDIN - --detach-keys: string #Override the key sequence for detaching a container -] - -# Display a live stream of container(s) resource usage statistics -export extern "docker container stats" [ - container?: string@"nu-complete docker containers" - --all(-a) #Show all containers (default shows just running) - --format: string #Pretty-print images using a Go template - --no-stream #Disable streaming stats and only pull the first result - --no-trunc #Do not truncate output -] - -# Stop one or more running containers -export extern "docker container stop" [ - container?: string@"nu-complete docker containers" - --time(-t): int #Seconds to wait for stop before killing the container - --signal(-s): int #Signal to stop the container -] - -# Display the running processes of a container -export extern "docker container top" [ - container?: string@"nu-complete docker containers" -] - -# Unpause all processes within one or more containers -export extern "docker container unpause" [ - container?: string@"nu-complete docker containers" -] - -# Update configuration of one or more containers -export extern "docker container update" [ - container?: string@"nu-complete docker containers" - --blkio-weight: int #Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) - --cpu-period: int #Limit CPU CFS (Completely Fair Scheduler) period - --cpu-quota: int #Limit CPU CFS (Completely Fair Scheduler) quota - --cpu-rt-period: int #Limit CPU real-time period in microseconds - --cpu-rt-runtime: int #Limit CPU real-time runtime in microseconds - --cpu-shares(-c): int #CPU shares (relative weight) - --cpus: float #Number of CPUs - --cpuset-cpus: string #CPUs in which to allow execution (0-3, 0,1) - --cpuset-mems: string #MEMs in which to allow execution (0-3, 0,1) - --memory(-m): binary #Memory limit - --memory-reservation: binary #Memory soft limit - --memory-swap: binary #Swap limit equal to memory plus swap: '-1' to enable unlimited swap - --pids-limit: int #Tune container pids limit (set -1 for unlimited) - --restart: string #Restart policy to apply when a container #exits (default "no") -] - -# Block until one or more containers stop, then print their exit codes -export extern "docker container wait" [ - container?: string@"nu-complete docker containers" -] - -# Build an image from a Dockerfile -export extern "docker image build" [ - --add-host: string #Add a custom host-to-IP mapping (host:ip) - --build-arg: string #Set build-time variables - --cache-from: string #Images to consider as cache sources - --cgroup-parent: string #Optional parent cgroup for the container - --compress #Compress the build context using gzip - --file(-f): string@"nu-complete local files" #Name of the Dockerfile (Default is 'PATH/Dockerfile') - --iidfile: string #Write the image ID to the file - --isolation: string #Container isolation technology - --label: string #Set metadata for an image - --network: string #Set the networking mode for the RUN instructions during build (default "default") - --no-cache #Do not use cache when building the image - --platform: string #Set platform if server is multi-platform capable - --progress: string #Set type of progress output (auto, plain, tty). Use plain to show container output - --pull #Always attempt to pull a newer version of the image - --quiet(-q) #Suppress the build output and print image ID on success - --secret: string #Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret - --ssh: string #SSH agent socket or keys to expose to the build (only if BuildKit enabled) - --tag(-t): string #Name and optionally a tag in the 'name:tag' format - --target: string #Set the target build stage to build - --ulimit: string #Ulimit options (default []) -] - -# Show the history of an images -export extern "docker image history" [ - image?: string@"nu-complete docker images" - --format: string #Pretty-print images using a Go template - --no-trunc #Don't truncate output - --quiet(-q) #Only show numeric IDs -] - -# Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE -export extern "docker image tag" [ - source?: string@"nu-complete docker images" - target?: string@"nu-complete docker images" -] - -# List images -export extern "docker image ls" [ - --all(-a) #Show all images (default hides intermediate images) - --digests #Show digests - --filter: string #Filter output based on conditions provided - --format: string #Pretty-print images using a Go template - --no-trunc #Don't truncate output - --quiet(-q) #Only show numeric IDs -] - -# Download an image from a registry -export extern "docker image pull" [ - image?: string@"nu-complete docker images" - --all-tags(-a) #Push all tags of the specified image - --disable-content-trust #Skip image verification (default true) - --plataform: string #Set platform if server is multi-platform capable - --quiet(-q) #Suppress the push output -] - -# Upload an image to a registry -export extern "docker image push" [ - image?: string@"nu-complete docker images" - --all-tags(-a) #Push all tags of the specified image - --disable-content-trust #Skip image verification (default true) - --quiet(-q) #Suppress the push output -] - -# Save one or more images to a tar archive (streamed to STDOUT by default) -export extern "docker image save" [ - image?: string@"nu-complete docker images" - --output(-o): string #Write to a file, instead of STDOUT -] - -# Delete one or more docker image -export extern "docker image rm" [ - ...image: string@"nu-complete docker images" - --force(-f) #Force removal of the image - --no-prune #Do not delete untagged parents -] - -# Extended build capabilities with BuildKit -export extern "docker buildx" [ - --builder: string #Override the configured builder instance (default "default") -] - -# Stop and remove containers, networks -export extern "docker compose down" [ - --dry-run #Execute command in dry run mode - --remove-orphans #Remove containers for services not defined in the Compose file - --rmi: string@"nu-complete docker remove image" #Remove images used by services. "local" remove only images that don't have a custom tag ("local"|"all") - --timeout(-t): int #Specify a shutdown timeout in seconds - --volumes(-v) #Remove named volumes declared in the "volumes" section of the Compose file and anonymous volumes attached to containers -] - -# List containers -export extern "docker compose ps" [ - --all(-a) #Show all stopped containers (including those created by the run command) - --dry-run #Execute command in dry run mode - --filter: string #Filter services by a property (supported filters: status) - --format: string #Format output using a custom template: 'table': Print output in table; format with column headers (default) 'table TEMPLATE': Print output in table; format using the given Go template 'json': Print in JSON format; 'TEMPLATE': Print output using the given Go template; Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates (default "table") - --no-truncate #Don't truncate output - --orphans #Include orphaned services (not declared by project) (default true) - --quite(-q) #Only display IDs - --services #Display services - --status: string@"nu-complete docker compose service status" #Filter services by status. Values: [paused | restarting | removing | running | dead | created | exited] -] - -# Stop containers -export extern "docker compose stop" [ - --dry-run #Execute command in dry run mode - --timeout(-t): int #Specify a shutdown timeout in seconds -] - -# Restart service containers -export extern "docker compose restart" [ - --dry-run #Execute command in dry run mode - --no-deps #Don't restart dependent services - --timeout(-t): int #Specify a shutdown timeout in seconds -] - -# Create and start containers -export extern "docker compose up" [ - --abort-on-container-exit #Stops all containers if any container was stopped. Incompatible with -d/--detach - --abort-on-container-failure #Stops all containers if any container had a non-zero exit code. Incompatible with -d/--detach - --always-recreate-deps #Recreate dependent containers. Incompatible with --no-recreate - --attach: string #Restrict attaching to the specified services. Incompatible with --attach-dependencies - --attach-dependencies #Automatically attach to log output of all dependent services - --build #Build images before starting containers - --detach(-d) #Detached mode: Run containers in the background - --dry-run #Execute command in dry run mode - --exit-code-from: string #Return the exit code of the selected service container. Implies --abort-on-container-exit - --force-recreate #Recreate containers even if their configuration and image haven't changed - --menu #Enable interactive shortcuts when running attached. Incompatible with --detach. Can also be enable/disable - --no-attach: string #Do not attach (stream logs) to the specified services - --no-build #Don't build an image, even if it's policy - --no-color #Produce monochrome output - --no-deps #Don't start linked services - --no-log-prefix #Don't print prefix in logs - --no-recreate #If containers already exist, don't recreate them. Incompatible with --force-recreate - --no-start #Don't start the services after creating them - --pull: string@"nu-complete docker pull" #Pull image before running ("always"|"missing"|"never") (default "policy") - --quite-pull #Pull without printing progress information - --remove-orphans #Remove containers for services not defined in the Compose file - --renew-anon-volumes(-V) #Recreate anonymous volumes instead of retrieving data from the previous containers - # --scale: scale #Scale SERVICE to NUM instances. Overrides the scale setting in the Compose file if present - --timeout(-t): int #Use this timeout in seconds for container shutdown when attached or when containers are already running - --timestamps #Show timestamps - --wait #Wait for services to be running|healthy. Implies detached mode - --wait-timeout: int #Maximum duration to wait for the project to be running|healthy - --watch(-w) #Watch source code and rebuild|refresh containers when files are updated -] - -# An open-source container management platform. -export extern "docker" [ - command?: string@"nu-complete docker subcommands" #Subcommands - --config: string #Location of client config files (default "/root/.docker") - --context(-c): string #Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker context use") - --debug(-D) #Enable debug mode - --host(-H): string #Daemon socket(s) to connect to - --log-level(-l): string #Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") - --tls #Use TLS; implied by --tlsverify - --tlscacert: string #Trust certs signed only by this CA - --tlscert: string #Path to TLS certificate file - --tlskey: string #Path to TLS key file - --tlsverify #Use TLS and verify the remote - --version(-v) #Print version information and quit -] - -# Attach local standard input, output, and error streams to a running container -export alias "docker attach" = docker container attach -# Create a new image from a container's changes -export alias "docker commit" = docker container commit -export alias "docker cp" = docker container cp -# Create a new container -export alias "docker create" = docker container create -# Inspect changes to files or directories on a container's filesystem -export alias "docker diff" = docker container diff -# Execute a command in a running container -export alias "docker exec" = docker container exec -# Export a container's filesystem as a tar archive -export alias "docker export" = docker container export -# Display detailed information on one or more containers -export alias "docker inspect" = docker container inspect -# Kill one or more running containers -export alias "docker kill" = docker container kill -# Fetch the logs of a container -export alias "docker logs" = docker container logs -# Pause all processes within one or more containers -export alias "docker pause" = docker container pause -# List port mappings or a specific mapping for the container -export alias "docker port" = docker container port -# Rename a container -export alias "docker rename" = docker container rename -# Restart one or more containers -export alias "docker restart" = docker container restart -# List containers -export alias "docker ps" = docker container ls -# Remove one or more containers -export alias "docker rm" = docker container rm -# Run a command in a new container -export alias "docker run" = docker container run -# Start one or more stopped containers -export alias "docker start" = docker container start -# Display a live stream of container(s) resource usage statistics -export alias "docker stats" = docker container stats -# Stop one or more running containers -export alias "docker stop" = docker container stop -# Display the running processes of a container -export alias "docker top" = docker container top -# Unpause all processes within one or more containers -export alias "docker unpause" = docker container unpause -# Update configuration of one or more containers -export alias "docker update" = docker container update -# Block until one or more containers stop, then print their exit codes -export alias "docker wait" = docker container wait - -# Build an image from a Dockerfile -export alias "docker build" = docker image build -# Show the history of an image -export alias "docker history" = docker image history -# Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE -export alias "docker tag" = docker image tag -# List images -export alias "docker images" = docker image ls -# Remove one or more images -export alias "docker rmi" = docker image rm -# Download an image from a registry -export alias "docker pull" = docker image pull -# Upload an image to a registry -export alias "docker push" = docker image push -# Save one or more images to a tar archive (streamed to STDOUT by default) -export alias "docker save" = docker image save - -# Inspect changes to files or directories on a container's filesystem -export alias "docker events" = docker system events + +export complete [docker compose logs] [ + ...services: by "nu-complete docker compose services" # The services whose logs to show + --follow(-f) # Follow log output + --index: text # Index of the container if service has multiple replicas + --no-color # Produce monochrome output + --no-log-prefix # Don't print prefix in logs + --since: text # Show logs since timestamp or relative (e.g. 42m) + --tail(-n): text # Number of lines to show from the end of the logs for each container + --timestamps(-t) # Show timestamps + --until: text # Show logs before a timestamp or relative time + --help # Print usage +] + +export complete [docker compose build] [ + ...services: by "nu-complete docker compose services" # The services to build + --build-arg: text # Set build-time variables for services + --builder: text # Set builder to use + --check # Check build configuration + --memory(-m): text # Set memory limit for the build container + --no-cache # Do not use cache when building the image + --print # Print equivalent bake file + --pull # Always attempt to pull a newer version of the image + --push # Push service images + --quiet(-q) # Don't print anything to STDOUT + --ssh: text # Set SSH authentications used when building service images + --with-dependencies # Also build dependencies (transitively) + --help # Print usage +] + +export complete [docker compose exec] [ + service: by "nu-complete docker compose services" # The service + ...command: command # The command to run, and its arguments + --detach(-d) # Detached mode: Run command in the background + --env(-e): env-assign # Set environment variables + --index: text # Index of the container if service has multiple replicas + --no-TTY(-T) # Disable pseudo-TTY allocation + --privileged # Give extended privileges to the process + --user(-u): users # Run the command as this user + --workdir(-w): text # Path to workdir directory for this command + --help # Print usage +] + +export complete [docker compose run] [ + service: by "nu-complete docker compose services" # The service + ...command: command # The command to run, and its arguments + --build # Build image before starting container + --cap-add: text # Add Linux capabilities + --cap-drop: text # Drop Linux capabilities + --detach(-d) # Run container in background and print container ID + --entrypoint: text # Override the entrypoint of the image + --env(-e): env-assign # Set environment variables + --env-from-file: path # Set environment variables from file + --interactive(-i) # Keep STDIN open even if not attached + --label(-l): text # Add or override a label + --name: text # Assign a name to the container + --no-TTY(-T) # Disable pseudo-TTY allocation + --no-deps # Don't start linked services + --publish(-p): docker.port with { root.proto: by "nu-complete docker protocols" } # Publish a container's port(s) to the host + --pull: words [always missing never] # Pull image before running + --quiet-pull # Pull without printing progress information + --remove-orphans # Remove containers for services not defined in the Compose file + --rm # Automatically remove the container when it exits + --service-ports # Run command with all service's ports enabled and mapped to the host + --use-aliases # Use the service's network aliases in the network(s) the container connects to + --user(-u): users # Run as specified username or uid + --volume(-v): text # Bind mount a volume + --workdir(-w): text # Working directory inside the container + --help # Print usage +] + +export complete [docker compose pull] [ + ...services: by "nu-complete docker compose services" # The services to pull + --ignore-buildable # Ignore images that can be built + --ignore-pull-failures # Pull what it can and ignores images with pull failures + --include-deps # Also pull services declared as dependencies + --policy: words [missing always] # Apply pull policy + --quiet(-q) # Pull without printing progress information + --help # Print usage +] + +export complete [docker compose restart] [ + ...services: by "nu-complete docker compose services" # The services to restart + --no-deps # Don't restart dependent services + --timeout(-t): text # Specify a shutdown timeout in seconds + --help # Print usage + --dry-run # Execute command in dry run mode +] + +export complete [docker compose stop] [ + ...services: by "nu-complete docker compose services" # The services to stop + --timeout(-t): text # Specify a shutdown timeout in seconds + --help # Print usage + --dry-run # Execute command in dry run mode +] + +export complete [docker compose start] [ + ...services: by "nu-complete docker compose services" # The services to start + --wait # Wait for services to be running|healthy + --wait-timeout: text # Maximum duration in seconds to wait for the project to be running|healthy + --help # Print usage +] + +# --- Networks --------------------------------------------------------------------- + +export complete [docker network create] [ + name: text # The name of the new network + --attachable # Enable manual container attachment + --aux-address: text # Auxiliary IPv4 or IPv6 addresses used by Network driver + --config-from: by "nu-complete docker networks" # The network from which to copy the configuration + --config-only # Create a configuration only network + --driver(-d): words [bridge overlay macvlan ipvlan host none] # Driver to manage the Network + --gateway: text # IPv4 or IPv6 Gateway for the master subnet + --ingress # Create swarm routing-mesh network + --internal # Restrict external access to the network + --ip-range: text # Allocate container ip from a sub-range + --ipam-driver: text # IP Address Management Driver + --ipam-opt: text # Set IPAM driver specific options + --ipv4 # Enable or disable IPv4 address assignment + --ipv6 # Enable or disable IPv6 address assignment + --label: text # Set metadata on a network + --opt(-o): text # Set driver specific options + --scope: words [local swarm global] # Control the network's scope + --subnet: text # Subnet in CIDR format that represents a network segment + --help # Print usage +] + +export complete [docker network ls] [ + --filter(-f): text # Provide filter values (e.g. "driver=bridge") + --format: text # Format output using a custom template + --no-trunc # Do not truncate the output + --quiet(-q) # Only display network IDs + --help # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [docker network list] [ + --filter(-f): text # Provide filter values (e.g. "driver=bridge") + --format: text # Format output using a custom template + --no-trunc # Do not truncate the output + --quiet(-q) # Only display network IDs + --help # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [docker network rm] [ + ...networks: by "nu-complete docker networks" # The networks to remove + --force(-f) # Do not error if the network does not exist + --help # Print usage +] + +export complete [docker network remove] [ + ...networks: by "nu-complete docker networks" # The networks to remove + --force(-f) # Do not error if the network does not exist + --help # Print usage +] + +export complete [docker network inspect] [ + ...networks: by "nu-complete docker networks" # The networks to inspect + --format(-f): text # Format output using a custom template + --verbose(-v) # Verbose output for diagnostics + --help # Print usage +] + +export complete [docker network connect] [ + network: by "nu-complete docker networks" # The network + container: by "nu-complete docker all-containers" # The container to connect + --alias: text # Add network-scoped alias for the container + --driver-opt: text # Driver options for the network + --gw-priority: text # Highest gw-priority provides the default gateway + --ip: text # IPv4 address (e.g., "172.30.100.104") + --ip6: text # IPv6 address (e.g., "2001:db8::33") + --link: by "nu-complete docker all-containers" # Add link to another container + --link-local-ip: text # Add a link-local address for the container + --help # Print usage +] + +export complete [docker network disconnect] [ + network: by "nu-complete docker networks" # The network + container: by "nu-complete docker all-containers" # The container to disconnect + --force(-f) # Force the container to disconnect from a network + --help # Print usage +] + +export complete [docker network prune] [ + --filter: text # Provide filter values (e.g. "until=") + --force(-f) # Do not prompt for confirmation + --help # Print usage +] + +# --- Volumes ---------------------------------------------------------------------- + +export complete [docker volume create] [ + name?: text # The name of the new volume + --driver(-d): text # Specify volume driver name + --label: text # Set metadata for a volume + --opt(-o): text # Set driver specific options + --help # Print usage +] + +export complete [docker volume ls] [ + --cluster # Display only cluster volumes, and use cluster volume list formatting + --filter(-f): text # Provide filter values (e.g. "dangling=true") + --format: text # Format output using a custom template + --quiet(-q) # Only display volume names + --help # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [docker volume list] [ + --cluster # Display only cluster volumes, and use cluster volume list formatting + --filter(-f): text # Provide filter values (e.g. "dangling=true") + --format: text # Format output using a custom template + --quiet(-q) # Only display volume names + --help # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [docker volume rm] [ + ...volumes: by "nu-complete docker volumes" # The volumes to remove + --force(-f) # Force the removal of one or more volumes + --help # Print usage +] + +export complete [docker volume remove] [ + ...volumes: by "nu-complete docker volumes" # The volumes to remove + --force(-f) # Force the removal of one or more volumes + --help # Print usage +] + +export complete [docker volume inspect] [ + ...volumes: by "nu-complete docker volumes" # The volumes to inspect + --format(-f): text # Format output using a custom template + --help # Print usage +] + +export complete [docker volume prune] [ + --all(-a) # Remove all unused volumes, not just anonymous ones + --filter: text # Provide filter values (e.g. "label=

[^:]+):' + | get p | uniq + if ($live | is-empty) { $common } else { $live } + } catch { $common } +} + +# Variables for `fastboot getvar`. +@non-destructive +export def "nu-complete fastboot vars" [] { + try { + [ + {value: all, description: "Every variable"} + {value: current-slot, description: "The active slot"} + {value: slot-count, description: "Number of slots"} + {value: product, description: "Product name"} + {value: serialno, description: "Serial number"} + {value: unlocked, description: "Bootloader unlock state"} + {value: secure, description: "Secure boot state"} + {value: is-userspace, description: "Running fastbootd"} + {value: max-download-size, description: "Largest image accepted"} + {value: version-bootloader, description: "Bootloader version"} + {value: version-baseband, description: "Baseband version"} + {value: hw-revision, description: "Hardware revision"} + {value: battery-voltage, description: "Battery voltage"} + {value: off-mode-charge, description: "Off-mode charging"} + {value: snapshot-update-status, description: "Snapshot update state"} + ] + } catch { [] } +} + +# Fastboot +export complete [fastboot] [ + -w # Wipe userdata + -s: by "nu-complete fastboot devices" # Device: SERIAL or tcp|udp:HOST[:PORT] + -S: text # Break into sparse files no larger than SIZE[K|M|G] + --force # Force a flash operation that may be unsafe + --slot: words [a b all: "Both slots" other: "The non-current slot"] # Slot to use (default: current active slot) + --set-active?: words [a b other] # Set the active slot before rebooting + --skip-secondary # Don't flash secondary slots in flashall/update + --skip-reboot # Don't reboot the device after flashing + --disable-verity # Set disable-verity when flashing vbmeta + --disable-verification # Set disable-verification when flashing vbmeta + --disable-super-optimization # Disable optimizations when flashing super + --disable-fastboot-info # Collect tasks from the image list instead of fastboot-info.txt + --fs-options: words [casefold projid compress] # Enable filesystem features + --unbuffered # Don't buffer input or output + --verbose(-v) # Verbose output + --version # Display version + --help(-h) # Show help +] where { + excludes --skip-reboot --set-active + terminal [--help --version] +} + +# Show help +export complete [fastboot help] [] + +# List devices in bootloader +export complete [fastboot devices] [ + -l # Show device paths +] + +# Flash all partitions from $ANDROID_PRODUCT_OUT +export complete [fastboot flashall] [] + +# Flash a partition, using the image from $ANDROID_PRODUCT_OUT if no file is given +export complete [fastboot flash] [ + partition: by "nu-complete fastboot partitions" # Partition to flash + file?: path # Image file (default: from $ANDROID_PRODUCT_OUT) +] + +# Create a boot image and flash it +export complete [fastboot "flash:raw"] [ + --dtb: path # DTB for boot image header version 2 + --cmdline: text # Override the kernel command line + --kernel-offset: text # Kernel offset (default 0x00008000) + --ramdisk-offset: text # Ramdisk offset (default 0x01000000) + --tags-offset: text # Tags offset (default 0x00000100) + --dtb-offset: text # DTB offset (default 0x01100000) + --page-size: text # Flash page size (default 2048) + --header-version: words [0 1 2 3 4] # Boot image header version + --os-version: text # OS version MAJOR[.MINOR[.PATCH]] + --os-patch-level: text # OS security patch level YYYY-MM-DD + partition: by "nu-complete fastboot partitions" # Partition to flash + kernel: path # Kernel image + ramdisk?: path # Ramdisk image + second?: path # Second-stage image +] + +# Flash all partitions from an update.zip package +export complete [fastboot update] [ + zip: path # The update package +] + +# Lock or unlock partitions for flashing +export complete [fastboot flashing] [ + action: words [lock: "Lock partitions for flashing" unlock: "Unlock partitions for flashing" lock_critical: "Lock critical bootloader partitions" unlock_critical: "Unlock critical bootloader partitions" get_unlock_ability: "Whether unlocking is allowed"] +] + +# Erase a flash partition +export complete [fastboot erase] [ + partition: by "nu-complete fastboot partitions" # Partition to erase +] + +# Format a flash partition +export complete [fastboot format] [ + partition: by "nu-complete fastboot partitions" # Partition, optionally `partition:FS_TYPE[:SIZE]` +] + +# Display a bootloader variable +export complete [fastboot getvar] [ + name: by "nu-complete fastboot vars" # Variable name +] + +# Set the active slot +export complete [fastboot set_active] [ + slot: words [a b] # Slot to make active +] + +# Execute an OEM-specific command +export complete [fastboot oem] [ + ...command: text # OEM command and arguments (e.g. unlock, device-info) +] + +# Manage a GSI installation (fastbootd only) +export complete [fastboot gsi] [ + action: words [wipe: "Wipe the GSI installation" disable: "Disable the GSI installation" status: "Show the GSI status"] +] + +# Wipe the super partition, resetting it to the default dynamic partitions +export complete [fastboot wipe-super] [ + super_empty?: path # super_empty.img +] + +# Create a logical partition in super +export complete [fastboot create-logical-partition] [ + name: text # Partition name + size: text # Size in bytes +] + +# Change the size of a logical partition +export complete [fastboot resize-logical-partition] [ + name: by "nu-complete fastboot partitions" # Partition name + size: text # New size in bytes +] + +# Delete a logical partition +export complete [fastboot delete-logical-partition] [ + name: by "nu-complete fastboot partitions" # Partition name +] + +# Manage an in-progress snapshot-based update +export complete [fastboot snapshot-update] [ + action?: words [cancel: "Cancel the update (may make the device unbootable)" merge: "Finish an update in the merging phase"] +] + +# Fetch a partition image from the device +export complete [fastboot fetch] [ + partition: by "nu-complete fastboot partitions" # Partition to fetch + out: path # Output file +] + +# Download and boot a kernel from RAM +export complete [fastboot boot] [ + kernel: path # Kernel or boot image + ramdisk?: path # Ramdisk image + second?: path # Second-stage image +] + +# Send a file to stage for the next command +export complete [fastboot stage] [ + file: path # File to stage +] + +# Write data staged by the last command to a file +export complete [fastboot get_staged] [ + out: path # Output file +] + +# Reboot the device +export complete [fastboot reboot] [ + target?: words [bootloader recovery fastboot: "Reboot into fastbootd"] # Where to reboot (system by default) +] + +# Reboot into the bootloader +export complete [fastboot reboot-bootloader] [] + +# Continue booting +export complete [fastboot continue] [] diff --git a/custom-completions/ffmpeg/ffmpeg-completions.nu b/custom-completions/ffmpeg/ffmpeg-completions.nu new file mode 100644 index 000000000..cae71f269 --- /dev/null +++ b/custom-completions/ffmpeg/ffmpeg-completions.nu @@ -0,0 +1,254 @@ +# Declarative completions for FFmpeg. +# +# Uses the `ffmpeg-v1` profile: single-dash long options (`-filter_complex`, `-hide_banner`), +# no option clusters and no `--` terminator. Codec, format, pixel-format, filter and hwaccel +# names are read live from the local `ffmpeg` binary; every provider degrades to `[]` when +# ffmpeg is missing or fails. +# +# Limitation: the completion language matches option spellings exactly, so stream-specifier +# spellings such as `-c:v` / `-b:a` are not separate slots. The classic per-type aliases +# (`-vcodec`, `-acodec`, `-scodec`, `-ab`, `-vb`) carry the codec invariants instead. + +# Parse one of ffmpeg's `-encoders` / `-decoders` listings into value/description rows. +def ffmpeg-codec-rows [flag: string]: nothing -> list> { + ^ffmpeg -hide_banner $flag + | lines + | skip until {|l| $l =~ '^\s*-{3,}' } + | skip 1 + | parse -r '^\s*(?[VASD.][A-Z.]{5})\s+(?\S+)\s+(?.*)$' + | each {|r| + let kind = match ($r.flags | str substring 0..0) { + "V" => "video" + "A" => "audio" + "S" => "subtitle" + _ => "data" + } + { value: $r.value, description: $"($kind): ($r.description | str trim)" } + } +} + +# Video, audio and subtitle encoders known to the local ffmpeg. +@non-destructive +export def "nu-complete ffmpeg encoders" []: nothing -> list> { + try { [{ value: "copy", description: "stream copy (no re-encode)" }] ++ (ffmpeg-codec-rows "-encoders") } catch { [] } +} + +# Video encoders only (for `-vcodec`). +@non-destructive +export def "nu-complete ffmpeg video encoders" []: nothing -> list> { + try { + [{ value: "copy", description: "stream copy (no re-encode)" }] ++ (ffmpeg-codec-rows "-encoders" | where description starts-with "video") + } catch { [] } +} + +# Audio encoders only (for `-acodec`). +@non-destructive +export def "nu-complete ffmpeg audio encoders" []: nothing -> list> { + try { + [{ value: "copy", description: "stream copy (no re-encode)" }] ++ (ffmpeg-codec-rows "-encoders" | where description starts-with "audio") + } catch { [] } +} + +# Subtitle encoders only (for `-scodec`). +@non-destructive +export def "nu-complete ffmpeg subtitle encoders" []: nothing -> list> { + try { + [{ value: "copy", description: "stream copy (no re-encode)" }] ++ (ffmpeg-codec-rows "-encoders" | where description starts-with "subtitle") + } catch { [] } +} + +# Decoders known to the local ffmpeg (for input-side `-c` / `-codec`). +@non-destructive +export def "nu-complete ffmpeg decoders" []: nothing -> list> { + try { ffmpeg-codec-rows "-decoders" } catch { [] } +} + +# Container formats (muxers and demuxers). +@non-destructive +export def "nu-complete ffmpeg formats" []: nothing -> list> { + try { + ^ffmpeg -hide_banner -formats + | lines + | skip until {|l| $l =~ '^\s*-{3,}' } + | skip 1 + | parse -r '^\s*(?[D ][E ][d ]?)\s+(?\S+)\s+(?.*)$' + | each {|r| + let dir = [ + (if ($r.flags | str contains "D") { "demux" }) + (if ($r.flags | str contains "E") { "mux" }) + ] | compact | str join "/" + $r.names | split row "," | each {|n| { value: $n, description: $"($dir): ($r.description | str trim)" } } + } + | flatten + | uniq-by value + } catch { [] } +} + +# Pixel formats. +@non-destructive +export def "nu-complete ffmpeg pix_fmts" []: nothing -> list> { + try { + ^ffmpeg -hide_banner -pix_fmts + | lines + | skip until {|l| $l =~ '^-{3,}' } + | skip 1 + | parse -r '^(?[I.][O.][H.][P.][B.])\s+(?\S+)\s+(?\d+)\s+(?\d+)' + | each {|r| { value: $r.value, description: $"($r.comp) components, ($r.bpp) bits/pixel" } } + } catch { [] } +} + +# Filter names (for filtergraph `name` captures). +@non-destructive +export def "nu-complete ffmpeg filters" []: nothing -> list> { + try { + ^ffmpeg -hide_banner -filters + | lines + | skip until {|l| $l =~ '^\s*-{3,}' } + | skip 1 + | parse -r '^\s*(?[T.][S.])\s+(?\S+)\s+(?\S+)\s+(?.*)$' + | each {|r| { value: $r.value, description: $"($r.io) ($r.description | str trim)" } } + } catch { [] } +} + +# Hardware acceleration methods available in this build. +@non-destructive +export def "nu-complete ffmpeg hwaccels" []: nothing -> list { + try { + ["auto" "none"] ++ ( + ^ffmpeg -hide_banner -hwaccels + | lines + | skip 1 + | str trim + | where $it != "" + ) + } catch { [] } +} + +# A filtergraph: `;`-separated chains of `,`-separated filters, each `name[=args]`, with +# optional `[label]` link pads before and after a chain. Arguments are `key=value` or bare +# positional values separated by `:`. +export syntax ffmpeg.filtergraph over chars { + arg = (key: ident "=")? (val: until ":,;[]")? + filter = name: ident ("=" arg (":" arg)*)? + chain = ("[" inlabel: until "]" "]")* filter ("," filter)* ("[" outlabel: until "]" "]")* + root = chain (";" chain)* +} + +export complete [ffmpeg] profile ffmpeg-v1 [ + # --- generic / informational --- + -h # Show help (`-h long`, `-h full`, `-h encoder=NAME` for more) + -version # Show version + -L # Show license + -buildconf # Show build configuration + -formats # List available formats + -muxers # List muxers + -demuxers # List demuxers + -devices # List devices + -codecs # List codecs + -decoders # List decoders + -encoders # List encoders + -filters # List filters + -pix_fmts # List pixel formats + -layouts # List channel layouts + -sample_fmts # List audio sample formats + -hwaccels # List hardware acceleration methods + # --- global --- + -loglevel: words [quiet panic fatal error warning info verbose debug trace] # Logging level + -v: words [quiet panic fatal error warning info verbose debug trace] # Logging level (alias) + -report # Write a report file + -hide_banner # Suppress the printing banner + -y # Overwrite output files without asking + -n # Never overwrite output files + -stats # Print progress report during encoding + -nostats # Do not print progress report + -progress: text # Write machine-readable progress to URL + -nostdin # Disable interaction on stdin + -benchmark # Add timings for benchmarking + -filter_complex: ffmpeg.filtergraph with { filter.name: by "nu-complete ffmpeg filters" } # Complex filtergraph + -filter_complex_script: path # Read complex filtergraph from file + -threads: text # Number of threads (0 = auto) + # --- per-file main options --- + -i: path # Input file or URL + -f: by "nu-complete ffmpeg formats" # Force container format + -c: by "nu-complete ffmpeg encoders" # Codec for all streams (`copy` to stream-copy) + -codec: by "nu-complete ffmpeg encoders" # Codec for all streams (alias of -c) + -map: text # Select input streams, e.g. 0:v:0 or [out] + -map_metadata: text # Copy metadata from input file index + -map_chapters: text # Copy chapters from input file index + -ss: text # Start time offset (seek) + -sseof: text # Start time relative to end of file + -t: text # Duration to record/transcode + -to: text # Stop time + -fs: text # Output file size limit in bytes + -itsoffset: text # Input timestamp offset + -metadata: text # Add metadata, e.g. title="My Video" + -movflags: words [faststart frag_keyframe empty_moov default_base_moof omit_tfhd_offset separate_moof +faststart] # MOV/MP4 muxer flags + -shortest # Finish encoding when the shortest input ends + -re # Read input at native frame rate + -stream_loop: text # Loop input this many times (-1 = forever) + -hwaccel: by "nu-complete ffmpeg hwaccels" # Hardware decoding acceleration + -hwaccel_device: text # Hardware acceleration device + -hwaccel_output_format: by "nu-complete ffmpeg pix_fmts" # Hardware frame output format + -filter: ffmpeg.filtergraph with { filter.name: by "nu-complete ffmpeg filters" } # Simple filtergraph for selected streams + -filter_script: path # Read simple filtergraph from file + -preset: words [ultrafast superfast veryfast faster fast medium slow slower veryslow placebo] # Encoder speed/quality preset + -tune: words [film animation grain stillimage fastdecode zerolatency psnr ssim] # Encoder tuning + -profile: words [baseline main high high10 high422 high444 main10] # Encoder profile + -crf: text # Constant rate factor (quality) + -qp: text # Constant quantizer + -q: text # Fixed quality scale (VBR) + -b: text # Bitrate for all streams, e.g. 2M + -maxrate: text # Maximum bitrate + -bufsize: text # Rate-control buffer size + # --- video --- + -vframes: text # Number of video frames to output + -frames: text # Number of frames to output + -r: text # Frame rate (Hz value, fraction or abbreviation) + -fpsmax: text # Maximum frame rate + -s: text # Frame size (WxH or abbreviation) + -aspect: text # Display aspect ratio (4:3, 16:9, 1.7777) + -vn # Disable video + -vcodec: by "nu-complete ffmpeg video encoders" # Video codec (alias of -c:v) + -vb: text # Video bitrate (alias of -b:v) + -vf: ffmpeg.filtergraph with { filter.name: by "nu-complete ffmpeg filters" } # Video filtergraph (alias of -filter:v) + -pix_fmt: by "nu-complete ffmpeg pix_fmts" # Pixel format + -g: text # GOP size (keyframe interval) + -pass: words [1 2 3] # Two-pass encoding pass number + -passlogfile: path # Two-pass log file prefix + # --- audio --- + -aframes: text # Number of audio frames to output + -aq: text # Audio quality (codec-specific) + -ar: words [8000 11025 16000 22050 32000 44100 48000 88200 96000] # Audio sampling rate (Hz) + -ac: words [1 2 6 8] # Number of audio channels + -an # Disable audio + -acodec: by "nu-complete ffmpeg audio encoders" # Audio codec (alias of -c:a) + -ab: text # Audio bitrate (alias of -b:a) + -af: ffmpeg.filtergraph with { filter.name: by "nu-complete ffmpeg filters" } # Audio filtergraph (alias of -filter:a) + -vol: text # Change audio volume (256 = normal) + # --- subtitles / data --- + -sn # Disable subtitles + -scodec: by "nu-complete ffmpeg subtitle encoders" # Subtitle codec (alias of -c:s) + -dn # Disable data streams + -dcodec: text # Data codec + output?: path # Output file +] where { + at-most-one [-y -n] + at-most-one [-to -t] + at-most-one [-stats -nostats] + at-most-one [-loglevel -v] + at-most-one [-c -codec] + at-most-one [-crf -qp] + at-most-one [-vf -filter_complex] + at-most-one [-af -filter_complex] + at-most-one [-filter_complex -filter_complex_script] + excludes -vn -vcodec + excludes -vn -vf + excludes -vn -pix_fmt + excludes -an -acodec + excludes -an -af + excludes -sn -scodec + excludes -dn -dcodec + # The `-encoders`/`-filters`/... listings are deliberately not terminal: they are routinely + # combined with `-hide_banner`. + terminal [-version -h -L -buildconf] +} diff --git a/custom-completions/find/find-completions.nu b/custom-completions/find/find-completions.nu new file mode 100644 index 000000000..64e75b361 --- /dev/null +++ b/custom-completions/find/find-completions.nu @@ -0,0 +1,128 @@ +# Declarative completions for find(1), covering both BSD/macOS find and GNU findutils. +# +# Uses the `single-dash-v1` profile: primaries are single-dash long words (`-name`, `-exec`) +# with no clustering. `-exec`/`-execdir` own a nested command line that ends at `;` or at `+` +# right after `{}`; `-ok`/`-okdir` only accept the `;` terminator. Primaries that are BSD-only +# or GNU-only are marked in their description. +# +# In Nushell, bare `find` is the builtin filter command; this spec applies to the external, +# so invoke it as `^find`. Quote the placeholder and terminators so Nu passes them through +# literally: `^find . -name '*.rs' -exec rg TODO '{}' '+'` or `... -exec rm '{}' ';'`. + +export complete [find] profile single-dash-v1 [ + # --- symlink handling and leading options --- + -H # Follow symlinks named on the command line only + -L # Follow all symbolic links + -P # Never follow symbolic links (default) + -E # Use extended regular expressions (BSD) + -X # Warn about and skip unsafe file names for xargs (BSD) + -s # Traverse in lexicographic order (BSD) + -x # Do not descend into other file systems (BSD; same as -xdev) + -f: dir # Specify a starting path that may begin with `-` (BSD) + -D: words [exec opt rates search stat tree all help] # Debug output categories (GNU) + -O: words [0: "no reordering" 1: "default: cheap tests first" 2: "type/xtype early" 3: "full cost-based reordering"] # Query optimisation level (GNU) + # --- global options --- + -maxdepth: text # Descend at most N directory levels + -mindepth: text # Do not apply tests at levels less than N + -depth # Process directory contents before the directory itself + -d # Same as -depth (BSD) + -xdev # Do not descend into other file systems + -mount # Same as -xdev + -noleaf # Do not assume Unix directory link counts (GNU) + -ignore_readdir_race # Ignore files that vanish during traversal + -noignore_readdir_race # Report files that vanish during traversal + -regextype: words [findutils-default emacs posix-awk posix-basic posix-egrep posix-extended posix-minimal-basic awk ed egrep gnu-awk grep sed] # Regex dialect for -regex/-iregex (GNU) + -daystart # Measure times from the start of today (GNU) + -follow # Follow symbolic links (deprecated; use -L) + # --- name and path tests --- + -name: text # Base name matches shell pattern + -iname: text # Like -name, case-insensitive + -path: text # Whole path matches shell pattern + -ipath: text # Like -path, case-insensitive + -wholename: text # Same as -path + -iwholename: text # Same as -ipath + -regex: text # Whole path matches regular expression + -iregex: text # Like -regex, case-insensitive + -lname: text # Symlink target matches shell pattern + -ilname: text # Like -lname, case-insensitive + # --- type tests --- + -type: words [f: "regular file" d: "directory" l: "symbolic link" c: "character special" b: "block special" p: "named pipe (FIFO)" s: "socket" D: "door (Solaris)"] # File is of type + -xtype: words [f: "regular file" d: "directory" l: "symbolic link" c: "character special" b: "block special" p: "named pipe (FIFO)" s: "socket"] # Type of symlink target (GNU) + -fstype: text # File is on a file system of this type + -empty # File or directory is empty + -sparse # File is sparse (BSD) + # --- permission and ownership tests --- + -perm: text # Permission bits match (mode, -mode, /mode or +mode) + -readable # Current user can read the file (GNU) + -writable # Current user can write the file (GNU) + -executable # Current user can execute/search the file (GNU) + -user: users # Owned by user (name or UID) + -group: groups # Owned by group (name or GID) + -uid: text # Owned by numeric user ID + -gid: text # Owned by numeric group ID + -nouser # No user corresponds to the file's UID + -nogroup # No group corresponds to the file's GID + -acl # File has an extended ACL (BSD) + -xattr # File has extended attributes (BSD) + -xattrname: text # File has the named extended attribute (BSD) + -flags: text # File flags match (BSD, see chflags) + -context: text # SELinux context matches pattern (GNU) + # --- size, link and inode tests --- + -size: text # Size in blocks or with suffix c/k/M/G/T/P (+N, -N, N) + -links: text # File has N hard links + -inum: text # File has inode number N + -samefile: path # File refers to the same inode as path + # --- time tests --- + -mtime: text # Data modified N*24 hours ago + -mmin: text # Data modified N minutes ago + -atime: text # Last accessed N*24 hours ago + -amin: text # Last accessed N minutes ago + -ctime: text # Status changed N*24 hours ago + -cmin: text # Status changed N minutes ago + -Btime: text # Created (birth) N*24 hours ago (BSD) + -Bmin: text # Created (birth) N minutes ago (BSD) + -newer: path # Modified more recently than file + -anewer: path # Accessed more recently than file modified + -cnewer: path # Status changed more recently than file modified + -mnewer: path # Same as -newer (BSD) + -Bnewer: path # Created more recently than file modified (BSD) + -used: text # Accessed N days after status change (GNU) + # --- actions --- + -print # Print the path followed by a newline + -print0 # Print the path followed by NUL (for xargs -0) + -printf: text # Print using a format string (GNU) + -fprint: path # Print path to file (GNU) + -fprint0: path # Print NUL-terminated path to file (GNU) + -fprintf: path # Print formatted output to file (GNU; format follows) + -ls # List in `ls -dils` format + -fls: path # Like -ls but write to file (GNU) + -delete # Delete matching files (implies -depth) + -prune # Do not descend into this directory + -quit # Exit immediately + -exec: command until [";" "+" after "{}"] # Run command; `{}` is the path, end with `;` or `{} +` + -execdir: command until [";" "+" after "{}"] # Like -exec, run from the file's directory + -ok: command until [";" after "{}"] # Like -exec but ask for confirmation first + -okdir: command until [";" after "{}"] # Like -execdir but ask for confirmation first + # --- operators --- + -not # Negate the following expression + -and # Logical AND (implicit between primaries) + -a # Logical AND + -or # Logical OR + -o # Logical OR + -true # Always true + -false # Always false + # --- GNU informational --- + -help # Print usage summary (GNU) + -version # Print version (GNU) + ...paths: path # Starting points to search +] where { + at-most-one [-H -L -P] + at-most-one [-L -follow] + at-most-one [-depth -d] + at-most-one [-xdev -mount -x] + at-most-one [-maxdepth] + at-most-one [-mindepth] + at-most-one [-regextype] + excludes -delete -prune + terminal [-help -version] +} diff --git a/custom-completions/flutter/flutter-completions.nu b/custom-completions/flutter/flutter-completions.nu index 1332c05f5..cabcbcd9b 100644 --- a/custom-completions/flutter/flutter-completions.nu +++ b/custom-completions/flutter/flutter-completions.nu @@ -1,95 +1,381 @@ -def "nu-complete flutter commands" [] { - [ - {value: "analyze", description: "Analyze the project's Dart code."} - {value: "assemble", description: "Assemble and build Flutter resources."} - {value: "attach", description: "Attach to a running app."} - {value: "bash-completion", description: "Output command line shell completion setup scripts."} - {value: "build", description: "Build an executable app or install bundle."} - {value: "channel", description: "List or switch Flutter channels."} - {value: "clean", description: "Delete the build/ and .dart_tool/ directories."} - {value: "config", description: "Configure Flutter settings."} - {value: "custom-devices", description: "List, reset, add and delete custom devices."} - {value: "daemon", description: "Run a persistent, JSON-RPC based server to communicate with devices."} - {value: "debug-adapter", description: "Run a Debug Adapter Protocol (DAP) server to communicate with the Flutter tool."} - {value: "devices", description: "List all connected devices."} - {value: "doctor", description: "Show information about the installed tooling."} - {value: "downgrade", description: "Downgrade Flutter to the last active version for the current channel."} - {value: "drive", description: "Builds and installs the app, and runs a Dart program that connects to the app, often to run externally facing integration tests, such as with package:test and package:flutter_driver."} - {value: "emulators", description: "List, launch and create emulators."} - {value: "gen-l10n", description: "Generate localizations for the current project."} - {value: "install", description: "Install a Flutter app on an attached device."} - {value: "logs", description: "Show log output for running Flutter apps."} - {value: "precache", description: "Populate the Flutter tool's cache of binary artifacts."} - {value: "run", description: "Run your Flutter app on an attached device."} - {value: "running-apps", description: "List running applications."} - {value: "screenshot", description: "Take a screenshot from a connected device."} - {value: "symbolize", description: "Symbolize a stack trace from an AOT-compiled Flutter app."} - {value: "test", description: "Run Flutter unit tests for the current project."} - {value: "upgrade", description: "Upgrade your copy of Flutter."} - {value: "widget-preview", description: "Manage the widget preview environment."} - ] +# Declarative completions for Flutter. + +# Comma-separated lists such as `--platforms ios,android`. +export syntax flutter.list over chars { + root = item: until "," ("," item: until ",")* } -def "nu-complete pub commands" [] { - [ - {value: "add", description: "Add a dependency to pubspec.yaml."} - {value: "cache", description: "Work with the Pub system cache."} - {value: "deps", description: "Print package dependencies."} - {value: "downgrade", description: "Downgrade packages in a Flutter project."} - {value: "get", description: "Get the current package's dependencies."} - {value: "global", description: "Work with Pub global packages."} - {value: "login", description: "Log into pub.dev."} - {value: "logout", description: "Log out of pub.dev."} - {value: "outdated", description: "Analyze dependencies to find which ones can be upgraded."} - {value: "pub", description: "Pass the remaining arguments to Dart's \"pub\" tool."} - {value: "publish", description: "Publish the current package to pub.dartlang.org."} - {value: "remove", description: "Removes a dependency from the current package."} - {value: "run", description: "Run an executable from a package."} - {value: "test", description: "Run the \"test\" package."} - {value: "token", description: "Manage authentication tokens for hosted pub repositories."} - {value: "upgrade", description: "Upgrade the current package's dependencies to latest versions."} - {value: "uploader", description: "Manage uploaders for a package on pub.dev."} - {value: "version", description: "Print Pub version."} +# Devices: desktop/web targets plus attached Android devices (`flutter devices` is too slow to ask). +@non-destructive +export def "nu-complete flutter devices" [] { + let fixed = [ + {value: macos, description: "macOS desktop"} {value: linux, description: "Linux desktop"} + {value: windows, description: "Windows desktop"} {value: chrome, description: "Chrome (web)"} + {value: web-server, description: "Web server"} ] + try { + $fixed | append (^adb devices | lines | skip 1 | parse --regex '^(?\S+)\s+device$' | insert description "Android device") + } catch { $fixed } +} + +@non-destructive +export def "nu-complete flutter platforms" [] { + try { [ios android windows linux macos web] } catch { [] } +} + +@non-destructive +export def "nu-complete flutter android-targets" [] { + try { [android-arm android-arm64 android-x64] } catch { [] } } -def "nu-complete android-languages" [] { - [java kotlin] +# Product flavors from android/app/build.gradle(.kts). +@non-destructive +export def "nu-complete flutter flavors" [] { + try { + ["android/app/build.gradle.kts" "android/app/build.gradle"] | where {|f| $f | path exists } + | each {|f| open --raw $f | parse --regex '(?m)^\s*(?:create\(")?(?\w+)"?\)?\s*\{\s*$' | get f } + | flatten + | where {|f| $f not-in [android defaultConfig buildTypes release debug productFlavors signingConfigs compileOptions kotlinOptions sourceSets packaging buildFeatures] } + | uniq + } catch { [] } } -def "nu-complete project-templates" [] { - [app module package package_ffi plugin plugin_ffi skeleton] +# Run Flutter from the command line. +export complete [flutter] [ + --verbose(-v) # Noisy logging, including all shell commands executed. + --device-id(-d): by "nu-complete flutter devices" # Target device id or name (prefixes allowed). + --version # Reports the version of this tool. + --enable-analytics # Enable telemetry reporting each time a flutter or dart command runs. + --disable-analytics # Disable telemetry reporting each time a flutter or dart command runs, until it is re-enabled. + --suppress-analytics # Suppress analytics reporting for the current CLI invocation. + command?: words [analyze: "Analyze the project's Dart code." assemble: "Assemble and build Flutter resources." attach: "Attach to a running app." bash-completion: "Output command line shell completion setup scripts." build: "Build an executable app or install bundle." channel: "List or switch Flutter channels." clean: "Delete the build/ and .dart_tool/ directories." config: "Configure Flutter settings." custom-devices: "List, reset, add and delete custom devices." daemon: "Run a persistent, JSON-RPC based server to communicate with devices." debug-adapter: "Run a Debug Adapter Protocol (DAP) server to communicate with the Flutter tool." devices: "List all connected devices." doctor: "Show information about the installed tooling." downgrade: "Downgrade Flutter to the last active version for the current channel." drive: "Builds and installs the app, and runs a Dart program that connects to the app, often to run externally facing integration tests, such as with package:test and package:flutter_driver." emulators: "List, launch and create emulators." gen-l10n: "Generate localizations for the current project." install: "Install a Flutter app on an attached device." logs: "Show log output for running Flutter apps." precache: "Populate the Flutter tool's cache of binary artifacts." run: "Run your Flutter app on an attached device." running-apps: "List running applications." screenshot: "Take a screenshot from a connected device." symbolize: "Symbolize a stack trace from an AOT-compiled Flutter app." test: "Run Flutter unit tests for the current project." upgrade: "Upgrade your copy of Flutter." widget-preview: "Manage the widget preview environment."] + --help(-h) # Print usage information +] where { + excludes --enable-analytics --disable-analytics + terminal [--help --version] + terminal [--version] } -def "nu-complete platforms" [] { - [ios android windows linux macos web] +export complete [flutter create] [ + --pub # Run "flutter pub get" after creation (default) + --no-pub # Do not run "flutter pub get" + --offline # Run "flutter pub get" in offline mode + --overwrite # Overwrite existing files + --description: text # The description to use for your new Flutter project + --org: text # The organization responsible for your new Flutter project + --project-name: text # The project name for this new Flutter project + --android-language(-a): words [java kotlin] # The language to use for Android-specific code + --platforms: flutter.list with { root.item: by "nu-complete flutter platforms" } # The platforms supported by this project + --template(-t): words [app module package package_ffi plugin plugin_ffi skeleton] # Specify the type of project to create + --empty(-e) # Specifies creating using an application template with a main.dart that is minimal + output_dir: dir # Output directory +] where { + excludes --pub --no-pub } -export extern "flutter" [ - command?: string@"nu-complete flutter commands" - --verbose(-v) # Noisy logging, including all shell commands executed. - --device-id(-d): string # Target device id or name (prefixes allowed). - --version # Reports the version of this tool. - --enable-analytics # Enable telemetry reporting each time a flutter or dart command runs. - --disable-analytics # Disable telemetry reporting each time a flutter or dart command runs, until it is re-enabled. - --suppress-analytics # Suppress analytics reporting for the current CLI invocation. +export complete [flutter pub] [ + command?: words [add: "Add a dependency to pubspec.yaml." cache: "Work with the Pub system cache." deps: "Print package dependencies." downgrade: "Downgrade packages in a Flutter project." get: "Get the current package's dependencies." global: "Work with Pub global packages." login: "Log into pub.dev." logout: "Log out of pub.dev." outdated: "Analyze dependencies to find which ones can be upgraded." publish: "Publish the current package to pub.dartlang.org." remove: "Removes a dependency from the current package." run: "Run an executable from a package." token: "Manage authentication tokens for hosted pub repositories." upgrade: "Upgrade the current package's dependencies to latest versions." uploader: "Manage uploaders for a package on pub.dev." version: "Print Pub version."] +] + +export complete [flutter run] [ + --release # Build in release mode. + --debug # Build in debug mode. + --profile # Build in profile mode. + --flavor: by "nu-complete flutter flavors" # Build a custom app flavor. + --dart-define: text # Define a compile-time environment variable. + --target(-t): path # The main entry-point file of the application. + --device-id(-d): by "nu-complete flutter devices" # Target device id or name (prefixes allowed). +] where { + at-most-one [--release --debug --profile] +} + +export complete [flutter test] [ + --coverage # Collect coverage and write it to coverage/lcov.info. + --name: text # Run only tests whose name matches this regular expression. + ...path: path # The test files or directories to run +] + +export complete [flutter doctor] [ + --verbose # Show the verbose diagnosis. ] -export extern "flutter create" [ - output_dir: string # Output directory - --pub # Run "flutter pub get" after creation (default) - --no-pub # Do not run "flutter pub get" - --offline # Run "flutter pub get" in offline mode - --overwrite # Overwrite existing files - --description: string # The description to use for your new Flutter project - --org: string # The organization responsible for your new Flutter project - --project-name: string # The project name for this new Flutter project - --android-language(-a): string@"nu-complete android-languages" # The language to use for Android-specific code - --platforms: string@"nu-complete platforms" # The platforms supported by this project - --template(-t): string@"nu-complete project-templates" # Specify the type of project to create - --empty(-e) # Specifies creating using an application template with a main.dart that is minimal +export complete [flutter devices] [ ] -export extern "flutter pub" [ - command?: string@"nu-complete pub commands" +export complete [flutter clean] [ ] + +export complete [flutter upgrade] [ + --force # Upgrade even if the working tree has local changes. +] + +export complete [flutter build apk] [ + --release # Build in release mode. + --debug # Build in debug mode. + --profile # Build in profile mode. + --split-per-abi # Build one APK per target ABI. + --target-platform: flutter.list with { root.item: by "nu-complete flutter android-targets" } # The target platforms, comma-separated. + --flavor: by "nu-complete flutter flavors" # Build a custom app flavor. + --target(-t): path # The main entry-point file of the application. +] where { + at-most-one [--release --debug --profile] +} + +export complete [flutter build ios] [ + --release # Build in release mode. + --debug # Build in debug mode. + --profile # Build in profile mode. + --no-codesign # Skip the code signing step. + --flavor: by "nu-complete flutter flavors" # Build a custom app flavor. + --target(-t): path # The main entry-point file of the application. +] where { + at-most-one [--release --debug --profile] +} + +export complete [flutter build web] [ + --release # Build in release mode. + --profile # Build in profile mode. + --base-href: text # The base href of the application. + --wasm # Compile to WebAssembly. + --target(-t): path # The main entry-point file of the application. +] where { + at-most-one [--release --profile] +} + +# Build an executable app or install bundle +export complete [flutter build] [ + --help(-h) # Print usage information +] where { terminal [--help] } + +# Build an Android App Bundle +export complete [flutter build appbundle] [ + --target-platform: flutter.list with { root.item: by "nu-complete flutter android-targets" } # Target platforms + --release # Build in release mode (default) + --debug # Build in debug mode + --profile # Build in profile mode + --flavor: by "nu-complete flutter flavors" # Build a custom app flavor + --dart-define: text # Compile-time environment variable (key=value) + --dart-define-from-file: path # Load compile-time variables from a JSON or .env file + --target(-t): path # The main entry-point file (default lib/main.dart) + --build-name: text # Version name (x.y.z) + --build-number: text # Build number + --obfuscate # Remove identifiers and replace them with random values + --split-debug-info: dir # Directory for split debug symbols + --no-tree-shake-icons # Do not tree-shake icon fonts + --help(-h) # Print usage information +] where { + at-most-one [--release --debug --profile] + requires --obfuscate --split-debug-info + terminal [--help] +} + +# Build an iOS archive bundle and IPA +export complete [flutter build ipa] [ + --export-method: words [app-store ad-hoc development enterprise] # Export method + --export-options-plist: path # ExportOptions.plist for the archive + --no-codesign # Do not codesign the application bundle + --release # Build in release mode (default) + --debug # Build in debug mode + --profile # Build in profile mode + --flavor: by "nu-complete flutter flavors" # Build a custom app flavor + --dart-define: text # Compile-time environment variable (key=value) + --dart-define-from-file: path # Load compile-time variables from a JSON or .env file + --target(-t): path # The main entry-point file (default lib/main.dart) + --build-name: text # Version name (x.y.z) + --build-number: text # Build number + --obfuscate # Remove identifiers and replace them with random values + --split-debug-info: dir # Directory for split debug symbols + --no-tree-shake-icons # Do not tree-shake icon fonts + --help(-h) # Print usage information +] where { + at-most-one [--release --debug --profile] + requires --obfuscate --split-debug-info + terminal [--help] +} + +# Build a macOS desktop application +export complete [flutter build macos] [ + --release # Build in release mode (default) + --debug # Build in debug mode + --profile # Build in profile mode + --flavor: by "nu-complete flutter flavors" # Build a custom app flavor + --dart-define: text # Compile-time environment variable (key=value) + --dart-define-from-file: path # Load compile-time variables from a JSON or .env file + --target(-t): path # The main entry-point file (default lib/main.dart) + --build-name: text # Version name (x.y.z) + --build-number: text # Build number + --obfuscate # Remove identifiers and replace them with random values + --split-debug-info: dir # Directory for split debug symbols + --no-tree-shake-icons # Do not tree-shake icon fonts + --help(-h) # Print usage information +] where { + at-most-one [--release --debug --profile] + requires --obfuscate --split-debug-info + terminal [--help] +} + +# Build a Linux desktop application +export complete [flutter build linux] [ + --target-platform: words [linux-x64 linux-arm64] # Target platform + --release # Build in release mode (default) + --debug # Build in debug mode + --profile # Build in profile mode + --flavor: by "nu-complete flutter flavors" # Build a custom app flavor + --dart-define: text # Compile-time environment variable (key=value) + --dart-define-from-file: path # Load compile-time variables from a JSON or .env file + --target(-t): path # The main entry-point file (default lib/main.dart) + --build-name: text # Version name (x.y.z) + --build-number: text # Build number + --obfuscate # Remove identifiers and replace them with random values + --split-debug-info: dir # Directory for split debug symbols + --no-tree-shake-icons # Do not tree-shake icon fonts + --help(-h) # Print usage information +] where { + at-most-one [--release --debug --profile] + requires --obfuscate --split-debug-info + terminal [--help] +} + +# Build a Windows desktop application +export complete [flutter build windows] [ + --release # Build in release mode (default) + --debug # Build in debug mode + --profile # Build in profile mode + --flavor: by "nu-complete flutter flavors" # Build a custom app flavor + --dart-define: text # Compile-time environment variable (key=value) + --dart-define-from-file: path # Load compile-time variables from a JSON or .env file + --target(-t): path # The main entry-point file (default lib/main.dart) + --build-name: text # Version name (x.y.z) + --build-number: text # Build number + --obfuscate # Remove identifiers and replace them with random values + --split-debug-info: dir # Directory for split debug symbols + --no-tree-shake-icons # Do not tree-shake icon fonts + --help(-h) # Print usage information +] where { + at-most-one [--release --debug --profile] + requires --obfuscate --split-debug-info + terminal [--help] +} + +# Install a Flutter app on an attached device +export complete [flutter install] [ + --device-id(-d): by "nu-complete flutter devices" # Target device id or name + --debug # Install a debug build + --profile # Install a profile build + --release # Install a release build (default) + --flavor: by "nu-complete flutter flavors" # Flavor to install + --uninstall-only # Uninstall the app only + --help(-h) # Print usage information +] where { + at-most-one [--release --debug --profile] + terminal [--help] +} + +# Attach to a running app +export complete [flutter attach] [ + --device-id(-d): by "nu-complete flutter devices" # Target device id or name + --debug-url: text # VM service URL of the app + --app-id: text # Bundle id of the app to attach to + --target(-t): path # The main entry-point file + --help(-h) # Print usage information +] where { terminal [--help] } + +# Show log output for running Flutter apps +export complete [flutter logs] [ + --clear(-c) # Clear log history before reading + --device-id(-d): by "nu-complete flutter devices" # Target device id or name + --help(-h) # Print usage information +] where { terminal [--help] } + +# Analyze the project's Dart code +export complete [flutter analyze] [ + --fatal-infos # Treat info-level issues as fatal + --fatal-warnings # Treat warning-level issues as fatal + --no-fatal-warnings # Do not treat warnings as fatal + --watch # Re-analyze on changes + --help(-h) # Print usage information + ...paths: path # Directories or files to analyze +] where { + excludes --fatal-warnings --no-fatal-warnings + terminal [--help] +} + +# List, launch and create emulators +export complete [flutter emulators] [ + --launch: text # Emulator id to launch + --cold # Cold boot the emulator (with --launch) + --create # Create a new Android emulator + --name: text # Name for the created emulator + --help(-h) # Print usage information +] where { + excludes --launch --create + requires --cold --launch + requires --name --create + terminal [--help] +} + +# List or switch Flutter channels +export complete [flutter channel] [ + --all(-a) # Include all the available branches + --help(-h) # Print usage information + channel?: words [stable beta main master] # Channel to switch to +] where { terminal [--help] } + +# Configure Flutter settings +export complete [flutter config] [ + --list # List all settings and their values + --clear-features # Remove all configured features + --enable-web # Enable web + --no-enable-web # Disable web + --enable-macos-desktop # Enable macOS desktop + --no-enable-macos-desktop # Disable macOS desktop + --enable-linux-desktop # Enable Linux desktop + --no-enable-linux-desktop # Disable Linux desktop + --enable-windows-desktop # Enable Windows desktop + --no-enable-windows-desktop # Disable Windows desktop + --android-sdk: dir # The Android SDK directory + --jdk-dir: dir # The JDK directory + --build-dir: dir # Relative build output directory + --help(-h) # Print usage information +] where { + excludes --enable-web --no-enable-web + excludes --enable-macos-desktop --no-enable-macos-desktop + excludes --enable-linux-desktop --no-enable-linux-desktop + excludes --enable-windows-desktop --no-enable-windows-desktop + terminal [--help --list] +} + +# Generate localizations for the current project +export complete [flutter gen-l10n] [ + --arb-dir: dir # Directory of the template and translated ARB files + --output-dir: dir # Directory for the generated localization classes + --template-arb-file: path # The template ARB file + --output-localization-file: text # File name for the output localization class + --help(-h) # Print usage information +] where { terminal [--help] } + +# Take a screenshot from a connected device +export complete [flutter screenshot] [ + --device-id(-d): by "nu-complete flutter devices" # Target device id or name + --out(-o): path # Output file + --type: words [device skia] # Screenshot type + --help(-h) # Print usage information +] where { terminal [--help] } + +# Populate the Flutter tool's cache of binary artifacts +export complete [flutter precache] [ + --all-platforms(-a) # Precache artifacts for all host platforms + --force(-f) # Force re-downloading of artifacts + --android # Precache Android artifacts + --ios # Precache iOS artifacts + --web # Precache web artifacts + --macos # Precache macOS artifacts + --linux # Precache Linux artifacts + --windows # Precache Windows artifacts + --help(-h) # Print usage information +] where { terminal [--help] } + +# Downgrade Flutter to the last active version for the current channel +export complete [flutter downgrade] [ + --help(-h) # Print usage information +] where { terminal [--help] } diff --git a/custom-completions/fsharpc/fsharpc-completions.nu b/custom-completions/fsharpc/fsharpc-completions.nu index 467f339d5..bf092d034 100644 --- a/custom-completions/fsharpc/fsharpc-completions.nu +++ b/custom-completions/fsharpc/fsharpc-completions.nu @@ -1,69 +1,86 @@ -# Name of the output file -extern "fsharpc" [ - --out # Name of the output file - --target # Build a console executable - --target # Build a Windows executable - --target # Build a library - --target # Build a module that can be added to another assembly - # breaks the parser - # --delaysign+ # Delay-sign the assembly using only the public portion of the strong name key - #--delaysign- # Disable --delaysign - --doc # Write the xmldoc of the assembly to the given file - --keyfile # Specify a strong name key file - --keycontainer # Specify a strong name key container - --platform # Limit the platform to x86 - --platform # Limit the platform to Itanium - --platform # Limit the platform to x64 - --platform # Limit the platform to anycpu32bitpreferred - --platform # Limit the platform to anycpu (default) - --nooptimizationdata # Only include optimization information for inlined constructs - --nointerfacedata # Don't add a resource to the assembly containing F#-specific metadata - --sig # Print the inferred interface of the assembly to a file - --reference # Reference an assembly - --win32res # Specify a Win32 resource file (.res) - --win32manifest # Specify a Win32 manifest file - --nowin32manifest # Do not include the default Win32 manifest - --resource # Embed the specified managed resource - --linkresource # Link the specified resource to this assembly - # breaks the parser - # --debug+(-g) # Emit debug information - --debug- # Disable --debug - #--optimize+(-O) # Enable optimizations - --optimize- # Disable --optimize - #--tailcalls+ # Enable or disable tailcalls - --tailcalls- # Disable --tailcalls - #--deterministic+ # Produce a deterministic assembly - --deterministic- # Disable --deterministic - #--crossoptimize+ # Enable or disable cross-module optimizations - --crossoptimize- # Disable --crossoptimize - #--warnaserror+ # Report all warnings as errors - --warnaserror- # Disable --warnaserror - #--warnaserror+ # Report specific warnings as errors - --warnaserror- # Disable --warnaserror: - --nowarn # Disable specific warning messages - --warnon # Enable specific warnings that may be off by default - --consolecolors # Output warning and error messages in color - --consolecolors # Disable --consolecolors - #--checked+ # Generate overflow checks - --checked- # Disable --checked - --define # Define conditional compilation symbols - --mlcompatibility # Ignore ML compatibility warnings - --nologo # Suppress compiler copyright message - --help(-?) # Display this usage message - --codepage # Specify the codepage used to read source files - --utf8output # Output messages in UTF-8 encoding - --fullpaths # Output messages with fully qualified paths - --lib # Specify a directory for include path for resolving source files and assemblies - --simpleresolution # Resolve assembly references using directory-based rules - --baseaddress # Base address for the library to be built - --noframework # Do not reference the default CLI assemblies by default - --standalone # Statically link F# library and referenced DLLs into the generated assembly - --staticlink # Statically link the assembly and referenced DLLs that depend on this assembly - --pdb # Name the output debug file - #--highentropyva+ # Enable high-entropy ASLR - --highentropyva- # Disable --highentropyva - --subsystemversion # Specify subsystem version of this assembly - #--quotations-debug+ # Emit debug information in quotations - --quotations-debug- # Disable --quotations-debug - ...args -] \ No newline at end of file +# Declarative completions for fsharpc, the F# compiler. +# +# fsharpc spells valued options as `--option:value`. The completion profiles split only on +# `=` or whitespace, so valued options are modelled as taking the next word. Option names +# cannot contain `+`, so `--debug+` and its kin are offered as the equivalent bare `--debug`. + +export complete [fsharpc] [ + # Output files + --out(-o): path # Name of the output file + --target: words [exe winexe library module] # Kind of assembly to build + --delaysign # Delay-sign the assembly with the public key only + --delaysign- # Disable --delaysign + --doc: path # Write the assembly's xmldoc to this file + --keyfile: path # Strong name key file + --keycontainer: text # Strong name key container + --platform: words [x86 Itanium x64 anycpu32bitpreferred anycpu] # Platforms the code can run on + --nooptimizationdata # Only include optimization data for inlined constructs + --nointerfacedata # Do not add the F#-specific metadata resource + --sig: path # Print the inferred interface to this file + # Input files + --reference(-r): path # Reference an assembly + # Resources + --win32res: path # Win32 resource file (.res) + --win32manifest: path # Win32 manifest file + --nowin32manifest # Do not include the default Win32 manifest + --resource: path # Embed a managed resource + --linkresource: path # Link a resource to this assembly + # Code generation + --debug(-g) # Emit debug information + --debug- # Disable --debug + --optimize(-O) # Enable optimizations + --optimize- # Disable --optimize + --tailcalls # Enable tailcalls + --tailcalls- # Disable --tailcalls + --deterministic # Produce a deterministic assembly + --deterministic- # Disable --deterministic + --crossoptimize # Enable cross-module optimizations + --crossoptimize- # Disable --crossoptimize + # Errors and warnings + --warnaserror # Report all warnings as errors + --warnaserror- # Disable --warnaserror + --warn: words [0 1 2 3 4 5] # Warning level + --nowarn: text # Disable specific warnings + --warnon: text # Enable specific warnings that are off by default + --consolecolors # Color warning and error messages + --consolecolors- # Disable --consolecolors + # Language + --checked # Generate overflow checks + --checked- # Disable --checked + --define(-d): text # Define a conditional compilation symbol + --mlcompatibility # Ignore ML compatibility warnings + # Miscellaneous + --nologo # Suppress the compiler copyright message + --help # Display the usage message + # Advanced + --codepage: text # Codepage used to read source files + --utf8output # Output messages in UTF-8 + --fullpaths # Output messages with fully qualified paths + --lib(-I): dir # Directory to search for sources and assemblies + --simpleresolution # Resolve references with directory-based rules + --baseaddress: text # Base address of the library + --noframework # Do not reference the default CLI assemblies + --standalone # Statically link FSharp.Core and referenced DLLs + --staticlink: text # Statically link an assembly and its dependents + --pdb: path # Name of the output debug file + --highentropyva # Enable high-entropy ASLR + --highentropyva- # Disable --highentropyva + --subsystemversion: text # Subsystem version of the assembly + --targetprofile: words [mscorlib netcore netstandard] # Target framework profile + --quotations-debug # Emit debug information in quotations + --quotations-debug- # Disable --quotations-debug + ...sources: path # F# source files +] where { + excludes --delaysign --delaysign- + excludes --debug --debug- + excludes --optimize --optimize- + excludes --tailcalls --tailcalls- + excludes --deterministic --deterministic- + excludes --crossoptimize --crossoptimize- + excludes --warnaserror --warnaserror- + excludes --consolecolors --consolecolors- + excludes --checked --checked- + excludes --highentropyva --highentropyva- + excludes --quotations-debug --quotations-debug- + terminal [--help] +} diff --git a/custom-completions/fsharpi/fsharpi-completions.nu b/custom-completions/fsharpi/fsharpi-completions.nu index adb9cdee3..14b5f6eac 100644 --- a/custom-completions/fsharpi/fsharpi-completions.nu +++ b/custom-completions/fsharpi/fsharpi-completions.nu @@ -1,48 +1,72 @@ -# Use the given file on startup -extern "fsharpi" [ - --use # Use the given file on startup - --load # #load the given file on startup - --reference # Reference an assembly - #--debug+(-g) # Emit debug information - --debug- # Disable --debug - #--optimize+(-O) # Enable optimizations - --optimize- # Disable --optimize - #--tailcalls+ # Enable or disable tailcalls - --tailcalls- # Disable --tailcalls - #--deterministic+ # Produce a deterministic assembly - --deterministic- # Disable --deterministic - #--crossoptimize+ # Enable or disable cross-module optimizations - --crossoptimize- # Disable --crossoptimize - #--warnaserror+ # Report all warnings as errors - --warnaserror- # Disable --warnaserror - #--warnaserror+ # Report specific warnings as errors - --warnaserror- # Disable --warnaserror: - --nowarn # Disable specific warning messages - --warnon # Enable specific warnings that may be off by default - #--consolecolors+ # Output warning and error messages in color - --consolecolors- # Disable --consolecolors - #--checked+ # Generate overflow checks - --checked- # Disable --checked - --define # Define conditional compilation symbols - --mlcompatibility # Ignore ML compatibility warnings - --nologo # Suppress compiler copyright message - --help(-?) # Display this usage message - --codepage # Specify the codepage used to read source files - --utf8output # Output messages in UTF-8 encoding - --fullpaths # Output messages with fully qualified paths - --lib # Specify a dir for the include path for source files and assemblies - --simpleresolution # Resolve assembly references using directory-based rules - --targetprofile # Specify target framework profile: mscorlib, netcore or netstandard - --noframework # Do not reference the default CLI assemblies by default - --exec # Exit fsi after loading files or running the .fsx script - #--gui+ # Execute interactions on a Windows Forms event loop - --gui- # Disable --gui - --quiet # Suppress fsi writing to stdout - #--readline+ # Support TAB completion in console - --readline- # Disable --readline - #--quotations-debug+ # Emit debug information in quotations - --quotations-debug- # Disable --quotations-debug - #--shadowcopyreferences+ # Prevents references being locked by the F# Interactive process - --shadowcopyreferences- # Disable --shadowcopyreferences - ...args -] \ No newline at end of file +# Declarative completions for fsharpi, F# Interactive. +# +# fsharpi spells valued options as `--option:value`. The completion profiles split only on +# `=` or whitespace, so valued options are modelled as taking the next word. Option names +# cannot contain `+`, so `--debug+` and its kin are offered as the equivalent bare `--debug`. + +export complete [fsharpi] [ + # Input files + --use: path # Use the file on startup as initial input + --load: path # #load the file on startup + --reference(-r): path # Reference an assembly + # Code generation + --debug(-g) # Emit debug information + --debug- # Disable --debug + --optimize(-O) # Enable optimizations + --optimize- # Disable --optimize + --tailcalls # Enable tailcalls + --tailcalls- # Disable --tailcalls + --deterministic # Produce a deterministic assembly + --deterministic- # Disable --deterministic + --crossoptimize # Enable cross-module optimizations + --crossoptimize- # Disable --crossoptimize + # Errors and warnings + --warnaserror # Report all warnings as errors + --warnaserror- # Disable --warnaserror + --warn: words [0 1 2 3 4 5] # Warning level + --nowarn: text # Disable specific warnings + --warnon: text # Enable specific warnings that are off by default + --consolecolors # Color warning and error messages + --consolecolors- # Disable --consolecolors + # Language + --checked # Generate overflow checks + --checked- # Disable --checked + --define(-d): text # Define a conditional compilation symbol + --mlcompatibility # Ignore ML compatibility warnings + # Miscellaneous + --nologo # Suppress the copyright message + --help # Display the usage message + # Advanced + --codepage: text # Codepage used to read source files + --utf8output # Output messages in UTF-8 + --fullpaths # Output messages with fully qualified paths + --lib(-I): dir # Directory to search for sources and assemblies + --simpleresolution # Resolve references with directory-based rules + --targetprofile: words [mscorlib netcore netstandard] # Target framework profile + --noframework # Do not reference the default CLI assemblies + --exec # Exit after loading the files or running the script + --gui # Run interactions on a Windows Forms event loop + --gui- # Disable --gui + --quiet # Do not write to stdout + --readline # Support TAB completion in the console + --readline- # Disable --readline + --quotations-debug # Emit debug information in quotations + --quotations-debug- # Disable --quotations-debug + --shadowcopyreferences # Do not lock referenced assemblies + --shadowcopyreferences- # Disable --shadowcopyreferences + ...scripts: path # Script files (.fsx) and their arguments +] where { + excludes --debug --debug- + excludes --optimize --optimize- + excludes --tailcalls --tailcalls- + excludes --deterministic --deterministic- + excludes --crossoptimize --crossoptimize- + excludes --warnaserror --warnaserror- + excludes --consolecolors --consolecolors- + excludes --checked --checked- + excludes --gui --gui- + excludes --readline --readline- + excludes --quotations-debug --quotations-debug- + excludes --shadowcopyreferences --shadowcopyreferences- + terminal [--help] +} diff --git a/custom-completions/gh/gh-completions.nu b/custom-completions/gh/gh-completions.nu index 137ad71a2..da4d720e1 100644 --- a/custom-completions/gh/gh-completions.nu +++ b/custom-completions/gh/gh-completions.nu @@ -1,2304 +1,4945 @@ -# nu-version: 0.116.1 - -# Completions for gh (generated from `gh help reference`, gh 2.104.0) and -# your gh aliases. One `gh` extern with no declared flags hands the whole command line to -# `nu-complete gh`, so every argument reaches gh exactly as typed (`--draft=false`, -# `-f body='Hi there'`, `-L5`). Command and flag data are tab-separated rows, decoded only -# for the command being completed. - -# command path, positional kinds, description -const GH_COMMANDS = r#' - gh-command Work seamlessly with GitHub from the command line -agent-task Work with agent tasks (preview) -agent-task create Create an agent task (preview) -agent-task list List agent tasks (preview) -agent-task view pr View an agent task session (preview) -alias Create command shortcuts -alias delete alias Delete set aliases -alias import file Import aliases from a YAML file -alias list List your aliases -alias set Create a shortcut for a gh command -api api-endpoint Make an authenticated GitHub API request -attestation Work with artifact attestations -attestation download file Download an artifact's attestations for offline use -attestation trusted-root Output trusted_root.jsonl contents, likely for offline verification -attestation verify file Verify an artifact's integrity using attestations -auth Authenticate gh and git with GitHub -auth login Log in to a GitHub account -auth logout Log out of a GitHub account -auth refresh Refresh stored authentication credentials -auth setup-git Setup git with GitHub CLI -auth status Display active account and authentication state on each known GitHub host -auth switch Switch active GitHub account -auth token Print the authentication token gh uses for a hostname and account -browse file Open repositories, issues, pull requests, and more in the browser -cache Manage GitHub Actions caches -cache delete cache Delete GitHub Actions caches -cache list List GitHub Actions caches -codespace Connect to and manage codespaces -codespace code Open a codespace in Visual Studio Code -codespace cp file... Copy files between local and remote file systems -codespace create Create a codespace -codespace delete Delete codespaces -codespace edit Edit a codespace -codespace jupyter Open a codespace in JupyterLab -codespace list List codespaces -codespace logs Access codespace logs -codespace ports List ports in a codespace -codespace ports forward Forward ports -codespace ports visibility Change the visibility of the forwarded port -codespace rebuild Rebuild a codespace -codespace ssh SSH into a codespace -codespace stop Stop a running codespace -codespace view View details about a codespace -completion Generate shell completion scripts -config Manage configuration for gh -config clear-cache Clear the cli cache -config get config-key Print the value of a given configuration key -config list Print a list of configuration keys and values -config set config-key config-value Update configuration with a value for the given key -copilot Run the GitHub Copilot CLI (preview) -discussion Work with GitHub Discussions (preview) -discussion comment discussion Add, edit, or delete a comment or a reply on a discussion (preview) -discussion create Create a new discussion (preview) -discussion edit discussion Edit a discussion (preview) -discussion list List discussions in a repository (preview) -discussion view discussion View a discussion (preview) -extension Manage gh extensions -extension browse Enter a UI for browsing, adding, and removing extensions -extension create Create a new extension -extension exec extension none... Execute an installed extension -extension install Install a gh extension from a repository -extension list List installed extension commands -extension remove extension Remove an installed extension -extension search Search extensions to the GitHub CLI -extension upgrade extension Upgrade installed extensions -gist Manage gists -gist clone gist file Clone a gist locally -gist create file... Create a new gist -gist delete gist Delete a gist -gist edit gist gist-file Edit one of your gists -gist list List your gists -gist rename gist gist-file Rename a file in a gist -gist view gist View a gist -gpg-key Manage GPG keys -gpg-key add file Add a GPG key to your GitHub account -gpg-key delete gpg-key Delete a GPG key from your GitHub account -gpg-key list Lists GPG keys in your GitHub account -issue Manage issues -issue artifact Work with issue artifacts (preview) -issue artifact create issue file... Create issue artifacts (preview) -issue artifact delete issue Delete issue artifacts (preview) -issue artifact download issue Download issue artifacts (preview) -issue artifact edit issue Edit an issue artifact (preview) -issue artifact list issue List artifacts on an issue (preview) -issue artifact view issue View an issue artifact (preview) -issue close issue Close issue -issue comment issue Add a comment to an issue -issue create Create a new issue -issue delete issue Delete issue -issue develop issue Manage linked branches for an issue -issue edit issue... Edit issues -issue list List issues in a repository -issue lock issue Lock issue conversation -issue pin issue Pin an issue -issue reopen issue-closed Reopen issue -issue status Show status of relevant issues -issue transfer issue repo Transfer issue to another repository -issue unlock issue Unlock issue conversation -issue unpin issue Unpin an issue -issue view issue View an issue -label Manage labels -label clone repo Clones labels from one repository to another -label create Create a new label -label delete label Delete a label from a repository -label edit label Edit a label -label list List labels in a repository -licenses View third-party license information -org Manage organizations -org list List organizations for the authenticated user. -pr Manage pull requests -pr checkout pr Check out a pull request in git -pr checks pr Show CI status for a single pull request -pr close pr Close a pull request -pr comment pr Add a comment to a pull request -pr create Create a pull request -pr diff pr View changes in a pull request -pr edit pr Edit a pull request -pr list List pull requests in a repository -pr lock pr Lock pull request conversation -pr merge pr Merge a pull request -pr ready pr Mark a pull request as ready for review -pr reopen pr-closed Reopen a pull request -pr revert pr-merged Revert a pull request -pr review pr Add a review to a pull request -pr status Show status of relevant pull requests -pr unlock pr Unlock pull request conversation -pr update-branch pr Update a pull request branch -pr view pr View a pull request -preview Execute previews for gh features -preview prompter prompt-type Execute a test program to preview the prompter -project Work with GitHub Projects. -project close project Close a project -project copy project Copy a project -project create Create a project -project delete project Delete a project -project edit project Edit a project -project field-create project Create a field in a project -project field-delete Delete a field in a project -project field-list project List the fields in a project -project item-add project Add a pull request or an issue to a project -project item-archive project Archive an item in a project -project item-create project Create a draft issue item in a project -project item-delete project Delete an item from a project by ID -project item-edit project Edit an item in a project -project item-list project List the items in a project -project link project Link a project to a repository or a team -project list List the projects for an owner -project mark-template project Mark a project as a template -project unlink project Unlink a project from a repository or a team -project view project View a project -release Manage releases -release create none file... Create a new release -release delete release Delete a release -release delete-asset release release-asset Delete an asset from a release -release download release Download release assets -release edit release Edit a release -release list List releases in a repository -release upload release file... Upload assets to a release -release verify release Verify the attestation for a release -release verify-asset release file Verify that a given asset originated from a release -release view release View information about a release -repo Manage repositories -repo archive repo Archive a repository -repo autolink Manage autolink references -repo autolink create Create a new autolink reference -repo autolink delete autolink Delete an autolink reference -repo autolink list List autolink references for a GitHub repository -repo autolink view autolink View an autolink reference -repo clone repo file Clone a repository locally -repo create Create a new repository -repo delete repo Delete a repository -repo deploy-key Manage deploy keys in a repository -repo deploy-key add file Add a deploy key to a GitHub repository -repo deploy-key delete deploy-key Delete a deploy key from a GitHub repository -repo deploy-key list List deploy keys in a GitHub repository -repo edit repo Edit repository settings -repo fork repo Create a fork of a repository -repo gitignore List and view available repository gitignore templates -repo gitignore list List available repository gitignore templates -repo gitignore view gitignore View an available repository gitignore template -repo license Explore repository licenses -repo license list List common repository licenses -repo license view license View a specific repository license -repo list owner List repositories owned by user or organization -repo read-dir List a directory in a repository (preview) -repo read-file Read a file from a repository (preview) -repo rename Rename a repository -repo set-default repo Configure default repository for this directory -repo sync repo Sync a repository -repo unarchive repo Unarchive a repository -repo view repo View a repository -ruleset View info about repo rulesets -ruleset check branch View rules that would apply to a given branch -ruleset list List rulesets for a repository or organization -ruleset view ruleset View information about a ruleset -run View details about workflow runs -run cancel run Cancel a workflow run -run delete run Delete a workflow run -run download run Download artifacts generated by a workflow run -run list List recent workflow runs -run rerun run Rerun a run -run view run View a summary of a workflow run -run watch run Watch a run until it completes, showing its progress -search Search for repositories, issues, and pull requests -search code Search within code -search commits Search for commits -search issues Search for issues -search prs Search for pull requests -search repos Search for repositories -secret Manage GitHub secrets -secret delete secret Delete secrets -secret list List secrets -secret set secret Create or update secrets -skill Install and manage agent skills (preview) -skill install Install agent skills from a GitHub repository (preview) -skill list List installed skills (preview) -skill preview Preview a skill from a GitHub repository (preview) -skill publish file Validate and publish skills to a GitHub repository (preview) -skill search Search for skills across GitHub (preview) -skill update skill... Update installed skills to their latest versions (preview) -ssh-key Manage SSH keys -ssh-key add file Add an SSH key to your GitHub account -ssh-key delete ssh-key Delete an SSH key from your GitHub account -ssh-key list Lists SSH keys in your GitHub account -status Print information about relevant issues, pull requests, and notifications across repositories -variable Manage GitHub Actions variables -variable delete variable Delete variables -variable get variable Get variables -variable list List variables -variable set variable Create or update variables -workflow View details about GitHub Actions workflows -workflow disable workflow Disable a workflow -workflow enable workflow Enable a workflow -workflow list List workflows -workflow run workflow Run a workflow by creating a workflow_dispatch event -workflow view workflow View the summary of a workflow -help help-topic help-subcommand Help about any command or topic -'# - -# command path, long flag, short flag, b(ool)|v(alue)|i(nt)|f(ile), completer or =values, description -const GH_FLAGS = r#' - version b Show gh version -agent-task create base b v branches Base branch for the pull request (use default branch if not provided) -agent-task create custom-agent a v Use a custom agent for the task. e.g., use 'my-agent' for the 'my-agent.md' agent -agent-task create follow b Follow agent session logs -agent-task create from-file F f Read task description from file (use "-" to read from standard input) -agent-task create repo R v repos Select another repository using the [HOST/]OWNER/REPO format -agent-task list jq q v Filter JSON output using a jq expression -agent-task list json v json-fields Output JSON with the specified fields -agent-task list limit L i Maximum number of agent tasks to fetch (default 30) -agent-task list template t v Format JSON output using a Go template; see "gh help formatting" -agent-task list web w b Open agent tasks in the browser -agent-task view follow b Follow agent session logs -agent-task view jq q v Filter JSON output using a jq expression -agent-task view json v json-fields Output JSON with the specified fields -agent-task view log b Show agent session logs -agent-task view repo R v repos Select another repository using the [HOST/]OWNER/REPO format -agent-task view template t v Format JSON output using a Go template; see "gh help formatting" -agent-task view web w b Open agent task in the browser -alias delete all b Delete all aliases -alias import clobber b Overwrite existing aliases of the same name -alias set clobber b Overwrite existing aliases of the same name -alias set shell s b Declare an alias to be passed through a shell interpreter -api allow-escape-sequences b Allow printing terminal escape sequences -api cache v Cache the response, e.g. "3600s", "60m", "1h" -api field F v Add a typed parameter in key=value format (use "@" or "@-" to read value from file or stdin) -api header H v api-headers Add a HTTP request header in key:value format -api hostname v hosts The GitHub hostname for the request (default "github.com") -api include i b Include HTTP response status line and headers in the output -api input f The file to use as body for the HTTP request (use "-" to read from standard input) -api jq q v Query to select values from the response using jq syntax -api method X v http-methods The HTTP method for the request (default "GET") -api paginate b Make additional HTTP requests to fetch all pages of results -api preview p v Opt into GitHub API previews (names should omit '-preview') -api raw-field f v Add a string parameter in key=value format -api silent b Do not print the response body -api slurp b Use with "--paginate" to return an array of all pages of either JSON arrays or objects -api template t v Format JSON output using a Go template; see "gh help formatting" -api verbose b Include full HTTP request and response in the output -attestation download digest-alg d v =sha256|sha512 The algorithm used to compute a digest of the artifact: {sha256|sha512} (default "sha256") -attestation download hostname v hosts Configure host to use -attestation download limit L i Maximum number of attestations to fetch (default 30) -attestation download owner o v owners GitHub organization to scope attestation lookup by -attestation download predicate-type v Filter attestations by provided predicate type -attestation download repo R v repos Repository name in the format / -attestation trusted-root hostname v hosts Configure host to use -attestation trusted-root tuf-root v Path to the TUF root.json file on disk -attestation trusted-root tuf-url v URL to the TUF repository mirror -attestation trusted-root verify-only b Don't output trusted_root.jsonl contents -attestation verify bundle b v Path to bundle on disk, either a single bundle in a JSON file or a JSON lines file with multiple bundles -attestation verify bundle-from-oci b When verifying an OCI image, fetch the attestation bundle from the OCI registry instead of from GitHub -attestation verify cert-identity v Enforce that the certificate's SubjectAlternativeName matches the provided value exactly -attestation verify cert-identity-regex i v Enforce that the certificate's SubjectAlternativeName matches the provided regex -attestation verify cert-oidc-issuer v Enforce that the issuer of the OIDC token matches the provided value (default "https://token.actions.githubusercontent.com") -attestation verify custom-trusted-root v Path to a trusted_root.jsonl file; likely for offline verification -attestation verify deny-self-hosted-runners b Fail verification for attestations generated on self-hosted runners -attestation verify digest-alg d v =sha256|sha512 The algorithm used to compute a digest of the artifact: {sha256|sha512} (default "sha256") -attestation verify format v =json Output format: {json} -attestation verify hostname v hosts Configure host to use -attestation verify jq q v Filter JSON output using a jq expression -attestation verify limit L i Maximum number of attestations to fetch (default 30) -attestation verify no-public-good b Do not verify attestations signed with Sigstore public good instance -attestation verify owner o v owners GitHub organization to scope attestation lookup by -attestation verify predicate-type v Enforce that verified attestations' predicate type matches the provided value (default "https://slsa.dev/provenance/v1") -attestation verify repo R v repos Repository name in the format / -attestation verify signer-digest v Enforce that the digest associated with the signer workflow matches the provided value -attestation verify signer-repo v repos Enforce that the workflow that signed the attestation's repository matches the provided value (/) -attestation verify signer-workflow v Enforce that the workflow that signed the attestation matches the provided value ([host/]////) -attestation verify source-digest v Enforce that the digest associated with the source repository matches the provided value -attestation verify source-ref v Enforce that the git ref associated with the source repository matches the provided value -attestation verify template t v Format JSON output using a Go template; see "gh help formatting" -auth login clipboard c b Copy one-time OAuth device code to clipboard -auth login expiring b Prefer expiring credentials that gh refreshes automatically, if the host supports them -auth login git-protocol p v =ssh|https The protocol to use for git operations on this host: {ssh|https} -auth login hostname h v hosts The hostname of the GitHub instance to authenticate with -auth login insecure-storage b Save authentication credentials in plain text instead of credential store -auth login scopes s v scopes Additional authentication scopes to request -auth login skip-ssh-key b Skip generate/upload SSH key prompt -auth login web w b Open a browser to authenticate -auth login with-token b Read token from standard input -auth logout hostname h v hosts The hostname of the GitHub instance to log out of -auth logout user u v accounts The account to log out of -auth refresh clipboard c b Copy one-time OAuth device code to clipboard -auth refresh expiring b Prefer expiring credentials that gh refreshes automatically, if the host supports them -auth refresh hostname h v hosts The GitHub host to use for authentication -auth refresh insecure-storage b Save authentication credentials in plain text instead of credential store -auth refresh remove-scopes r v scopes Authentication scopes to remove from gh -auth refresh reset-scopes b Reset authentication scopes to the default minimum set of scopes -auth refresh scopes s v scopes Additional authentication scopes for gh to have -auth setup-git force f b Force setup even if the host is not known. Must be used in conjunction with --hostname -auth setup-git hostname h v hosts The hostname to configure git for -auth status active a b Display the active account only -auth status hostname h v hosts Check only a specific hostname's auth status -auth status jq v Filter JSON output using a jq expression -auth status json v json-fields Output JSON with the specified fields -auth status no-refresh b Do not automatically refresh expired tokens -auth status show-token t b Display the auth token -auth status template v Format JSON output using a Go template; see "gh help formatting" -auth switch hostname h v hosts The hostname of the GitHub instance to switch account for -auth switch user u v accounts The account to switch to -auth token hostname h v hosts The hostname of the GitHub instance authenticated with -auth token no-refresh b Do not automatically refresh an expired token -auth token user u v accounts The account to output the token for -browse actions a b Open repository actions -browse blame b Open blame view for a file -browse branch b v branches Select another branch by passing in the branch name -browse commit c b Select another commit by passing in the commit SHA, default is the last commit -browse no-browser n b Print destination URL instead of opening the browser -browse projects p b Open repository projects -browse releases r b Open repository releases -browse repo R v repos Select another repository using the [HOST/]OWNER/REPO format -browse settings s b Open repository settings -browse wiki w b Open repository wiki -cache repo R v repos Select another repository using the [HOST/]OWNER/REPO format -cache delete all a b Delete all caches, can be used with --ref to delete all caches for a specific ref -cache delete ref r v cache-refs Delete by cache key and ref, formatted as refs/heads/ or refs/pull//merge -cache delete repo R v repos Select another repository using the [HOST/]OWNER/REPO format -cache delete succeed-on-no-caches b Return exit code 0 if no caches found. Must be used in conjunction with --all -cache list jq q v Filter JSON output using a jq expression -cache list json v json-fields Output JSON with the specified fields -cache list key k v Filter by cache key prefix -cache list limit L i Maximum number of caches to fetch (default 30) -cache list order O v =asc|desc Order of caches returned: {asc|desc} (default "desc") -cache list ref r v cache-refs Filter by ref, formatted as refs/heads/ or refs/pull//merge -cache list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -cache list sort S v =created_at|last_accessed_at|size_in_bytes Sort fetched caches: {created_at|last_accessed_at|size_in_bytes} (default "last_accessed_at") -cache list template t v Format JSON output using a Go template; see "gh help formatting" -codespace code codespace c v codespaces Name of the codespace -codespace code insiders b Use the insiders version of Visual Studio Code -codespace code repo R v repos Filter codespace selection by repository name (user/repo) -codespace code repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace code web w b Use the web version of Visual Studio Code -codespace cp codespace c v codespaces Name of the codespace -codespace cp expand e b Expand remote file names on remote shell -codespace cp profile p v Name of the SSH profile to use -codespace cp recursive r b Recursively copy directories -codespace cp repo R v repos Filter codespace selection by repository name (user/repo) -codespace cp repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace create branch b v branches Repository branch -codespace create default-permissions b Do not prompt to accept additional permissions requested by the codespace -codespace create devcontainer-path v Path to the devcontainer.json file to use when creating codespace -codespace create display-name d v Display name for the codespace (48 characters or less) -codespace create idle-timeout v Allowed inactivity before codespace is stopped, e.g. "10m", "1h" -codespace create location l v =EastUs|SouthEastAsia|WestEurope|WestUs2 Location: {EastUs|SouthEastAsia|WestEurope|WestUs2} (determined automatically if not provided) -codespace create machine m v Hardware specifications for the VM -codespace create repo R v repos Repository name with owner: user/repo -codespace create retention-period v Allowed time after shutting down before the codespace is automatically deleted (maximum 30 days), e.g. "1h", "72h" -codespace create status s b Show status of post-create command and dotfiles -codespace create web w b Create codespace from browser, cannot be used with --display-name, --idle-timeout, or --retention-period -codespace delete all b Delete all codespaces -codespace delete codespace c v codespaces Name of the codespace -codespace delete days i Delete codespaces older than N days -codespace delete force f b Skip confirmation for codespaces that contain unsaved changes -codespace delete org o v orgs The login handle of the organization (admin-only) -codespace delete repo R v repos Filter codespace selection by repository name (user/repo) -codespace delete repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace delete user u v The username to delete codespaces for (used with --org) -codespace edit codespace c v codespaces Name of the codespace -codespace edit display-name d v Set the display name -codespace edit machine m v Set hardware specifications for the VM -codespace edit repo R v repos Filter codespace selection by repository name (user/repo) -codespace edit repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace jupyter codespace c v codespaces Name of the codespace -codespace jupyter repo R v repos Filter codespace selection by repository name (user/repo) -codespace jupyter repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace list jq q v Filter JSON output using a jq expression -codespace list json v json-fields Output JSON with the specified fields -codespace list limit L i Maximum number of codespaces to list (default 30) -codespace list org o v orgs The login handle of the organization to list codespaces for (admin-only) -codespace list repo R v repos Repository name with owner: user/repo -codespace list template t v Format JSON output using a Go template; see "gh help formatting" -codespace list user u v The username to list codespaces for (used with --org) -codespace list web w b List codespaces in the web browser, cannot be used with --user or --org -codespace logs codespace c v codespaces Name of the codespace -codespace logs follow f b Tail and follow the logs -codespace logs repo R v repos Filter codespace selection by repository name (user/repo) -codespace logs repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace ports codespace c v codespaces Name of the codespace -codespace ports jq q v Filter JSON output using a jq expression -codespace ports json v json-fields Output JSON with the specified fields -codespace ports repo R v repos Filter codespace selection by repository name (user/repo) -codespace ports repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace ports template t v Format JSON output using a Go template; see "gh help formatting" -codespace ports forward all-interfaces b Listen on all network interfaces -codespace ports forward codespace c v codespaces Name of the codespace -codespace ports forward repo R v repos Filter codespace selection by repository name (user/repo) -codespace ports forward repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace ports visibility codespace c v codespaces Name of the codespace -codespace ports visibility repo R v repos Filter codespace selection by repository name (user/repo) -codespace ports visibility repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace rebuild codespace c v codespaces Name of the codespace -codespace rebuild full b Perform a full rebuild -codespace rebuild repo R v repos Filter codespace selection by repository name (user/repo) -codespace rebuild repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace ssh codespace c v codespaces Name of the codespace -codespace ssh config b Write OpenSSH configuration to stdout -codespace ssh debug d b Log debug data to a file -codespace ssh debug-file v Path of the file log to -codespace ssh profile v Name of the SSH profile to use -codespace ssh repo R v repos Filter codespace selection by repository name (user/repo) -codespace ssh repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace ssh server-port i SSH server port number (0 => pick unused) -codespace stop codespace c v codespaces Name of the codespace -codespace stop org o v orgs The login handle of the organization (admin-only) -codespace stop repo R v repos Filter codespace selection by repository name (user/repo) -codespace stop repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace stop user u v The username to stop codespace for (used with --org) -codespace view codespace c v codespaces Name of the codespace -codespace view jq q v Filter JSON output using a jq expression -codespace view json v json-fields Output JSON with the specified fields -codespace view repo R v repos Filter codespace selection by repository name (user/repo) -codespace view repo-owner v owners Filter codespace selection by repository owner (username or org) -codespace view template t v Format JSON output using a Go template; see "gh help formatting" -completion shell s v =bash|zsh|fish|powershell Shell type: {bash|zsh|fish|powershell} -config get host h v hosts Get per-host setting -config list host h v hosts Get per-host configuration -config set host h v hosts Set per-host setting -copilot remove b Remove the downloaded Copilot CLI -discussion repo R v repos Select another repository using the [HOST/]OWNER/REPO format -discussion comment body b v Comment body text -discussion comment body-file F v Read body text from file (use "-" to read from standard input) -discussion comment delete b Delete the specified comment -discussion comment edit b Edit the specified comment -discussion comment repo R v repos Select another repository using the [HOST/]OWNER/REPO format -discussion comment yes b Skip the delete confirmation prompt -discussion create body b v Body for the discussion -discussion create body-file F v Read body text from file (use "-" to read from stdin) -discussion create category c v Category name or slug for the discussion -discussion create label l v labels Labels to apply to the discussion -discussion create repo R v repos Select another repository using the [HOST/]OWNER/REPO format -discussion create title t v Title for the discussion -discussion edit add-label v labels Add labels by name -discussion edit body b v New body for the discussion -discussion edit body-file F v Read body text from file (use "-" to read from standard input) -discussion edit category c v New category name or slug for the discussion -discussion edit remove-label v labels Remove labels by name -discussion edit repo R v repos Select another repository using the [HOST/]OWNER/REPO format -discussion edit title t v New title for the discussion -discussion list after v Cursor for the next page of results -discussion list answered b Filter by answered state -discussion list author A v users Filter by author -discussion list category c v Filter by category name or slug -discussion list jq q v Filter JSON output using a jq expression -discussion list json v json-fields Output JSON with the specified fields -discussion list label l v labels Filter by label -discussion list limit L i Maximum number of discussions to fetch (default 30) -discussion list order v =asc|desc Order of results: {asc|desc} (default "desc") -discussion list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -discussion list search S v Search discussions with query -discussion list sort v =created|updated Sort by field: {created|updated} (default "updated") -discussion list state s v =open|closed|all Filter by state: {open|closed|all} (default "open") -discussion list template t v Format JSON output using a Go template; see "gh help formatting" -discussion list web w b List discussions in the web browser -discussion view after v Cursor for the next page -discussion view comments c b View discussion comments -discussion view jq q v Filter JSON output using a jq expression -discussion view json v json-fields Output JSON with the specified fields -discussion view limit L i Maximum number of comments or replies to fetch (default 30) -discussion view order v =oldest|newest Order of comments or replies: {oldest|newest} (default "newest") -discussion view repo R v repos Select another repository using the [HOST/]OWNER/REPO format -discussion view template t v Format JSON output using a Go template; see "gh help formatting" -discussion view web w b Open a discussion in the browser -extension browse debug b Log to /tmp/extBrowse-* -extension browse single-column s b Render TUI with only one column of text -extension create precompiled v =go|other Create a precompiled extension. Possible values: go, other -extension install force b Force upgrade extension, or ignore if latest already installed -extension install pin v Pin extension to a release tag or commit ref -extension search jq q v Filter JSON output using a jq expression -extension search json v json-fields Output JSON with the specified fields -extension search license v licenses Filter based on license type -extension search limit L i Maximum number of extensions to fetch (default 30) -extension search order v =asc|desc Order of repositories returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc") -extension search owner v owners Filter on owner -extension search sort v =forks|help-wanted-issues|stars|updated Sort fetched repositories: {forks|help-wanted-issues|stars|updated} (default "best-match") -extension search template t v Format JSON output using a Go template; see "gh help formatting" -extension search web w b Open the search query in the web browser -extension upgrade all b Upgrade all extensions -extension upgrade dry-run b Only display upgrades -extension upgrade force b Force upgrade extension -gist create desc d v A description for this gist -gist create filename f v Provide a filename to be used when reading from standard input -gist create public p b List the gist publicly (default "secret") -gist create web w b Open the web browser with created gist -gist delete yes b Confirm deletion without prompting -gist edit add a v Add a new file to the gist -gist edit desc d v New description for the gist -gist edit filename f v gist-files Select a file to edit -gist edit remove r v gist-files Remove a file from the gist -gist list filter v Filter gists using a regular expression -gist list include-content b Include gists' file content when filtering -gist list limit L i Maximum number of gists to fetch (default 10) -gist list public b Show only public gists -gist list secret b Show only secret gists -gist view allow-escape-sequences b Allow printing terminal escape sequences -gist view filename f v gist-files Display a single file from the gist -gist view files b List file names from the gist -gist view raw r b Print raw instead of rendered gist contents -gist view web w b Open gist in the browser -gpg-key add title t v Title for the new key -gpg-key delete yes y b Skip the confirmation prompt -issue repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue artifact repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue artifact create attach f Attach an image or video file, in '#' format -issue artifact create body b v Content for a single document -issue artifact create body-file F f Read content for a single artifact from file (use "-" to read from standard input) -issue artifact create name v Name for a single artifact -issue artifact create repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue artifact create type v =generic|plan|embedded_html Type for documents: {generic|plan|embedded_html} -issue artifact delete repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue artifact delete yes b Confirm deletion without prompting -issue artifact download clobber b Overwrite existing files of the same name -issue artifact download dir D f The directory to download files into (default ".") -issue artifact download output O f The file to write a single artifact to (use "-" to write to standard output) -issue artifact download repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue artifact download skip-existing b Skip downloading when files of the same name exist -issue artifact download version v Download the version with this number from the edit history -issue artifact edit attach f Attach an image or video file, in '#' format -issue artifact edit body b v New content; for a link, a URL -issue artifact edit body-file F f Read new content from file (use "-" to read from standard input) -issue artifact edit name v New name -issue artifact edit repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue artifact edit restore-version v Restore the version with this number from the edit history -issue artifact list jq q v Filter JSON output using a jq expression -issue artifact list json v json-fields Output JSON with the specified fields -issue artifact list limit L i Maximum number of artifacts to fetch -issue artifact list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue artifact list template t v Format JSON output using a Go template; see "gh help formatting" -issue artifact list type v =generic|plan|link|embedded_html Filter by type: {generic|plan|link|embedded_html} -issue artifact view jq q v Filter JSON output using a jq expression -issue artifact view json v json-fields Output JSON with the specified fields -issue artifact view repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue artifact view template t v Format JSON output using a Go template; see "gh help formatting" -issue artifact view version v Show the version with this number from the edit history -issue artifact view web w b Open a document's page on GitHub, or a link's URL -issue close comment c v Leave a closing comment -issue close duplicate-of v issues Mark as duplicate of another issue by number or URL -issue close reason r v close-reasons Reason for closing: {completed|not planned|duplicate} -issue close repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue comment attach f Attach an image or video file, in '#' format -issue comment body b v The comment body text -issue comment body-file F f Read body text from file (use "-" to read from standard input) -issue comment create-if-none b Create a new comment if no comments are found. Can be used only with --edit-last -issue comment delete-last b Delete the last comment of the current user -issue comment edit-last b Edit the last comment of the current user -issue comment editor e b Skip prompts and open the text editor to write the body in -issue comment repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue comment web w b Open the web browser to write the comment -issue comment yes b Skip the delete confirmation prompt when --delete-last is provided -issue create assignee a v users Assign people by their login. Use "@me" to self-assign. -issue create attach f Attach an image or video file, in '#' format -issue create blocked-by v issues Mark the new issue as blocked by these issue numbers or URLs -issue create blocking v issues Mark the new issue as blocking these issue numbers or URLs -issue create body b v Supply a body. Will prompt for one otherwise. -issue create body-file F f Read body text from file (use "-" to read from standard input) -issue create editor e b Skip prompts and open the text editor to write the title and body in. The first line is the title and the remaining text is the body. -issue create label l v labels Add labels by name -issue create milestone m v milestones Add the issue to a milestone by name -issue create parent v issues Add the new issue as a sub-issue of the specified parent number or URL -issue create project p v projects Add the issue to projects by title -issue create recover v Recover input from a failed run of create -issue create repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue create template T v issue-templates Template name to use as starting body text -issue create title t v Supply a title. Will prompt for one otherwise. -issue create type v Set the issue type by name -issue create web w b Open the browser to create an issue -issue delete repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue delete yes b Confirm deletion without prompting -issue develop base b v branches Name of the remote branch you want to make your new branch from -issue develop branch-repo v repos Name or URL of the repository where you want to create your new branch -issue develop checkout c b Checkout the branch after creating it -issue develop list l b List linked branches for the issue -issue develop name n v Name of the branch to create -issue develop repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue develop worktree f Check out the branch into a worktree at the given path -issue edit add-assignee v users Add assigned users by their login. Use "@me" to assign yourself, or "@copilot" to assign Copilot. -issue edit add-blocked-by v issues Add 'blocked by' relationships by issue number or URL -issue edit add-blocking v issues Add 'blocking' relationships by issue number or URL -issue edit add-label v labels Add labels by name -issue edit add-project v projects Add the issue to projects by title -issue edit add-sub-issue v issues Add sub-issues by number or URL -issue edit attach f Attach an image or video file, in '#' format -issue edit body b v Set the new body. -issue edit body-file F f Read body text from file (use "-" to read from standard input) -issue edit milestone m v milestones Edit the milestone the issue belongs to by name -issue edit parent v issues Set the parent issue by number or URL -issue edit remove-assignee v users Remove assigned users by their login. Use "@me" to unassign yourself, or "@copilot" to unassign Copilot. -issue edit remove-blocked-by v issues Remove 'blocked by' relationships by issue number or URL -issue edit remove-blocking v issues Remove 'blocking' relationships by issue number or URL -issue edit remove-label v labels Remove labels by name -issue edit remove-milestone b Remove the milestone association from the issue -issue edit remove-parent b Remove the parent issue -issue edit remove-project v projects Remove the issue from projects by title -issue edit remove-sub-issue v issues Remove sub-issues by number or URL -issue edit remove-type b Remove the issue type from the issue -issue edit repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue edit title t v Set the new title. -issue edit type v Set the issue type by name -issue list app v Filter by GitHub App author -issue list assignee a v users Filter by assignee -issue list author A v users Filter by author (use --app to filter by a GitHub App) -issue list jq q v Filter JSON output using a jq expression -issue list json v json-fields Output JSON with the specified fields -issue list label l v labels Filter by label -issue list limit L i Maximum number of issues to fetch (default 30) -issue list mention v users Filter by mention -issue list milestone m v milestones Filter by milestone number or title -issue list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue list search S v Search issues with query -issue list state s v =open|closed|all Filter by state: {open|closed|all} (default "open") -issue list template t v Format JSON output using a Go template; see "gh help formatting" -issue list type v Filter by issue type name -issue list web w b List issues in the web browser -issue lock reason r v lock-reasons Optional reason for locking conversation (off_topic, resolved, spam, too_heated). -issue lock repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue pin repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue reopen comment c v Add a reopening comment -issue reopen repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue status jq q v Filter JSON output using a jq expression -issue status json v json-fields Output JSON with the specified fields -issue status repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue status template t v Format JSON output using a Go template; see "gh help formatting" -issue transfer repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue unlock repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue unpin repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue view comments c b View issue comments -issue view jq q v Filter JSON output using a jq expression -issue view json v json-fields Output JSON with the specified fields -issue view repo R v repos Select another repository using the [HOST/]OWNER/REPO format -issue view template t v Format JSON output using a Go template; see "gh help formatting" -issue view web w b Open an issue in the browser -label repo R v repos Select another repository using the [HOST/]OWNER/REPO format -label clone force f b Overwrite labels in the destination repository -label clone repo R v repos Select another repository using the [HOST/]OWNER/REPO format -label create color c v Color of the label -label create description d v Description of the label -label create force f b Update the label color and description if label already exists -label create repo R v repos Select another repository using the [HOST/]OWNER/REPO format -label delete repo R v repos Select another repository using the [HOST/]OWNER/REPO format -label delete yes b Confirm deletion without prompting -label edit color c v Color of the label -label edit description d v Description of the label -label edit name n v New name of the label -label edit repo R v repos Select another repository using the [HOST/]OWNER/REPO format -label list jq q v Filter JSON output using a jq expression -label list json v json-fields Output JSON with the specified fields -label list limit L i Maximum number of labels to fetch (default 30) -label list order v =asc|desc Order of labels returned: {asc|desc} (default "asc") -label list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -label list search S v Search label names and descriptions -label list sort v =created|name Sort fetched labels: {created|name} (default "created") -label list template t v Format JSON output using a Go template; see "gh help formatting" -label list web w b List labels in the web browser -org list limit L i Maximum number of organizations to list (default 30) -pr repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr checkout branch b v Local branch name to use (default [the name of the head branch]) -pr checkout detach b Checkout PR with a detached HEAD -pr checkout force f b Reset the existing local branch to the latest state of the pull request -pr checkout recurse-submodules b Update all submodules after checkout -pr checkout repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr checkout worktree f Check out the pull request into a worktree at the given path -pr checks fail-fast b Exit watch mode on first check failure -pr checks interval i i Refresh interval in seconds in watch mode (default 10) -pr checks jq q v Filter JSON output using a jq expression -pr checks json v json-fields Output JSON with the specified fields -pr checks repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr checks required b Only show checks that are required -pr checks template t v Format JSON output using a Go template; see "gh help formatting" -pr checks watch b Watch checks until they finish -pr checks web w b Open the web browser to show details about checks -pr close comment c v Leave a closing comment -pr close delete-branch d b Delete the local and remote branch after close -pr close repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr comment attach f Attach an image or video file, in '#' format -pr comment body b v The comment body text -pr comment body-file F f Read body text from file (use "-" to read from standard input) -pr comment create-if-none b Create a new comment if no comments are found. Can be used only with --edit-last -pr comment delete-last b Delete the last comment of the current user -pr comment edit-last b Edit the last comment of the current user -pr comment editor e b Skip prompts and open the text editor to write the body in -pr comment repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr comment web w b Open the web browser to write the comment -pr comment yes b Skip the delete confirmation prompt when --delete-last is provided -pr create assignee a v users Assign people by their login. Use "@me" to self-assign. -pr create attach f Attach an image or video file, in '#' format -pr create base B v branches The branch into which you want your code merged -pr create body b v Body for the pull request -pr create body-file F f Read body text from file (use "-" to read from standard input) -pr create draft d b Mark pull request as a draft -pr create dry-run b Print details instead of creating the PR. May still push git changes. -pr create editor e b Skip prompts and open the text editor to write the title and body in. The first line is the title and the remaining text is the body. -pr create fill f b Use commit info for title and body -pr create fill-first b Use first commit info for title and body -pr create fill-verbose b Use commits msg+body for description -pr create head H v branches The branch that contains commits for your pull request (default [current branch]) -pr create label l v labels Add labels by name -pr create milestone m v milestones Add the pull request to a milestone by name -pr create no-maintainer-edit b Disable maintainer's ability to modify pull request -pr create project p v projects Add the pull request to projects by title -pr create recover v Recover input from a failed run of create -pr create repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr create reviewer r v users Request reviews from people or teams by their handle -pr create template T f Template file to use as starting body text -pr create title t v Title for the pull request -pr create web w b Open the web browser to create a pull request -pr diff allow-escape-sequences b Allow printing terminal escape sequences -pr diff color v =always|never|auto Use color in diff output: {always|never|auto} (default "auto") -pr diff exclude e v Exclude files matching glob patterns from the diff -pr diff name-only b Display only names of changed files -pr diff patch b Display diff in patch format -pr diff repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr diff web w b Open the pull request diff in the browser -pr edit add-assignee v users Add assigned users by their login. Use "@me" to assign yourself, or "@copilot" to assign Copilot. -pr edit add-label v labels Add labels by name -pr edit add-project v projects Add the pull request to projects by title -pr edit add-reviewer v users Add or re-request reviewers by their login. Use "@copilot" to request review from Copilot. -pr edit attach f Attach an image or video file, in '#' format -pr edit base B v branches Change the base branch for this pull request -pr edit body b v Set the new body. -pr edit body-file F f Read body text from file (use "-" to read from standard input) -pr edit milestone m v milestones Edit the milestone the pull request belongs to by name -pr edit remove-assignee v users Remove assigned users by their login. Use "@me" to unassign yourself, or "@copilot" to unassign Copilot. -pr edit remove-label v labels Remove labels by name -pr edit remove-milestone b Remove the milestone association from the pull request -pr edit remove-project v projects Remove the pull request from projects by title -pr edit remove-reviewer v users Remove reviewers by their login. Use "@copilot" to remove review request from Copilot. -pr edit repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr edit title t v Set the new title. -pr list app v Filter by GitHub App author -pr list assignee a v users Filter by assignee -pr list author A v users Filter by author (use --app to filter by a GitHub App) -pr list base B v branches Filter by base branch -pr list draft d b Filter by draft state -pr list head H v branches Filter by head branch (":" syntax not supported) -pr list jq q v Filter JSON output using a jq expression -pr list json v json-fields Output JSON with the specified fields -pr list label l v labels Filter by label -pr list limit L i Maximum number of items to fetch (default 30) -pr list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr list search S v Search pull requests with query -pr list state s v =open|closed|merged|all Filter by state: {open|closed|merged|all} (default "open") -pr list template t v Format JSON output using a Go template; see "gh help formatting" -pr list web w b List pull requests in the web browser -pr lock reason r v lock-reasons Optional reason for locking conversation (off_topic, resolved, spam, too_heated). -pr lock repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr merge admin b Use administrator privileges to merge a pull request that does not meet requirements -pr merge author-email A v Email text for merge commit author -pr merge auto b Automatically merge only after necessary requirements are met -pr merge body b v Body text for the merge commit -pr merge body-file F f Read body text from file (use "-" to read from standard input) -pr merge delete-branch d b Delete the local and remote branch after merge -pr merge disable-auto b Disable auto-merge for this pull request -pr merge match-head-commit v commits Commit SHA that the pull request head must match to allow merge -pr merge merge m b Merge the commits with the base branch -pr merge rebase r b Rebase the commits onto the base branch -pr merge repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr merge squash s b Squash the commits into one commit and merge it into the base branch -pr merge subject t v Subject text for the merge commit -pr ready repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr ready undo b Convert a pull request to "draft" -pr reopen comment c v Add a reopening comment -pr reopen repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr revert body b v Body for the revert pull request -pr revert body-file F f Read body text from file (use "-" to read from standard input) -pr revert draft d b Mark revert pull request as a draft -pr revert repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr revert title t v Title for the revert pull request -pr review approve a b Approve pull request -pr review body b v Specify the body of a review -pr review body-file F f Read body text from file (use "-" to read from standard input) -pr review comment c b Comment on a pull request -pr review repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr review request-changes r b Request changes on a pull request -pr status conflict-status c b Display the merge conflict status of each pull request -pr status jq q v Filter JSON output using a jq expression -pr status json v json-fields Output JSON with the specified fields -pr status repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr status template t v Format JSON output using a Go template; see "gh help formatting" -pr unlock repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr update-branch rebase b Update PR branch by rebasing on top of latest base branch -pr update-branch repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr view comments c b View pull request comments -pr view jq q v Filter JSON output using a jq expression -pr view json v json-fields Output JSON with the specified fields -pr view repo R v repos Select another repository using the [HOST/]OWNER/REPO format -pr view template t v Format JSON output using a Go template; see "gh help formatting" -pr view web w b Open a pull request in the browser -project close format v =json Output format: {json} -project close jq q v Filter JSON output using a jq expression -project close owner v owners Login of the owner. Use "@me" for the current user. -project close template t v Format JSON output using a Go template; see "gh help formatting" -project close undo b Reopen a closed project -project copy drafts b Include draft issues when copying -project copy format v =json Output format: {json} -project copy jq q v Filter JSON output using a jq expression -project copy source-owner v owners Login of the source owner. Use "@me" for the current user. -project copy target-owner v owners Login of the target owner. Use "@me" for the current user. -project copy template t v Format JSON output using a Go template; see "gh help formatting" -project copy title v Title for the new project -project create format v =json Output format: {json} -project create jq q v Filter JSON output using a jq expression -project create owner v owners Login of the owner. Use "@me" for the current user. -project create template t v Format JSON output using a Go template; see "gh help formatting" -project create title v Title for the project -project delete format v =json Output format: {json} -project delete jq q v Filter JSON output using a jq expression -project delete owner v owners Login of the owner. Use "@me" for the current user. -project delete template t v Format JSON output using a Go template; see "gh help formatting" -project edit description d v New description of the project -project edit format v =json Output format: {json} -project edit jq q v Filter JSON output using a jq expression -project edit owner v owners Login of the owner. Use "@me" for the current user. -project edit readme v New readme for the project -project edit template t v Format JSON output using a Go template; see "gh help formatting" -project edit title v New title for the project -project edit visibility v =PUBLIC|PRIVATE Change project visibility: {PUBLIC|PRIVATE} -project field-create data-type v =TEXT|SINGLE_SELECT|DATE|NUMBER DataType of the new field.: {TEXT|SINGLE_SELECT|DATE|NUMBER} -project field-create format v =json Output format: {json} -project field-create jq q v Filter JSON output using a jq expression -project field-create name v Name of the new field -project field-create owner v owners Login of the owner. Use "@me" for the current user. -project field-create single-select-options v Options for SINGLE_SELECT data type -project field-create template t v Format JSON output using a Go template; see "gh help formatting" -project field-delete format v =json Output format: {json} -project field-delete id v ID of the field to delete -project field-delete jq q v Filter JSON output using a jq expression -project field-delete template t v Format JSON output using a Go template; see "gh help formatting" -project field-list format v =json Output format: {json} -project field-list jq q v Filter JSON output using a jq expression -project field-list limit L i Maximum number of fields to fetch (default 30) -project field-list owner v owners Login of the owner. Use "@me" for the current user. -project field-list template t v Format JSON output using a Go template; see "gh help formatting" -project item-add format v =json Output format: {json} -project item-add jq q v Filter JSON output using a jq expression -project item-add owner v owners Login of the owner. Use "@me" for the current user. -project item-add template t v Format JSON output using a Go template; see "gh help formatting" -project item-add url v URL of the issue or pull request to add to the project -project item-archive format v =json Output format: {json} -project item-archive id v ID of the item to archive -project item-archive jq q v Filter JSON output using a jq expression -project item-archive owner v owners Login of the owner. Use "@me" for the current user. -project item-archive template t v Format JSON output using a Go template; see "gh help formatting" -project item-archive undo b Unarchive an item -project item-create body v Body for the draft issue -project item-create format v =json Output format: {json} -project item-create jq q v Filter JSON output using a jq expression -project item-create owner v owners Login of the owner. Use "@me" for the current user. -project item-create template t v Format JSON output using a Go template; see "gh help formatting" -project item-create title v Title for the draft issue -project item-delete format v =json Output format: {json} -project item-delete id v ID of the item to delete -project item-delete jq q v Filter JSON output using a jq expression -project item-delete owner v owners Login of the owner. Use "@me" for the current user. -project item-delete template t v Format JSON output using a Go template; see "gh help formatting" -project item-edit body v Body of the draft issue item -project item-edit clear b Remove field value -project item-edit date v Date value for the field (YYYY-MM-DD) -project item-edit field v Name of the field to update -project item-edit field-id v ID of the field to update -project item-edit format v =json Output format: {json} -project item-edit id v ID of the item to edit -project item-edit iteration-id v ID of the iteration value to set on the field -project item-edit jq q v Filter JSON output using a jq expression -project item-edit number v Number value for the field -project item-edit owner v owners Login of the owner. Use "@me" for the current user. -project item-edit project-id v ID of the project to which the field belongs to -project item-edit single-select-option-id v ID of the single select option value to set on the field -project item-edit template t v Format JSON output using a Go template; see "gh help formatting" -project item-edit text v Text value for the field -project item-edit title v Title of the draft issue item -project item-edit url v URL of the issue or pull request whose project item to edit -project item-edit value v Value to set on the field named by --field -project item-list field v Name of a field to show as an extra column -project item-list field-id v ID of a field to show as an extra column -project item-list format v =json Output format: {json} -project item-list jq q v Filter JSON output using a jq expression -project item-list limit L i Maximum number of items to fetch (default 30) -project item-list owner v owners Login of the owner. Use "@me" for the current user -project item-list query v Filter items using the Projects filter syntax, e.g. "assignee:octocat -status:Done" -project item-list template t v Format JSON output using a Go template; see "gh help formatting" -project link owner v owners Login of the owner. Use "@me" for the current user. -project link repo R v repos The repository to be linked to this project -project link team T v The team to be linked to this project -project list closed b Include closed projects -project list format v =json Output format: {json} -project list jq q v Filter JSON output using a jq expression -project list limit L i Maximum number of projects to fetch (default 30) -project list owner v owners Login of the owner -project list template t v Format JSON output using a Go template; see "gh help formatting" -project list web w b Open projects list in the browser -project mark-template format v =json Output format: {json} -project mark-template jq q v Filter JSON output using a jq expression -project mark-template owner v owners Login of the org owner. -project mark-template template t v Format JSON output using a Go template; see "gh help formatting" -project mark-template undo b Unmark the project as a template. -project unlink owner v owners Login of the owner. Use "@me" for the current user. -project unlink repo R v repos The repository to be unlinked from this project -project unlink team T v The team to be unlinked from this project -project view format v =json Output format: {json} -project view jq q v Filter JSON output using a jq expression -project view owner v owners Login of the owner. Use "@me" for the current user. -project view template t v Format JSON output using a Go template; see "gh help formatting" -project view web w b Open a project in the browser -release repo R v repos Select another repository using the [HOST/]OWNER/REPO format -release create discussion-category v Start a discussion in the specified category -release create draft d b Save the release as a draft instead of publishing it -release create fail-on-no-commits b Fail if there are no commits since the last release (no impact on the first release) -release create generate-notes b Automatically generate title and notes for the release via GitHub Release Notes API -release create latest b Mark this release as "Latest" (default [automatic based on date and version]). --latest=false to explicitly NOT set as latest -release create notes n v Release notes -release create notes-file F f Read release notes from file (use "-" to read from standard input) -release create notes-from-tag b Fetch notes from the tag annotation or message of commit associated with tag -release create notes-start-tag v releases Tag to use as the starting point for generating release notes -release create prerelease p b Mark the release as a prerelease -release create repo R v repos Select another repository using the [HOST/]OWNER/REPO format -release create target v branches Target branch or full commit SHA (default [main branch]) -release create title t v Release title -release create verify-tag b Abort in case the git tag doesn't already exist in the remote repository -release delete cleanup-tag b Delete the specified tag in addition to its release -release delete repo R v repos Select another repository using the [HOST/]OWNER/REPO format -release delete yes y b Skip the confirmation prompt -release delete-asset repo R v repos Select another repository using the [HOST/]OWNER/REPO format -release delete-asset yes y b Skip the confirmation prompt -release download allow-escape-sequences b Allow printing terminal escape sequences when writing an asset to standard output -release download archive A v archive-formats Download the source code archive in the specified format (zip or tar.gz) -release download clobber b Overwrite existing files of the same name -release download dir D f The directory to download files into (default ".") -release download output O f The file to write a single asset to (use "-" to write to standard output) -release download pattern p v Download only assets that match a glob pattern -release download repo R v repos Select another repository using the [HOST/]OWNER/REPO format -release download skip-existing b Skip downloading when files of the same name exist -release edit discussion-category v Start a discussion in the specified category when publishing a draft -release edit draft b Save the release as a draft instead of publishing it -release edit latest b Explicitly mark the release as "Latest" -release edit notes n v Release notes -release edit notes-file F f Read release notes from file (use "-" to read from standard input) -release edit prerelease b Mark the release as a prerelease -release edit repo R v repos Select another repository using the [HOST/]OWNER/REPO format -release edit tag v The name of the tag -release edit target v branches Target branch or full commit SHA (default [main branch]) -release edit title t v Release title -release edit verify-tag b Abort in case the git tag doesn't already exist in the remote repository -release list exclude-drafts b Exclude draft releases -release list exclude-pre-releases b Exclude pre-releases -release list jq q v Filter JSON output using a jq expression -release list json v json-fields Output JSON with the specified fields -release list limit L i Maximum number of items to fetch (default 30) -release list order O v =asc|desc Order of releases returned: {asc|desc} (default "desc") -release list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -release list template t v Format JSON output using a Go template; see "gh help formatting" -release upload clobber b Delete and re-upload existing assets of the same name -release upload repo R v repos Select another repository using the [HOST/]OWNER/REPO format -release verify format v =json Output format: {json} -release verify jq q v Filter JSON output using a jq expression -release verify repo R v repos Select another repository using the [HOST/]OWNER/REPO format -release verify template t v Format JSON output using a Go template; see "gh help formatting" -release verify-asset format v =json Output format: {json} -release verify-asset jq q v Filter JSON output using a jq expression -release verify-asset repo R v repos Select another repository using the [HOST/]OWNER/REPO format -release verify-asset template t v Format JSON output using a Go template; see "gh help formatting" -release view jq q v Filter JSON output using a jq expression -release view json v json-fields Output JSON with the specified fields -release view repo R v repos Select another repository using the [HOST/]OWNER/REPO format -release view template t v Format JSON output using a Go template; see "gh help formatting" -release view web w b Open the release in the browser -repo archive yes y b Skip the confirmation prompt -repo autolink repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo autolink create numeric n b Mark autolink as numeric -repo autolink create repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo autolink delete repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo autolink delete yes b Confirm deletion without prompting -repo autolink list jq q v Filter JSON output using a jq expression -repo autolink list json v json-fields Output JSON with the specified fields -repo autolink list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo autolink list template t v Format JSON output using a Go template; see "gh help formatting" -repo autolink list web w b List autolink references in the web browser -repo autolink view jq q v Filter JSON output using a jq expression -repo autolink view json v json-fields Output JSON with the specified fields -repo autolink view repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo autolink view template t v Format JSON output using a Go template; see "gh help formatting" -repo clone no-upstream b Do not add an upstream remote when cloning a fork -repo clone upstream-remote-name u v Upstream remote name when cloning a fork (default "upstream") -repo create add-readme b Add a README file to the new repository -repo create clone c b Clone the new repository to the current directory -repo create description d v Description of the repository -repo create disable-issues b Disable issues in the new repository -repo create disable-wiki b Disable wiki in the new repository -repo create gitignore g v gitignores Specify a gitignore template for the repository -repo create homepage h v Repository home page URL -repo create include-all-branches b Include all branches from template repository -repo create internal b Make the new repository internal -repo create license l v licenses Specify an Open Source License for the repository -repo create private b Make the new repository private -repo create public b Make the new repository public -repo create push b Push local commits to the new repository -repo create remote r v Specify remote name for the new repository -repo create source s v Specify path to local repository to use as source -repo create team t v The name of the organization team to be granted access -repo create template p v repos Make the new repository based on a template repository -repo delete accept-cascading-deletion-of-private-forks b Accept that deleting a private repository also deletes its forks -repo delete yes b Confirm deletion without prompting for confirmation -repo deploy-key repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo deploy-key add allow-write w b Allow write access for the key -repo deploy-key add repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo deploy-key add title t v Title of the new key -repo deploy-key delete repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo deploy-key list jq q v Filter JSON output using a jq expression -repo deploy-key list json v json-fields Output JSON with the specified fields -repo deploy-key list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo deploy-key list template t v Format JSON output using a Go template; see "gh help formatting" -repo edit accept-visibility-change-consequences b Accept the consequences of changing the repository visibility -repo edit add-topic v Add repository topic -repo edit allow-forking b Allow forking of an organization repository -repo edit allow-update-branch b Allow a pull request head branch that is behind its base branch to be updated -repo edit default-branch v branches Set the default branch name for the repository -repo edit delete-branch-on-merge b Delete head branch when pull requests are merged -repo edit description d v Description of the repository -repo edit enable-advanced-security b Enable advanced security in the repository -repo edit enable-auto-merge b Enable auto-merge functionality -repo edit enable-discussions b Enable discussions in the repository -repo edit enable-issues b Enable issues in the repository -repo edit enable-merge-commit b Enable merging pull requests via merge commit -repo edit enable-projects b Enable projects in the repository -repo edit enable-rebase-merge b Enable merging pull requests via rebase -repo edit enable-secret-scanning b Enable secret scanning in the repository -repo edit enable-secret-scanning-push-protection b Enable secret scanning push protection in the repository. Secret scanning must be enabled first -repo edit enable-squash-merge b Enable merging pull requests via squashed commit -repo edit enable-wiki b Enable wiki in the repository -repo edit homepage h v Repository home page URL -repo edit remove-topic v repo-topics Remove repository topic -repo edit squash-merge-commit-message v =default|pr-title|pr-title-commits|pr-title-description The default value for a squash merge commit message: {default|pr-title|pr-title-commits|pr-title-description} -repo edit template b Make the repository available as a template repository -repo edit visibility v =public|private|internal Change the visibility of the repository to {public,private,internal} -repo fork clone b Clone the fork -repo fork default-branch-only b Only include the default branch in the fork -repo fork fork-name v Rename the forked repository -repo fork org v orgs Create the fork in an organization -repo fork remote b Add a git remote for the fork -repo fork remote-name v Specify the name for the new remote (default "origin") -repo license view web w b Open https://choosealicense.com/ in the browser -repo list archived b Show only archived repositories -repo list fork b Show only forks -repo list jq q v Filter JSON output using a jq expression -repo list json v json-fields Output JSON with the specified fields -repo list language l v Filter by primary coding language -repo list limit L i Maximum number of repositories to list (default 30) -repo list no-archived b Omit archived repositories -repo list source b Show only non-forks -repo list template t v Format JSON output using a Go template; see "gh help formatting" -repo list topic v Filter by topic -repo list visibility v =public|private|internal Filter by repository visibility: {public|private|internal} -repo read-dir jq q v Filter JSON output using a jq expression -repo read-dir json v json-fields Output JSON with the specified fields -repo read-dir ref v branches The branch, tag, or commit to list from -repo read-dir repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo read-dir template t v Format JSON output using a Go template; see "gh help formatting" -repo read-file allow-escape-sequences b Allow printing terminal escape sequences -repo read-file clobber b Overwrite the output path if it already exists -repo read-file jq q v Filter JSON output using a jq expression -repo read-file json v json-fields Output JSON with the specified fields -repo read-file output o f Write the file to a path instead of stdout -repo read-file ref v branches The branch, tag, or commit to read from -repo read-file repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo read-file template t v Format JSON output using a Go template; see "gh help formatting" -repo rename repo R v repos Select another repository using the [HOST/]OWNER/REPO format -repo rename yes y b Skip the confirmation prompt -repo set-default unset u b Unset the current default repository -repo set-default view v b View the current default repository -repo sync branch b v branches Branch to sync (default [default branch]) -repo sync force b Hard reset the branch of the destination repository to match the source repository -repo sync source s v repos Source repository -repo unarchive yes y b Skip the confirmation prompt -repo view branch b v View a specific branch of the repository -repo view jq q v Filter JSON output using a jq expression -repo view json v json-fields Output JSON with the specified fields -repo view template t v Format JSON output using a Go template; see "gh help formatting" -repo view web w b Open a repository in the browser -ruleset repo R v repos Select another repository using the [HOST/]OWNER/REPO format -ruleset check default b Check rules on default branch -ruleset check repo R v repos Select another repository using the [HOST/]OWNER/REPO format -ruleset check web w b Open the branch rules page in a web browser -ruleset list limit L i Maximum number of rulesets to list (default 30) -ruleset list org o v orgs List organization-wide rulesets for the provided organization -ruleset list parents p b Whether to include rulesets configured at higher levels that also apply (default true) -ruleset list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -ruleset list web w b Open the list of rulesets in the web browser -ruleset view org o v orgs Organization name if the provided ID is an organization-level ruleset -ruleset view parents p b Whether to include rulesets configured at higher levels that also apply (default true) -ruleset view repo R v repos Select another repository using the [HOST/]OWNER/REPO format -ruleset view web w b Open the ruleset in the browser -run repo R v repos Select another repository using the [HOST/]OWNER/REPO format -run cancel force b Force cancel a workflow run -run cancel repo R v repos Select another repository using the [HOST/]OWNER/REPO format -run delete repo R v repos Select another repository using the [HOST/]OWNER/REPO format -run download dir D v The directory to download artifacts into (default ".") -run download name n v artifacts Download artifacts that match any of the given names -run download pattern p v Download artifacts that match a glob pattern -run download repo R v repos Select another repository using the [HOST/]OWNER/REPO format -run list all a b Include disabled workflows -run list branch b v branches Filter runs by branch -run list commit c v commits Filter runs by the SHA of the commit -run list created v Filter runs by the date it was created -run list event e v events Filter runs by which event triggered the run -run list jq q v Filter JSON output using a jq expression -run list json v json-fields Output JSON with the specified fields -run list limit L i Maximum number of runs to fetch (default 20) -run list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -run list status s v =queued|completed|in_progress|requested|waiting|pending|action_required|cancelled|failure|neutral|skipped|stale|startup_failure|success|timed_out Filter runs by status: {queued|completed|in_progress|requested|waiting|pending|action_required|cancelled|failure|neutral|skipped|stale|startup_failure|success|timed_out} -run list template t v Format JSON output using a Go template; see "gh help formatting" -run list user u v Filter runs by user who triggered the run -run list workflow w v workflows Filter runs by workflow -run rerun debug d b Rerun with debug logging -run rerun failed b Rerun only failed jobs, including dependencies -run rerun job j v run-jobs Rerun a specific job ID from a run, including dependencies -run rerun repo R v repos Select another repository using the [HOST/]OWNER/REPO format -run view attempt a i The attempt number of the workflow run -run view exit-status b Exit with non-zero status if run failed -run view job j v run-jobs View a specific job ID from a run -run view jq q v Filter JSON output using a jq expression -run view json v json-fields Output JSON with the specified fields -run view log b View full log for either a run or specific job -run view log-failed b View the log for any failed steps in a run or specific job -run view repo R v repos Select another repository using the [HOST/]OWNER/REPO format -run view template t v Format JSON output using a Go template; see "gh help formatting" -run view verbose v b Show job steps -run view web w b Open run in the browser -run watch compact b Show only relevant/failed steps -run watch exit-status b Exit with non-zero status if run fails -run watch interval i i Refresh interval in seconds (default 3) -run watch repo R v repos Select another repository using the [HOST/]OWNER/REPO format -search code extension v Filter on file extension -search code filename v Filter on filename -search code jq q v Filter JSON output using a jq expression -search code json v json-fields Output JSON with the specified fields -search code language v Filter results by language -search code limit L i Maximum number of code results to fetch (default 30) -search code match v =file|path Restrict search to file contents or file path: {file|path} -search code owner v owners Filter on owner -search code repo R v repos Filter on repository, in OWNER/REPO format -search code size v Filter on size range, in kilobytes -search code template t v Format JSON output using a Go template; see "gh help formatting" -search code web w b Open the search query in the web browser -search commits author v users Filter by author -search commits author-date v Filter based on authored date -search commits author-email v Filter on author email -search commits author-name v Filter on author name -search commits committer v Filter by committer -search commits committer-date v Filter based on committed date -search commits committer-email v Filter on committer email -search commits committer-name v Filter on committer name -search commits hash v Filter by commit hash -search commits jq q v Filter JSON output using a jq expression -search commits json v json-fields Output JSON with the specified fields -search commits limit L i Maximum number of commits to fetch (default 30) -search commits merge b Filter on merge commits -search commits order v =asc|desc Order of commits returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc") -search commits owner v owners Filter on repository owner -search commits parent v issues Filter by parent hash -search commits repo R v repos Filter on repository, in OWNER/REPO format -search commits sort v =author-date|committer-date Sort fetched commits: {author-date|committer-date} (default "best-match") -search commits template t v Format JSON output using a Go template; see "gh help formatting" -search commits tree v Filter by tree hash -search commits visibility v =public|private|internal Filter based on repository visibility: {public|private|internal} -search commits web w b Open the search query in the web browser -search issues app v Filter by GitHub App author -search issues archived b Filter based on the repository archived state {true|false} -search issues assignee v users Filter by assignee -search issues author v users Filter by author (use --app to filter by a GitHub App) -search issues closed v Filter on closed at date -search issues commenter v me Filter based on comments by user -search issues comments v Filter on number of comments -search issues created v Filter based on created at date -search issues include-prs b Include pull requests in results -search issues interactions v Filter on number of reactions and comments -search issues involves v me Filter based on involvement of user -search issues jq q v Filter JSON output using a jq expression -search issues json v json-fields Output JSON with the specified fields -search issues label v labels Filter on label -search issues language v Filter based on the coding language -search issues limit L i Maximum number of results to fetch (default 30) -search issues locked b Filter on locked conversation status -search issues match v =title|body|comments Restrict search to specific field of issue: {title|body|comments} -search issues mentions v me Filter based on user mentions -search issues milestone v milestones Filter by milestone title -search issues no-assignee b Filter on missing assignee -search issues no-label b Filter on missing label -search issues no-milestone b Filter on missing milestone -search issues no-project b Filter on missing project -search issues order v =asc|desc Order of results returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc") -search issues owner v owners Filter on repository owner -search issues project v Filter on project board owner/number -search issues reactions v Filter on number of reactions -search issues repo R v repos Filter on repository, in OWNER/REPO format -search issues search-type v =lexical|semantic|hybrid Type of issue search to perform: {lexical|semantic|hybrid} (default "lexical") -search issues sort v =comments|created|interactions|reactions|reactions-+1|reactions--1|reactions-heart|reactions-smile|reactions-tada|reactions-thinking_face|updated Sort fetched results: {comments|created|interactions|reactions|reactions-+1|reactions--1|reactions-heart|reactions-smile|reactions-tada|reactions-thinking_face|updated} (default "best-match") -search issues state v =open|closed Filter based on state: {open|closed} -search issues team-mentions v Filter based on team mentions -search issues template t v Format JSON output using a Go template; see "gh help formatting" -search issues updated v Filter on last updated at date -search issues visibility v =public|private|internal Filter based on repository visibility: {public|private|internal} -search issues web w b Open the search query in the web browser -search prs app v Filter by GitHub App author -search prs archived b Filter based on the repository archived state {true|false} -search prs assignee v users Filter by assignee -search prs author v users Filter by author (use --app to filter by a GitHub App) -search prs base B v Filter on base branch name -search prs checks v =pending|success|failure Filter based on status of the checks: {pending|success|failure} -search prs closed v Filter on closed at date -search prs commenter v me Filter based on comments by user -search prs comments v Filter on number of comments -search prs created v Filter based on created at date -search prs draft b Filter based on draft state -search prs head H v Filter on head branch name -search prs interactions v Filter on number of reactions and comments -search prs involves v me Filter based on involvement of user -search prs jq q v Filter JSON output using a jq expression -search prs json v json-fields Output JSON with the specified fields -search prs label v labels Filter on label -search prs language v Filter based on the coding language -search prs limit L i Maximum number of results to fetch (default 30) -search prs locked b Filter on locked conversation status -search prs match v =title|body|comments Restrict search to specific field of issue: {title|body|comments} -search prs mentions v me Filter based on user mentions -search prs merged b Filter based on merged state -search prs merged-at v Filter on merged at date -search prs milestone v milestones Filter by milestone title -search prs no-assignee b Filter on missing assignee -search prs no-label b Filter on missing label -search prs no-milestone b Filter on missing milestone -search prs no-project b Filter on missing project -search prs order v =asc|desc Order of results returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc") -search prs owner v owners Filter on repository owner -search prs project v Filter on project board owner/number -search prs reactions v Filter on number of reactions -search prs repo R v repos Filter on repository, in OWNER/REPO format -search prs review v =none|required|approved|changes_requested Filter based on review status: {none|required|approved|changes_requested} -search prs review-requested v me Filter on user or team requested to review -search prs reviewed-by v me Filter on user who reviewed -search prs sort v =comments|reactions|reactions-+1|reactions--1|reactions-smile|reactions-thinking_face|reactions-heart|reactions-tada|interactions|created|updated Sort fetched results: {comments|reactions|reactions-+1|reactions--1|reactions-smile|reactions-thinking_face|reactions-heart|reactions-tada|interactions|created|updated} (default "best-match") -search prs state v =open|closed Filter based on state: {open|closed} -search prs team-mentions v Filter based on team mentions -search prs template t v Format JSON output using a Go template; see "gh help formatting" -search prs updated v Filter on last updated at date -search prs visibility v =public|private|internal Filter based on repository visibility: {public|private|internal} -search prs web w b Open the search query in the web browser -search repos archived b Filter based on the repository archived state {true|false} -search repos created v Filter based on created at date -search repos followers v Filter based on number of followers -search repos forks v Filter on number of forks -search repos good-first-issues v Filter on number of issues with the 'good first issue' label -search repos help-wanted-issues v Filter on number of issues with the 'help wanted' label -search repos include-forks v =false|true|only Include forks in fetched repositories: {false|true|only} -search repos jq q v Filter JSON output using a jq expression -search repos json v json-fields Output JSON with the specified fields -search repos language v Filter based on the coding language -search repos license v licenses Filter based on license type -search repos limit L i Maximum number of repositories to fetch (default 30) -search repos match v =name|description|readme Restrict search to specific field of repository: {name|description|readme} -search repos number-topics v Filter on number of topics -search repos order v =asc|desc Order of repositories returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc") -search repos owner v owners Filter on owner -search repos size v Filter on a size range, in kilobytes -search repos sort v =forks|help-wanted-issues|stars|updated Sort fetched repositories: {forks|help-wanted-issues|stars|updated} (default "best-match") -search repos stars v Filter on number of stars -search repos template t v Format JSON output using a Go template; see "gh help formatting" -search repos topic v Filter on topic -search repos updated v Filter on last updated at date -search repos visibility v =public|private|internal Filter based on visibility: {public|private|internal} -search repos web w b Open the search query in the web browser -secret repo R v repos Select another repository using the [HOST/]OWNER/REPO format -secret delete app a v =actions|agents|codespaces|dependabot Delete a secret for a specific application: {actions|agents|codespaces|dependabot} -secret delete env e v environments Delete a secret for an environment -secret delete org o v orgs Delete a secret for an organization -secret delete repo R v repos Select another repository using the [HOST/]OWNER/REPO format -secret delete user u b Delete a secret for your user -secret list app a v =actions|agents|codespaces|dependabot List secrets for a specific application: {actions|agents|codespaces|dependabot} -secret list env e v environments List secrets for an environment -secret list jq q v Filter JSON output using a jq expression -secret list json v json-fields Output JSON with the specified fields -secret list org o v orgs List secrets for an organization -secret list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -secret list template t v Format JSON output using a Go template; see "gh help formatting" -secret list user u b List a secret for your user -secret set app a v =actions|agents|codespaces|dependabot Set the application for a secret: {actions|agents|codespaces|dependabot} -secret set body b v The value for the secret (reads from standard input if not specified) -secret set env e v environments Set deployment environment secret -secret set env-file f f Load secret names and values from a dotenv-formatted file -secret set no-repos-selected b No repositories can access the organization secret -secret set no-store b Print the encrypted, base64-encoded value instead of storing it on GitHub -secret set org o v orgs Set organization secret -secret set repo R v repos Select another repository using the [HOST/]OWNER/REPO format -secret set repos r v repos List of repositories that can access an organization or user secret -secret set user u b Set a secret for your user -secret set visibility v v =all|private|selected Set visibility for an organization secret: {all|private|selected} (default "private") -skill install agent v Target agent (see supported values above) -skill install all b Install all skills without prompting for skill selection -skill install allow-hidden-dirs b Include skills in hidden directories (e.g. .claude/skills/, .agents/skills/) -skill install dir v Install to a custom directory (overrides --agent and --scope) -skill install force f b Overwrite existing skills without prompting -skill install from-local b Treat the argument as a local directory path instead of a repository -skill install pin v Pin to a specific git tag or commit SHA -skill install scope v =project|user Installation scope: {project|user} (default "project") -skill install upstream b Install from the upstream source when a re-published skill is detected -skill list agent v =github-copilot|claude-code|cursor|codex|gemini-cli|antigravity|antigravity-cli|antigravity2.0|adal|amp|augment|bob|cline|codebuddy|command-code|continue|cortex|crush|deepagents|devin|droid|firebender|goose|grok|iflow-cli|junie|kilo|kimi-cli|kiro-cli|kode|mcpjam|mistral-vibe|mux|neovate|openclaw|opencode|openhands|pi|pochi|qoder|qwen-code|replit|roo|trae|trae-cn|universal|warp|zencoder Filter by target agent: {github-copilot|claude-code|cursor|codex|gemini-cli|antigravity|antigravity-cli|antigravity2.0|adal|amp|augment|bob|cline|codebuddy|command-code|continue|cortex|crush|deepagents|devin|droid|firebender|goose|grok|iflow-cli|junie|kilo|kimi-cli|kiro-cli|kode|mcpjam|mistral-vibe|mux|neovate|openclaw|opencode|openhands|pi|pochi|qoder|qwen-code|replit|roo|trae|trae-cn|universal|warp|zencoder} -skill list dir v Scan a custom directory for installed skills -skill list jq q v Filter JSON output using a jq expression -skill list json v json-fields Output JSON with the specified fields -skill list scope v =project|user Filter by installation scope: {project|user} -skill list template t v Format JSON output using a Go template; see "gh help formatting" -skill preview allow-hidden-dirs b Include skills in hidden directories (e.g. .claude/skills/, .agents/skills/) -skill publish dry-run b Validate without publishing -skill publish fix b Auto-fix issues where possible without publishing (e.g. strip install metadata) -skill publish tag v Version tag for the release (e.g. v1.0.0) -skill search jq q v Filter JSON output using a jq expression -skill search json v json-fields Output JSON with the specified fields -skill search limit L i Maximum number of results per page (default 15) -skill search owner v owners Filter results to a specific GitHub user or organization -skill search page i Page number of results to fetch (default 1) -skill search template t v Format JSON output using a Go template; see "gh help formatting" -skill update all b Update all skills without prompting -skill update dir v Scan a custom directory for installed skills -skill update dry-run b Report available updates without modifying files -skill update force b Re-download even if already up to date -skill update unpin b Clear pinned version and include pinned skills in update -ssh-key add title t v Title for the new key -ssh-key add type v =authentication|signing Type of the ssh key: {authentication|signing} (default "authentication") -ssh-key delete yes y b Skip the confirmation prompt -status exclude e v repos Comma separated list of repos to exclude in owner/name format -status org o v orgs Report status within an organization -variable repo R v repos Select another repository using the [HOST/]OWNER/REPO format -variable delete env e v environments Delete a variable for an environment -variable delete org o v orgs Delete a variable for an organization -variable delete repo R v repos Select another repository using the [HOST/]OWNER/REPO format -variable get env e v environments Get a variable for an environment -variable get jq q v Filter JSON output using a jq expression -variable get json v json-fields Output JSON with the specified fields -variable get org o v orgs Get a variable for an organization -variable get repo R v repos Select another repository using the [HOST/]OWNER/REPO format -variable get template t v Format JSON output using a Go template; see "gh help formatting" -variable list env e v environments List variables for an environment -variable list jq q v Filter JSON output using a jq expression -variable list json v json-fields Output JSON with the specified fields -variable list org o v orgs List variables for an organization -variable list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -variable list template t v Format JSON output using a Go template; see "gh help formatting" -variable set body b v The value for the variable (reads from standard input if not specified) -variable set env e v environments Set deployment environment variable -variable set env-file f f Load variable names and values from a dotenv-formatted file -variable set org o v orgs Set organization variable -variable set repo R v repos Select another repository using the [HOST/]OWNER/REPO format -variable set repos r v repos List of repositories that can access an organization variable -variable set visibility v v =all|private|selected Set visibility for an organization variable: {all|private|selected} (default "private") -workflow repo R v repos Select another repository using the [HOST/]OWNER/REPO format -workflow disable repo R v repos Select another repository using the [HOST/]OWNER/REPO format -workflow enable repo R v repos Select another repository using the [HOST/]OWNER/REPO format -workflow list all a b Include disabled workflows -workflow list jq q v Filter JSON output using a jq expression -workflow list json v json-fields Output JSON with the specified fields -workflow list limit L i Maximum number of workflows to fetch (default 50) -workflow list repo R v repos Select another repository using the [HOST/]OWNER/REPO format -workflow list template t v Format JSON output using a Go template; see "gh help formatting" -workflow run field F v Add a string parameter in key=value format, respecting @ syntax (see "gh help api"). -workflow run json b Read workflow inputs as JSON via STDIN -workflow run raw-field f v Add a string parameter in key=value format -workflow run ref r v branches Branch or tag name which contains the version of the workflow file you'd like to run -workflow run repo R v repos Select another repository using the [HOST/]OWNER/REPO format -workflow view ref r v The branch or tag name which contains the version of the workflow file you'd like to view -workflow view repo R v repos Select another repository using the [HOST/]OWNER/REPO format -workflow view web w b Open workflow in the browser -workflow view yaml y b View the workflow yaml file -'# - -# Command aliases gh accepts (`pr co`), and the command each stands for. -const GH_ALIASES = r#' -agent-tasks agent-task -agent agent-task -agents agent-task -alias ls alias list -at attestation -cache ls cache list -cs codespace -codespace ls codespace list -cs ls codespace list -config ls config list -discussion ls discussion list -extensions extension -ext extension -ext ls extension list -extension ls extension list -extensions ls extension list -ext uninstall extension remove -extension uninstall extension remove -extensions uninstall extension remove -gist new gist create -gist ls gist list -gpg-key ls gpg-key list -issue artifact new issue artifact create -issue artifact ls issue artifact list -issue new issue create -issue ls issue list -label ls label list -org ls org list -pr co pr checkout -pr new pr create -pr ls pr list -project ls project list -release new release create -release ls release list -repo autolink new repo autolink create -repo autolink ls repo autolink list -repo new repo create -repo deploy-key ls repo deploy-key list -repo gitignore ls repo gitignore list -repo license ls repo license list -repo ls repo list -rs ruleset -rs ls ruleset list -ruleset ls ruleset list -run ls run list -secret remove secret delete -secret ls secret list -skills skill -skill add skill install -skills add skill install -skill ls skill list -skills ls skill list -skill show skill preview -skills show skill preview -ssh-key ls ssh-key list -variable remove variable delete -variable ls variable list -workflow ls workflow list -'# - -const GH_HELP_TOPICS = [ - [value description]; - [accessibility "Learn about GitHub CLI's accessibility experiences"] - [actions "Learn about working with GitHub Actions"] - [environment "Environment variables that can be used with gh"] - [exit-codes "Exit codes used by gh"] - [formatting "Formatting options for JSON data exported from gh"] - [mintty "Information about using gh with MinTTY"] - [reference "A comprehensive reference of all gh commands"] - [telemetry "Information about telemetry in gh"] +# Declarative completions for the GitHub CLI (gh). +# +# Each `export complete` declaration describes one route of `gh` once: its options, positionals and +# the rules between them (`where`). The live providers below are all `@non-destructive`, read only, +# wrapped in `try`/`catch`, and ask `gh ... --json` with a limit for open pull requests, issues, +# runs, workflows, releases, repositories, gists and labels. User-facing `export def` commands such +# as `gh my stars` stay at the end of the file. + +# --- Providers ---------------------------------------------------------------------------- +# +# Every provider is `@non-destructive`: it only reads (gh's config and data directories, git, +# or a read-only `gh api` GET without `--cache`), and returns [] when gh is missing, the +# directory is not a repository, the user is signed out or the network is down. A provider +# that takes `repo` gets the value of `--repo`/`-R` on the line and passes it as `GH_REPO`. + +# A comma-separated list (`--label bug,docs`, `--json number,title`): each item completes on its own. +export syntax gh.list over chars { + root = item ("," item)* + item = name: until "," +} + +const GH_SUBCOMMANDS = {"agent-task": [{"value": "create", "description": "Create an agent task (preview)"}, {"value": "list", "description": "List agent tasks (preview)"}, {"value": "view", "description": "View an agent task session (preview)"}], "alias": [{"value": "delete", "description": "Delete set aliases"}, {"value": "import", "description": "Import aliases from a YAML file"}, {"value": "list", "description": "List your aliases"}, {"value": "set", "description": "Create a shortcut for a gh command"}], "attestation": [{"value": "download", "description": "Download an artifact's attestations for offline use"}, {"value": "trusted-root", "description": "Output trusted_root.jsonl contents, likely for offline verification"}, {"value": "verify", "description": "Verify an artifact's integrity using attestations"}], "auth": [{"value": "login", "description": "Log in to a GitHub account"}, {"value": "logout", "description": "Log out of a GitHub account"}, {"value": "refresh", "description": "Refresh stored authentication credentials"}, {"value": "setup-git", "description": "Setup git with GitHub CLI"}, {"value": "status", "description": "Display active account and authentication state on each known GitHub host"}, {"value": "switch", "description": "Switch active GitHub account"}, {"value": "token", "description": "Print the authentication token gh uses for a hostname and account"}], "cache": [{"value": "delete", "description": "Delete GitHub Actions caches"}, {"value": "list", "description": "List GitHub Actions caches"}], "codespace": [{"value": "code", "description": "Open a codespace in Visual Studio Code"}, {"value": "cp", "description": "Copy files between local and remote file systems"}, {"value": "create", "description": "Create a codespace"}, {"value": "delete", "description": "Delete codespaces"}, {"value": "edit", "description": "Edit a codespace"}, {"value": "jupyter", "description": "Open a codespace in JupyterLab"}, {"value": "list", "description": "List codespaces"}, {"value": "logs", "description": "Access codespace logs"}, {"value": "ports", "description": "List ports in a codespace"}, {"value": "rebuild", "description": "Rebuild a codespace"}, {"value": "ssh", "description": "SSH into a codespace"}, {"value": "stop", "description": "Stop a running codespace"}, {"value": "view", "description": "View details about a codespace"}], "config": [{"value": "clear-cache", "description": "Clear the cli cache"}, {"value": "get", "description": "Print the value of a given configuration key"}, {"value": "list", "description": "Print a list of configuration keys and values"}, {"value": "set", "description": "Update configuration with a value for the given key"}], "discussion": [{"value": "comment", "description": "Add, edit, or delete a comment or a reply on a discussion (preview)"}, {"value": "create", "description": "Create a new discussion (preview)"}, {"value": "edit", "description": "Edit a discussion (preview)"}, {"value": "list", "description": "List discussions in a repository (preview)"}, {"value": "view", "description": "View a discussion (preview)"}], "extension": [{"value": "browse", "description": "Enter a UI for browsing, adding, and removing extensions"}, {"value": "create", "description": "Create a new extension"}, {"value": "exec", "description": "Execute an installed extension"}, {"value": "install", "description": "Install a gh extension from a repository"}, {"value": "list", "description": "List installed extension commands"}, {"value": "remove", "description": "Remove an installed extension"}, {"value": "search", "description": "Search extensions to the GitHub CLI"}, {"value": "upgrade", "description": "Upgrade installed extensions"}], "gist": [{"value": "clone", "description": "Clone a gist locally"}, {"value": "create", "description": "Create a new gist"}, {"value": "delete", "description": "Delete a gist"}, {"value": "edit", "description": "Edit one of your gists"}, {"value": "list", "description": "List your gists"}, {"value": "rename", "description": "Rename a file in a gist"}, {"value": "view", "description": "View a gist"}], "gpg-key": [{"value": "add", "description": "Add a GPG key to your GitHub account"}, {"value": "delete", "description": "Delete a GPG key from your GitHub account"}, {"value": "list", "description": "Lists GPG keys in your GitHub account"}], "issue": [{"value": "artifact", "description": "Work with issue artifacts (preview)"}, {"value": "close", "description": "Close issue"}, {"value": "comment", "description": "Add a comment to an issue"}, {"value": "create", "description": "Create a new issue"}, {"value": "delete", "description": "Delete issue"}, {"value": "develop", "description": "Manage linked branches for an issue"}, {"value": "edit", "description": "Edit issues"}, {"value": "list", "description": "List issues in a repository"}, {"value": "lock", "description": "Lock issue conversation"}, {"value": "pin", "description": "Pin an issue"}, {"value": "reopen", "description": "Reopen issue"}, {"value": "status", "description": "Show status of relevant issues"}, {"value": "transfer", "description": "Transfer issue to another repository"}, {"value": "unlock", "description": "Unlock issue conversation"}, {"value": "unpin", "description": "Unpin an issue"}, {"value": "view", "description": "View an issue"}], "label": [{"value": "clone", "description": "Clones labels from one repository to another"}, {"value": "create", "description": "Create a new label"}, {"value": "delete", "description": "Delete a label from a repository"}, {"value": "edit", "description": "Edit a label"}, {"value": "list", "description": "List labels in a repository"}], "org": [{"value": "list", "description": "List organizations for the authenticated user."}], "pr": [{"value": "checkout", "description": "Check out a pull request in git"}, {"value": "checks", "description": "Show CI status for a single pull request"}, {"value": "close", "description": "Close a pull request"}, {"value": "comment", "description": "Add a comment to a pull request"}, {"value": "create", "description": "Create a pull request"}, {"value": "diff", "description": "View changes in a pull request"}, {"value": "edit", "description": "Edit a pull request"}, {"value": "list", "description": "List pull requests in a repository"}, {"value": "lock", "description": "Lock pull request conversation"}, {"value": "merge", "description": "Merge a pull request"}, {"value": "ready", "description": "Mark a pull request as ready for review"}, {"value": "reopen", "description": "Reopen a pull request"}, {"value": "revert", "description": "Revert a pull request"}, {"value": "review", "description": "Add a review to a pull request"}, {"value": "status", "description": "Show status of relevant pull requests"}, {"value": "unlock", "description": "Unlock pull request conversation"}, {"value": "update-branch", "description": "Update a pull request branch"}, {"value": "view", "description": "View a pull request"}], "preview": [{"value": "prompter", "description": "Execute a test program to preview the prompter"}], "project": [{"value": "close", "description": "Close a project"}, {"value": "copy", "description": "Copy a project"}, {"value": "create", "description": "Create a project"}, {"value": "delete", "description": "Delete a project"}, {"value": "edit", "description": "Edit a project"}, {"value": "field-create", "description": "Create a field in a project"}, {"value": "field-delete", "description": "Delete a field in a project"}, {"value": "field-list", "description": "List the fields in a project"}, {"value": "item-add", "description": "Add a pull request or an issue to a project"}, {"value": "item-archive", "description": "Archive an item in a project"}, {"value": "item-create", "description": "Create a draft issue item in a project"}, {"value": "item-delete", "description": "Delete an item from a project by ID"}, {"value": "item-edit", "description": "Edit an item in a project"}, {"value": "item-list", "description": "List the items in a project"}, {"value": "link", "description": "Link a project to a repository or a team"}, {"value": "list", "description": "List the projects for an owner"}, {"value": "mark-template", "description": "Mark a project as a template"}, {"value": "unlink", "description": "Unlink a project from a repository or a team"}, {"value": "view", "description": "View a project"}], "release": [{"value": "create", "description": "Create a new release"}, {"value": "delete", "description": "Delete a release"}, {"value": "delete-asset", "description": "Delete an asset from a release"}, {"value": "download", "description": "Download release assets"}, {"value": "edit", "description": "Edit a release"}, {"value": "list", "description": "List releases in a repository"}, {"value": "upload", "description": "Upload assets to a release"}, {"value": "verify", "description": "Verify the attestation for a release"}, {"value": "verify-asset", "description": "Verify that a given asset originated from a release"}, {"value": "view", "description": "View information about a release"}], "repo": [{"value": "archive", "description": "Archive a repository"}, {"value": "autolink", "description": "Manage autolink references"}, {"value": "clone", "description": "Clone a repository locally"}, {"value": "create", "description": "Create a new repository"}, {"value": "delete", "description": "Delete a repository"}, {"value": "deploy-key", "description": "Manage deploy keys in a repository"}, {"value": "edit", "description": "Edit repository settings"}, {"value": "fork", "description": "Create a fork of a repository"}, {"value": "gitignore", "description": "List and view available repository gitignore templates"}, {"value": "license", "description": "Explore repository licenses"}, {"value": "list", "description": "List repositories owned by user or organization"}, {"value": "read-dir", "description": "List a directory in a repository (preview)"}, {"value": "read-file", "description": "Read a file from a repository (preview)"}, {"value": "rename", "description": "Rename a repository"}, {"value": "set-default", "description": "Configure default repository for this directory"}, {"value": "sync", "description": "Sync a repository"}, {"value": "unarchive", "description": "Unarchive a repository"}, {"value": "view", "description": "View a repository"}], "ruleset": [{"value": "check", "description": "View rules that would apply to a given branch"}, {"value": "list", "description": "List rulesets for a repository or organization"}, {"value": "view", "description": "View information about a ruleset"}], "run": [{"value": "cancel", "description": "Cancel a workflow run"}, {"value": "delete", "description": "Delete a workflow run"}, {"value": "download", "description": "Download artifacts generated by a workflow run"}, {"value": "list", "description": "List recent workflow runs"}, {"value": "rerun", "description": "Rerun a run"}, {"value": "view", "description": "View a summary of a workflow run"}, {"value": "watch", "description": "Watch a run until it completes, showing its progress"}], "search": [{"value": "code", "description": "Search within code"}, {"value": "commits", "description": "Search for commits"}, {"value": "issues", "description": "Search for issues"}, {"value": "prs", "description": "Search for pull requests"}, {"value": "repos", "description": "Search for repositories"}], "secret": [{"value": "delete", "description": "Delete secrets"}, {"value": "list", "description": "List secrets"}, {"value": "set", "description": "Create or update secrets"}], "skill": [{"value": "install", "description": "Install agent skills from a GitHub repository (preview)"}, {"value": "list", "description": "List installed skills (preview)"}, {"value": "preview", "description": "Preview a skill from a GitHub repository (preview)"}, {"value": "publish", "description": "Validate and publish skills to a GitHub repository (preview)"}, {"value": "search", "description": "Search for skills across GitHub (preview)"}, {"value": "update", "description": "Update installed skills to their latest versions (preview)"}], "ssh-key": [{"value": "add", "description": "Add an SSH key to your GitHub account"}, {"value": "delete", "description": "Delete an SSH key from your GitHub account"}, {"value": "list", "description": "Lists SSH keys in your GitHub account"}], "variable": [{"value": "delete", "description": "Delete variables"}, {"value": "get", "description": "Get variables"}, {"value": "list", "description": "List variables"}, {"value": "set", "description": "Create or update variables"}], "workflow": [{"value": "disable", "description": "Disable a workflow"}, {"value": "enable", "description": "Enable a workflow"}, {"value": "list", "description": "List workflows"}, {"value": "run", "description": "Run a workflow by creating a workflow_dispatch event"}, {"value": "view", "description": "View the summary of a workflow"}]} + +const GH_FIRST_POSITIONAL = {"agent-task": "", "agent-task create": "", "agent-task list": "", "agent-task view": "pr", "alias": "", "alias delete": "alias", "alias import": "file", "alias list": "", "alias set": "", "api": "api-endpoint", "attestation": "", "attestation download": "file", "attestation trusted-root": "", "attestation verify": "file", "auth": "", "auth login": "", "auth logout": "", "auth refresh": "", "auth setup-git": "", "auth status": "", "auth switch": "", "auth token": "", "browse": "file", "cache": "", "cache delete": "cache", "cache list": "", "codespace": "", "codespace code": "", "codespace cp": "file", "codespace create": "", "codespace delete": "", "codespace edit": "", "codespace jupyter": "", "codespace list": "", "codespace logs": "", "codespace ports": "", "codespace ports forward": "", "codespace ports visibility": "", "codespace rebuild": "", "codespace ssh": "", "codespace stop": "", "codespace view": "", "completion": "", "config": "", "config clear-cache": "", "config get": "config-key", "config list": "", "config set": "config-key", "copilot": "", "discussion": "", "discussion comment": "discussion", "discussion create": "", "discussion edit": "discussion", "discussion list": "", "discussion view": "discussion", "extension": "", "extension browse": "", "extension create": "", "extension exec": "extension", "extension install": "", "extension list": "", "extension remove": "extension", "extension search": "", "extension upgrade": "extension", "gist": "", "gist clone": "gist", "gist create": "file", "gist delete": "gist", "gist edit": "gist", "gist list": "", "gist rename": "gist", "gist view": "gist", "gpg-key": "", "gpg-key add": "file", "gpg-key delete": "gpg-key", "gpg-key list": "", "issue": "", "issue artifact": "", "issue artifact create": "issue", "issue artifact delete": "issue", "issue artifact download": "issue", "issue artifact edit": "issue", "issue artifact list": "issue", "issue artifact view": "issue", "issue close": "issue", "issue comment": "issue", "issue create": "", "issue delete": "issue", "issue develop": "issue", "issue edit": "issue", "issue list": "", "issue lock": "issue", "issue pin": "issue", "issue reopen": "issue-closed", "issue status": "", "issue transfer": "issue", "issue unlock": "issue", "issue unpin": "issue", "issue view": "issue", "label": "", "label clone": "repo", "label create": "", "label delete": "label", "label edit": "label", "label list": "", "licenses": "", "org": "", "org list": "", "pr": "", "pr checkout": "pr", "pr checks": "pr", "pr close": "pr", "pr comment": "pr", "pr create": "", "pr diff": "pr", "pr edit": "pr", "pr list": "", "pr lock": "pr", "pr merge": "pr", "pr ready": "pr", "pr reopen": "pr-closed", "pr revert": "pr-merged", "pr review": "pr", "pr status": "", "pr unlock": "pr", "pr update-branch": "pr", "pr view": "pr", "preview": "", "preview prompter": "prompt-type", "project": "", "project close": "project", "project copy": "project", "project create": "", "project delete": "project", "project edit": "project", "project field-create": "project", "project field-delete": "", "project field-list": "project", "project item-add": "project", "project item-archive": "project", "project item-create": "project", "project item-delete": "project", "project item-edit": "project", "project item-list": "project", "project link": "project", "project list": "", "project mark-template": "project", "project unlink": "project", "project view": "project", "release": "", "release create": "none", "release delete": "release", "release delete-asset": "release", "release download": "release", "release edit": "release", "release list": "", "release upload": "release", "release verify": "release", "release verify-asset": "release", "release view": "release", "repo": "", "repo archive": "repo", "repo autolink": "", "repo autolink create": "", "repo autolink delete": "autolink", "repo autolink list": "", "repo autolink view": "autolink", "repo clone": "repo", "repo create": "", "repo delete": "repo", "repo deploy-key": "", "repo deploy-key add": "file", "repo deploy-key delete": "deploy-key", "repo deploy-key list": "", "repo edit": "repo", "repo fork": "repo", "repo gitignore": "", "repo gitignore list": "", "repo gitignore view": "gitignore", "repo license": "", "repo license list": "", "repo license view": "license", "repo list": "owner", "repo read-dir": "", "repo read-file": "", "repo rename": "", "repo set-default": "repo", "repo sync": "repo", "repo unarchive": "repo", "repo view": "repo", "ruleset": "", "ruleset check": "branch", "ruleset list": "", "ruleset view": "ruleset", "run": "", "run cancel": "run", "run delete": "run", "run download": "run", "run list": "", "run rerun": "run", "run view": "run", "run watch": "run", "search": "", "search code": "", "search commits": "", "search issues": "", "search prs": "", "search repos": "", "secret": "", "secret delete": "secret", "secret list": "", "secret set": "secret", "skill": "", "skill install": "", "skill list": "", "skill preview": "", "skill publish": "file", "skill search": "", "skill update": "skill", "ssh-key": "", "ssh-key add": "file", "ssh-key delete": "ssh-key", "ssh-key list": "", "status": "", "variable": "", "variable delete": "variable", "variable get": "variable", "variable list": "", "variable set": "variable", "workflow": "", "workflow disable": "workflow", "workflow enable": "workflow", "workflow list": "", "workflow run": "workflow", "workflow view": "workflow", "help": "help-topic"} + +const GH_COMMAND_ALIASES = {"agent-tasks": "agent-task", "agent": "agent-task", "agents": "agent-task", "alias ls": "alias list", "at": "attestation", "cache ls": "cache list", "cs": "codespace", "codespace ls": "codespace list", "cs ls": "codespace list", "config ls": "config list", "discussion ls": "discussion list", "extensions": "extension", "ext": "extension", "ext ls": "extension list", "extension ls": "extension list", "extensions ls": "extension list", "ext uninstall": "extension remove", "extension uninstall": "extension remove", "extensions uninstall": "extension remove", "gist new": "gist create", "gist ls": "gist list", "gpg-key ls": "gpg-key list", "issue artifact new": "issue artifact create", "issue artifact ls": "issue artifact list", "issue new": "issue create", "issue ls": "issue list", "label ls": "label list", "org ls": "org list", "pr co": "pr checkout", "pr new": "pr create", "pr ls": "pr list", "project ls": "project list", "release new": "release create", "release ls": "release list", "repo autolink new": "repo autolink create", "repo autolink ls": "repo autolink list", "repo new": "repo create", "repo deploy-key ls": "repo deploy-key list", "repo gitignore ls": "repo gitignore list", "repo license ls": "repo license list", "repo ls": "repo list", "rs": "ruleset", "rs ls": "ruleset list", "ruleset ls": "ruleset list", "run ls": "run list", "secret remove": "secret delete", "secret ls": "secret list", "skills": "skill", "skill add": "skill install", "skills add": "skill install", "skill ls": "skill list", "skills ls": "skill list", "skill show": "skill preview", "skills show": "skill preview", "ssh-key ls": "ssh-key list", "variable remove": "variable delete", "variable ls": "variable list", "workflow ls": "workflow list"} + +const GH_QUIET_ENV = {GH_PROMPT_DISABLED: '1', GH_NO_UPDATE_NOTIFIER: '1', NO_COLOR: '1'} + +# Runs a read-only `gh` query and returns its stdout, capturing stderr; a failure is an error. +@non-destructive +def gh-quiet [args: list, repo?: string]: nothing -> string { + let env_vars = $GH_QUIET_ENV | merge (if ($repo | is-empty) { {} } else { {GH_REPO: $repo} }) + let result = with-env $env_vars { '' | ^gh ...$args | complete } + if $result.exit_code != 0 { error make {msg: ($result.stderr | str trim)} } + $result.stdout +} + +# A `gh api` GET reduced by a jq expression; `{owner}`/`{repo}` follow `repo` or the current repository. +@non-destructive +def gh-api [endpoint: string, jq: string, repo?: string]: nothing -> any { + gh-quiet [api $endpoint --jq $jq] $repo | from json +} + +@non-destructive +def gh-git-lines [args: list]: nothing -> list { + let result = try { ^git ...$args | complete } catch { return [] } + if $result.exit_code != 0 { return [] } + $result.stdout | lines +} + +# The directory that holds gh's config.yml and hosts.yml. +@non-destructive +def gh-config-dir []: nothing -> path { + if ($env.GH_CONFIG_DIR? | is-not-empty) { return $env.GH_CONFIG_DIR } + if ($env.XDG_CONFIG_HOME? | is-not-empty) { return ($env.XDG_CONFIG_HOME | path join gh) } + if $nu.os-info.name == 'windows' and ($env.AppData? | is-not-empty) { return ($env.AppData | path join 'GitHub CLI') } + $nu.home-dir | path join .config gh +} + +@non-destructive +def gh-hosts-file []: nothing -> record { + let file = gh-config-dir | path join hosts.yml + if not ($file | path exists) { return {} } + try { open --raw $file | from yaml | default {} } catch { {} } +} + +# User aliases from gh's config.yml (`gh alias set`), as {name: expansion}. +@non-destructive +def gh-user-aliases []: nothing -> record { + let file = gh-config-dir | path join config.yml + if not ($file | path exists) { return {} } + try { open --raw $file | from yaml | get -o aliases | default {} } catch { {} } +} + +# Installed extensions, from gh's data directory (`gh extension list` would cost a gh start). +@non-destructive +def gh-extension-names []: nothing -> list { + let base = if ($env.XDG_DATA_HOME? | is-not-empty) { + $env.XDG_DATA_HOME | path join gh + } else if $nu.os-info.name == 'windows' and ($env.LocalAppData? | is-not-empty) { + $env.LocalAppData | path join 'GitHub CLI' + } else { + $nu.home-dir | path join .local share gh + } + let dir = $base | path join extensions + if not ($dir | path exists) { return [] } + ls $dir | where type in [dir symlink] | get name | path basename | where $it starts-with 'gh-' | str replace 'gh-' '' +} + +# The command a user alias stands for (`co` -> `pr checkout`), following a `gh ` +# inside a `!` shell alias; null for a shell alias that runs no gh command. +@non-destructive +def gh-expand-alias [name: string]: nothing -> any { + let value = gh-user-aliases | get -o $name + if $value == null { return null } + let words = if ($value starts-with '!') { + let parts = $value | str substring 1.. | split row -r '\s+' + let start = $parts | enumerate | where item == gh | get -o 0.index + if $start == null { [] } else { $parts | skip ($start + 1) | take until {|w| $w in [';' '&&' '||' '|'] } } + } else { + $value | split row -r '\s+' | where $it != '' + } + let words = $words | where $it =~ '^[a-z][a-z0-9-]*$' + mut path = [] + for word in $words { + let candidate = $path | append $word | str join ' ' + let canonical = $GH_COMMAND_ALIASES | get -o $candidate | default $candidate + if $canonical not-in $GH_FIRST_POSITIONAL { break } + $path = $canonical | split row ' ' + } + if ($path | is-empty) { null } else { $path | str join ' ' } +} + +# User aliases and installed extensions, beside the commands the routes below declare. +@non-destructive +export def "nu-complete gh" [] { + try { + let aliases = gh-user-aliases | transpose value description | update description {|it| $"Alias for ($it.description)" } + $aliases | append (gh-extension-names | each {|name| {value: $name, description: 'Extension'} }) + } catch { [] } +} + +# The arguments of a user alias: those of the first argument of the command it stands for +# (`gh co ` completes like `gh pr checkout `), and its flags (`gh bugs --st` like +# `gh issue list --st`). Extensions and shell aliases get none. +@non-destructive +export def "nu-complete gh alias-args" [alias?: string, token?: record] { + try { + if $alias == null { return [] } + let path = gh-expand-alias $alias + if $path == null { return [] } + let typed = $token.text? | default '' + if ($typed starts-with '-') { + return ($"gh ($path) ($typed)" | commandline complete --detailed | where {|row| $row.value starts-with $typed } | select value description?) + } + let rows = match ($GH_FIRST_POSITIONAL | get -o $path | default '') { + pr => (nu-complete gh prs) + pr-closed => (nu-complete gh prs-closed) + pr-merged => (nu-complete gh prs-merged) + issue => (nu-complete gh issues) + issue-closed => (nu-complete gh issues-closed) + repo => (nu-complete gh repos) + release => (nu-complete gh releases) + workflow => (nu-complete gh workflows) + run => (nu-complete gh runs) + gist => (nu-complete gh gists) + label => (nu-complete gh labels) + _ => [] + } + let rows = if ($rows | describe | str starts-with 'record') { $rows.completions? | default [] } else { $rows } + $rows | where {|row| ($row.value? | default $row | into string) starts-with $typed } + } catch { [] } +} + +@non-destructive +def gh-prs [state: string, repo?: string]: nothing -> list { + let query = if $state == 'open' { 'open' } else { 'closed' } + let jq = '[.[] | {number, title, branch: .head.ref, author: .user.login, merged: (.merged_at != null)}]' + gh-api $"repos/{owner}/{repo}/pulls?state=($query)&sort=updated&direction=desc&per_page=50" $jq $repo + | where {|pr| $state == 'open' or ($pr.merged == ($state == 'merged')) } + | each {|pr| {value: $"($pr.number)", description: $"($pr.title) [($pr.branch)] by ($pr.author)"} } +} + +# Open pull requests of the repository, most recently updated first. +@non-destructive +export def "nu-complete gh prs" [repo?: string] { try { gh-prs open $repo } catch { [] } } + +# Closed pull requests that were not merged (what `gh pr reopen` accepts). +@non-destructive +export def "nu-complete gh prs-closed" [repo?: string] { try { gh-prs closed $repo } catch { [] } } + +# Merged pull requests (what `gh pr revert` accepts). +@non-destructive +export def "nu-complete gh prs-merged" [repo?: string] { try { gh-prs merged $repo } catch { [] } } + +@non-destructive +def gh-issues [state: string, repo?: string]: nothing -> list { + let jq = '[.[] | select(.pull_request == null) | {number, title, author: .user.login}]' + gh-api $"repos/{owner}/{repo}/issues?state=($state)&sort=updated&direction=desc&per_page=50" $jq $repo + | each {|issue| {value: $"($issue.number)", description: $"($issue.title) by ($issue.author)"} } +} + +# Open issues of the repository. +@non-destructive +export def "nu-complete gh issues" [repo?: string] { try { gh-issues open $repo } catch { [] } } + +# Closed issues of the repository. +@non-destructive +export def "nu-complete gh issues-closed" [repo?: string] { try { gh-issues closed $repo } catch { [] } } + +# The GitHub remotes of the current repository, then the repositories of the signed-in account. +@non-destructive +export def "nu-complete gh repos" [] { + let remotes = gh-git-lines [remote --verbose] + | parse -r '^(?\S+)\s+\S*github\.com[:/](?[^/\s]+/[^/\s]+?)(?:\.git)?/?\s' + | uniq-by repo + | each {|it| {value: $it.repo, description: $"git remote ($it.remote)"} } + let mine = try { + gh-api 'user/repos?per_page=100&sort=pushed' '[.[] | {name: .full_name, description}]' + | each {|repo| {value: $repo.name, description: ($repo.description | default '')} } + } catch { [] } + $remotes | append $mine | uniq-by value +} + +# Local and remote-tracking branches, or the branches of `--repo` on GitHub. +@non-destructive +export def "nu-complete gh branches" [repo?: string] { + if ($repo | is-empty) { + let local = gh-git-lines [for-each-ref '--format=%(refname:lstrip=2)' refs/heads] + let remote = gh-git-lines [for-each-ref '--format=%(refname:lstrip=3)' refs/remotes] | where $it != 'HEAD' + let branches = $local | append $remote | uniq + if ($branches | is-not-empty) { return $branches } + } + try { gh-api 'repos/{owner}/{repo}/branches?per_page=100' '[.[].name]' $repo } catch { [] } +} + +# Branches as the refs `gh cache` filters by. +@non-destructive +export def "nu-complete gh cache-refs" [repo?: string] { + nu-complete gh branches $repo | each {|branch| $"refs/heads/($branch)" } +} + +# The organizations of the signed-in account. +@non-destructive +export def "nu-complete gh orgs" [] { + try { + gh-api 'user/orgs?per_page=100' '[.[] | {login, description}]' + | each {|org| {value: $org.login, description: ($org.description | default 'Organization')} } + } catch { [] } +} + +# `@me` and the organizations of the signed-in account. +@non-destructive +export def "nu-complete gh owners" [] { + [{value: '@me', description: 'The authenticated user'}] | append (nu-complete gh orgs) +} + +# The hosts gh is signed in to. +@non-destructive +export def "nu-complete gh hosts" [] { + try { gh-hosts-file | columns | append github.com | uniq } catch { [github.com] } +} + +# The accounts gh is signed in to, by host. +@non-destructive +export def "nu-complete gh accounts" [] { + try { + gh-hosts-file | items {|host, conf| + $conf.users? | default {} | columns | each {|user| {value: $user, description: $host} } + } | flatten + } catch { [] } +} + +# `@me` and the users that can be assigned in the repository. +@non-destructive +export def "nu-complete gh users" [repo?: string] { + let users = try { gh-api 'repos/{owner}/{repo}/assignees?per_page=100' '[.[].login]' $repo } catch { [] } + ['@me'] | append $users +} + +# The labels of the repository. +@non-destructive +export def "nu-complete gh labels" [repo?: string] { + try { + gh-api 'repos/{owner}/{repo}/labels?per_page=100' '[.[] | {name, description}]' $repo + | each {|label| {value: $label.name, description: ($label.description | default '')} } + } catch { [] } +} + +# The milestones of the repository, by title. +@non-destructive +export def "nu-complete gh milestones" [repo?: string] { + try { + gh-api 'repos/{owner}/{repo}/milestones?state=all&per_page=100' '[.[] | {title, state, due_on}]' $repo + | each {|m| {value: $m.title, description: $"($m.state) ($m.due_on | default '')"} } + } catch { [] } +} + +# The deployment environments of the repository. +@non-destructive +export def "nu-complete gh environments" [repo?: string] { + try { gh-api 'repos/{owner}/{repo}/environments' '[.environments[].name]' $repo } catch { [] } +} + +# The projects of the repository, by title. +@non-destructive +export def "nu-complete gh projects" [repo?: string] { + try { + let query = 'query($owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { projectsV2(first: 50) { nodes { title number } } } }' + gh-quiet [api graphql -F 'owner={owner}' -F 'repo={repo}' -f $"query=($query)" --jq '.data.repository.projectsV2.nodes'] $repo + | from json | each {|p| {value: $p.title, description: $"Project ($p.number)"} } + } catch { [] } +} + +# The projects of `--owner` (or the signed-in user), by number. +@non-destructive +export def "nu-complete gh project-numbers" [owner?: string] { + try { + gh-quiet [project list --owner ($owner | default '@me') --format json --limit 50] | from json + | get projects | each {|project| {value: $"($project.number)", description: $project.title} } + } catch { [] } +} + +# The releases of the repository, by tag. +@non-destructive +export def "nu-complete gh releases" [repo?: string] { + try { + gh-api 'repos/{owner}/{repo}/releases?per_page=50' '[.[] | {tag: .tag_name, name, draft, prerelease}]' $repo + | each {|release| + let kind = if $release.draft { ' (draft)' } else if $release.prerelease { ' (pre-release)' } else { '' } + {value: $release.tag, description: $"($release.name | default '')($kind)"} + } + } catch { [] } +} + +# The assets of the release named by the tag before it. +@non-destructive +export def "nu-complete gh release-assets" [tag?: string] { + try { + if $tag == null { return [] } + gh-api $"repos/{owner}/{repo}/releases/tags/($tag | url encode)" '[.assets[] | {name, size}]' + | each {|asset| {value: $asset.name, description: $"($asset.size | into filesize)"} } + } catch { [] } +} + +# The workflows of the repository, by file name (which `gh workflow` accepts). +@non-destructive +export def "nu-complete gh workflows" [repo?: string] { + try { + gh-api 'repos/{owner}/{repo}/actions/workflows?per_page=100' '[.workflows[] | {name, path, state}]' $repo + | each {|wf| {value: ($wf.path | path basename), description: $"($wf.name) \(($wf.state)\)"} } + } catch { [] } +} + +# The recent workflow runs of the repository. +@non-destructive +export def "nu-complete gh runs" [repo?: string] { + try { + let jq = '[.workflow_runs[] | {id, name, title: .display_title, status, conclusion, branch: .head_branch}]' + gh-api 'repos/{owner}/{repo}/actions/runs?per_page=30' $jq $repo + | each {|run| {value: $"($run.id)", description: $"($run.name): ($run.title) [($run.branch)] ($run.conclusion | default $run.status)"} } + } catch { [] } +} + +# The jobs of the run before it. +@non-destructive +export def "nu-complete gh run-jobs" [run?: string] { + try { + if $run == null { return [] } + gh-api $"repos/{owner}/{repo}/actions/runs/($run)/jobs?per_page=100" '[.jobs[] | {id, name, conclusion, status}]' + | each {|job| {value: $"($job.id)", description: $"($job.name) ($job.conclusion | default $job.status)"} } + } catch { [] } +} + +# The artifacts of the run before it, or of the repository. +@non-destructive +export def "nu-complete gh artifacts" [run?: string] { + try { + let endpoint = if $run == null { 'repos/{owner}/{repo}/actions/artifacts?per_page=100' } else { $"repos/{owner}/{repo}/actions/runs/($run)/artifacts?per_page=100" } + gh-api $endpoint '[.artifacts[].name]' | uniq + } catch { [] } +} + +# The GitHub Actions caches of the repository. +@non-destructive +export def "nu-complete gh caches" [repo?: string] { + try { + gh-api 'repos/{owner}/{repo}/actions/caches?per_page=100' '[.actions_caches[] | {id, key, ref}]' $repo + | each {|cache| {value: $"($cache.id)", description: $"($cache.key) \(($cache.ref)\)"} } + } catch { [] } +} + +# The gists of the signed-in account. +@non-destructive +export def "nu-complete gh gists" [] { + try { + gh-api 'gists?per_page=100' '[.[] | {id, description, files: (.files | keys)}]' + | each {|gist| {value: $gist.id, description: ($gist.description | default ($gist.files | str join ', '))} } + } catch { [] } +} + +# The files of the gist before it. +@non-destructive +export def "nu-complete gh gist-files" [gist?: string] { + try { + if $gist == null { return [] } + gh-api $"gists/($gist | split row / | last)" '[.files[] | {filename, language}]' + | each {|file| {value: $file.filename, description: ($file.language | default 'File')} } + } catch { [] } +} + +# The Actions secrets of the repository. +@non-destructive +export def "nu-complete gh secrets" [repo?: string] { + try { + gh-api 'repos/{owner}/{repo}/actions/secrets?per_page=100' '[.secrets[] | {name, updated_at}]' $repo + | each {|secret| {value: $secret.name, description: $"Updated ($secret.updated_at)"} } + } catch { [] } +} + +# The Actions variables of the repository. +@non-destructive +export def "nu-complete gh variables" [repo?: string] { + try { + gh-api 'repos/{owner}/{repo}/actions/variables?per_page=100' '[.variables[] | {name, value}]' $repo + | each {|var| {value: $var.name, description: $var.value} } + } catch { [] } +} + +# The rulesets of the repository. +@non-destructive +export def "nu-complete gh rulesets" [repo?: string] { + try { + gh-api 'repos/{owner}/{repo}/rulesets?per_page=100' '[.[] | {id, name, enforcement}]' $repo + | each {|rule| {value: $"($rule.id)", description: $"($rule.name) \(($rule.enforcement)\)"} } + } catch { [] } +} + +# The deploy keys of the repository. +@non-destructive +export def "nu-complete gh deploy-keys" [repo?: string] { + try { + gh-api 'repos/{owner}/{repo}/keys?per_page=100' '[.[] | {id, title}]' $repo + | each {|key| {value: $"($key.id)", description: $key.title} } + } catch { [] } +} + +# The autolinks of the repository. +@non-destructive +export def "nu-complete gh autolinks" [repo?: string] { + try { + gh-api 'repos/{owner}/{repo}/autolinks' '[.[] | {id, key_prefix, url_template}]' $repo + | each {|link| {value: $"($link.id)", description: $"($link.key_prefix) -> ($link.url_template)"} } + } catch { [] } +} + +# The recent discussions of the repository. +@non-destructive +export def "nu-complete gh discussions" [repo?: string] { + try { + let query = 'query($owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { discussions(first: 50, orderBy: {field: UPDATED_AT, direction: DESC}) { nodes { number title } } } }' + gh-quiet [api graphql -F 'owner={owner}' -F 'repo={repo}' -f $"query=($query)" --jq '.data.repository.discussions.nodes'] $repo + | from json | each {|d| {value: $"($d.number)", description: $d.title} } + } catch { [] } +} + +# The SSH keys of the signed-in account. +@non-destructive +export def "nu-complete gh ssh-keys" [] { + try { gh-api 'user/keys?per_page=100' '[.[] | {id, title}]' | each {|key| {value: $"($key.id)", description: $key.title} } } catch { [] } +} + +# The GPG keys of the signed-in account. +@non-destructive +export def "nu-complete gh gpg-keys" [] { + try { + gh-api 'user/gpg_keys?per_page=100' '[.[] | {key_id, emails: [.emails[].email]}]' + | each {|key| {value: $key.key_id, description: ($key.emails | str join ', ')} } + } catch { [] } +} + +# The codespaces of the signed-in account. +@non-destructive +export def "nu-complete gh codespaces" [] { + try { + gh-api 'user/codespaces?per_page=100' '[.codespaces[] | {name, display_name, repo: .repository.full_name, state}]' + | each {|cs| {value: $cs.name, description: $"($cs.display_name) ($cs.repo) \(($cs.state)\)"} } + } catch { [] } +} + +# The user aliases of gh. +@non-destructive +export def "nu-complete gh aliases" [] { + try { gh-user-aliases | transpose value description } catch { [] } +} + +# The installed gh extensions. +@non-destructive +export def "nu-complete gh extensions" [] { + try { gh-extension-names | each {|name| {value: $name, description: 'Extension'} } } catch { [] } +} + +# The installed agent skills. +@non-destructive +export def "nu-complete gh skills" [] { + try { + gh-quiet [skill list --json 'skillName,scope'] | from json + | each {|skill| {value: $skill.skillName, description: $"Skill \(($skill.scope)\)"} } | uniq-by value + } catch { [] } +} + +# The gitignore templates that GitHub offers. +@non-destructive +export def "nu-complete gh gitignores" [] { + try { gh-api gitignore/templates '.' } catch { [] } +} + +# The open source licenses that GitHub offers, by key. +@non-destructive +export def "nu-complete gh licenses" [] { + try { gh-api licenses '[.[] | {key, name}]' | each {|lic| {value: $lic.key, description: $lic.name} } } catch { [] } +} + +# The issue templates of the current repository, by name. +@non-destructive +export def "nu-complete gh issue-templates" [] { + try { + let root = gh-git-lines [rev-parse --show-toplevel] | get -o 0 + if $root == null { return [] } + let dir = $root | path join .github ISSUE_TEMPLATE + if not ($dir | path exists) { return [] } + ls $dir | where type == 'file' | get name + | where {|f| ($f | path parse | get extension) in [md yml yaml] and ($f | path basename) != 'config.yml' } + | each {|f| open --raw $f | lines | where $it =~ '^name:' | get -o 0 } + | compact | str replace -r '^name:\s*' '' | str trim -c '"' | str trim -c "'" + } catch { [] } +} + +# The recent commits of the current repository. +@non-destructive +export def "nu-complete gh commits" [] { + gh-git-lines [log -n 50 '--format=%h%x09%s'] | split column "\t" value description +} + +# The topics of the repository before it, or of the current one. +@non-destructive +export def "nu-complete gh repo-topics" [repo?: string] { + try { + let endpoint = if $repo == null { 'repos/{owner}/{repo}/topics' } else { $"repos/($repo)/topics" } + gh-api $endpoint '.names' + } catch { [] } +} + +# The configuration keys that `gh config --help` lists. +@non-destructive +export def "nu-complete gh config-keys" [] { + try { gh-quiet [config --help] | lines | parse -r '^- `(?[^`]+)`: (?.*)$' } catch { [] } +} + +# The values `gh config --help` lists for the key before it. +@non-destructive +export def "nu-complete gh config-values" [key?: string] { + try { + nu-complete gh config-keys | where value == $key | get -o 0.description | default '' + | parse -r '`\{(?[^}]+)\}`' | get -o 0.values | default '' + | split row '|' | str trim | where $it != '' + } catch { [] } +} + +# The subcommands of the command before it, for `gh help`. +@non-destructive +export def "nu-complete gh help-subcommands" [command?: string] { + $GH_SUBCOMMANDS | get -o ($command | default '') | default [] +} + +# The fields a command's `--json` accepts: gh lists them on stderr when `--json` has no value, +# without a network request. +@non-destructive +def gh-json-fields [...path: string]: nothing -> list { + try { + let result = with-env $GH_QUIET_ENV { '' | ^gh ...$path --json | complete } + $result.stderr | lines | skip 1 | str trim | where $it != '' + } catch { [] } +} + +@non-destructive +export def "nu-complete gh json-fields agent-task list" [] { gh-json-fields agent-task list } + +@non-destructive +export def "nu-complete gh json-fields agent-task view" [] { gh-json-fields agent-task view } + +@non-destructive +export def "nu-complete gh json-fields auth status" [] { gh-json-fields auth status } + +@non-destructive +export def "nu-complete gh json-fields cache list" [] { gh-json-fields cache list } + +@non-destructive +export def "nu-complete gh json-fields codespace list" [] { gh-json-fields codespace list } + +@non-destructive +export def "nu-complete gh json-fields codespace ports" [] { gh-json-fields codespace ports } + +@non-destructive +export def "nu-complete gh json-fields codespace view" [] { gh-json-fields codespace view } + +@non-destructive +export def "nu-complete gh json-fields discussion list" [] { gh-json-fields discussion list } + +@non-destructive +export def "nu-complete gh json-fields discussion view" [] { gh-json-fields discussion view } + +@non-destructive +export def "nu-complete gh json-fields extension search" [] { gh-json-fields extension search } + +@non-destructive +export def "nu-complete gh json-fields issue artifact list" [] { gh-json-fields issue artifact list } + +@non-destructive +export def "nu-complete gh json-fields issue artifact view" [] { gh-json-fields issue artifact view } + +@non-destructive +export def "nu-complete gh json-fields issue list" [] { gh-json-fields issue list } + +@non-destructive +export def "nu-complete gh json-fields issue status" [] { gh-json-fields issue status } + +@non-destructive +export def "nu-complete gh json-fields issue view" [] { gh-json-fields issue view } + +@non-destructive +export def "nu-complete gh json-fields label list" [] { gh-json-fields label list } + +@non-destructive +export def "nu-complete gh json-fields pr checks" [] { gh-json-fields pr checks } + +@non-destructive +export def "nu-complete gh json-fields pr list" [] { gh-json-fields pr list } + +@non-destructive +export def "nu-complete gh json-fields pr status" [] { gh-json-fields pr status } + +@non-destructive +export def "nu-complete gh json-fields pr view" [] { gh-json-fields pr view } + +@non-destructive +export def "nu-complete gh json-fields release list" [] { gh-json-fields release list } + +@non-destructive +export def "nu-complete gh json-fields release view" [] { gh-json-fields release view } + +@non-destructive +export def "nu-complete gh json-fields repo autolink list" [] { gh-json-fields repo autolink list } + +@non-destructive +export def "nu-complete gh json-fields repo autolink view" [] { gh-json-fields repo autolink view } + +@non-destructive +export def "nu-complete gh json-fields repo deploy-key list" [] { gh-json-fields repo deploy-key list } + +@non-destructive +export def "nu-complete gh json-fields repo list" [] { gh-json-fields repo list } + +@non-destructive +export def "nu-complete gh json-fields repo read-dir" [] { gh-json-fields repo read-dir } + +@non-destructive +export def "nu-complete gh json-fields repo read-file" [] { gh-json-fields repo read-file } + +@non-destructive +export def "nu-complete gh json-fields repo view" [] { gh-json-fields repo view } + +@non-destructive +export def "nu-complete gh json-fields run list" [] { gh-json-fields run list } + +@non-destructive +export def "nu-complete gh json-fields run view" [] { gh-json-fields run view } + +@non-destructive +export def "nu-complete gh json-fields search code" [] { gh-json-fields search code } + +@non-destructive +export def "nu-complete gh json-fields search commits" [] { gh-json-fields search commits } + +@non-destructive +export def "nu-complete gh json-fields search issues" [] { gh-json-fields search issues } + +@non-destructive +export def "nu-complete gh json-fields search prs" [] { gh-json-fields search prs } + +@non-destructive +export def "nu-complete gh json-fields search repos" [] { gh-json-fields search repos } + +@non-destructive +export def "nu-complete gh json-fields secret list" [] { gh-json-fields secret list } + +@non-destructive +export def "nu-complete gh json-fields skill list" [] { gh-json-fields skill list } + +@non-destructive +export def "nu-complete gh json-fields skill search" [] { gh-json-fields skill search } + +@non-destructive +export def "nu-complete gh json-fields variable get" [] { gh-json-fields variable get } + +@non-destructive +export def "nu-complete gh json-fields variable list" [] { gh-json-fields variable list } + +@non-destructive +export def "nu-complete gh json-fields workflow list" [] { gh-json-fields workflow list } + +# --- Routes ------------------------------------------------------------------------------- + +export complete [gh] [ + command?: by "nu-complete gh" # Command, alias or extension + ...args: by "nu-complete gh alias-args" [alias: command] # Arguments of an alias or extension + --help # Show help for command + --version # Show gh version +] where { + terminal [--help --version] +} + +export complete [gh help] [ + help-topic?: words ["agent-task": "Work with agent tasks (preview)" "alias": "Create command shortcuts" "api": "Make an authenticated GitHub API request" "attestation": "Work with artifact attestations" "auth": "Authenticate gh and git with GitHub" "browse": "Open repositories, issues, pull requests, and more in the browser" "cache": "Manage GitHub Actions caches" "codespace": "Connect to and manage codespaces" "completion": "Generate shell completion scripts" "config": "Manage configuration for gh" "copilot": "Run the GitHub Copilot CLI (preview)" "discussion": "Work with GitHub Discussions (preview)" "extension": "Manage gh extensions" "gist": "Manage gists" "gpg-key": "Manage GPG keys" "issue": "Manage issues" "label": "Manage labels" "licenses": "View third-party license information" "org": "Manage organizations" "pr": "Manage pull requests" "preview": "Execute previews for gh features" "project": "Work with GitHub Projects." "release": "Manage releases" "repo": "Manage repositories" "ruleset": "View info about repo rulesets" "run": "View details about workflow runs" "search": "Search for repositories, issues, and pull requests" "secret": "Manage GitHub secrets" "skill": "Install and manage agent skills (preview)" "ssh-key": "Manage SSH keys" "status": "Print information about relevant issues, pull requests, and notifications across repositories" "variable": "Manage GitHub Actions variables" "workflow": "View details about GitHub Actions workflows" "accessibility": "Learn about GitHub CLI's accessibility experiences" "actions": "Learn about working with GitHub Actions" "environment": "Environment variables that can be used with gh" "exit-codes": "Exit codes used by gh" "formatting": "Formatting options for JSON data exported from gh" "mintty": "Information about using gh with MinTTY" "reference": "A comprehensive reference of all gh commands" "telemetry": "Information about telemetry in gh"] # Command or help topic + help-subcommand?: by "nu-complete gh help-subcommands" [command: help-topic] # Subcommand + --help # Show help for command +] + +# --- gh pr -------------------------------------------------------------------------------- + +export complete [gh pr] [ + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] + +export complete [gh pr list] [ + --app: text # Filter by GitHub App author + --assignee(-a): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by assignee + --author(-A): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by author + --base(-B): by "nu-complete gh branches" [repo: --repo] # Filter by base branch + --draft(-d) # Filter by draft state + --head(-H): by "nu-complete gh branches" [repo: --repo] # Filter by head branch + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields pr list" within gh.list at item.name # Output JSON with the specified fields + --label(-l): by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Filter by label + --limit(-L): text # Maximum number of items to fetch (default 30) + --search(-S): text # Search pull requests with query + --state(-s): words [open closed merged all] # Filter by state + --template(-t): text # Format JSON output using a Go template + --web(-w) # List pull requests in the web browser + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +export complete [gh pr view] [ + pr?: by "nu-complete gh prs" # Number, URL or branch of the pull request + --comments(-c) # View pull request comments + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields pr view" within gh.list at item.name # Output JSON with the specified fields + --template(-t): text # Format JSON output using a Go template + --web(-w) # Open a pull request in the browser + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +export complete [gh pr create] [ + --assignee(-a): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Assign people by their login; "@me" self-assigns + --attach: path # Attach an image or video file + --base(-B): by "nu-complete gh branches" [repo: --repo] # The branch into which you want your code merged + --body(-b): text # Body for the pull request + --body-file(-F): path # Read body text from file ("-" for stdin) + --draft(-d) # Mark pull request as a draft + --dry-run # Print details instead of creating the PR + --editor(-e) # Open the text editor to write the title and body + --fill(-f) # Use commit info for title and body + --fill-first # Use first commit info for title and body + --fill-verbose # Use commits msg+body for description + --head(-H): by "nu-complete gh branches" [repo: --repo] # The branch that contains commits for your pull request + --label(-l): by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Add labels by name + --milestone(-m): by "nu-complete gh milestones" [repo: --repo] # Add the pull request to a milestone by name + --no-maintainer-edit # Disable maintainer's ability to modify pull request + --project(-p): by "nu-complete gh projects" [repo: --repo] within gh.list at item.name # Add the pull request to projects by title + --recover: path # Recover input from a failed run of create + --reviewer(-r): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Request reviews from people or teams by their handle + --template(-T): path # Template file to use as starting body text + --title(-t): text # Title for the pull request + --web(-w) # Open the web browser to create a pull request + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--fill --fill-first --fill-verbose] + excludes --fill --title + excludes --fill --body + at-most-one [--body --body-file] + at-most-one [--draft --web] + at-most-one [--editor --web] + at-most-one [--dry-run --web] + terminal [--help] +} + +export complete [gh pr checkout] [ + pr?: by "nu-complete gh prs" # Number, URL or branch of the pull request + --branch(-b): text # Local branch name to use + --detach # Checkout PR with a detached HEAD + --force(-f) # Reset the existing local branch to the latest state of the pull request + --recurse-submodules # Update all submodules after checkout + --worktree: dir # Check out the pull request into a worktree at the given path + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--branch --detach] + terminal [--help] +} + +export complete [gh pr merge] [ + pr?: by "nu-complete gh prs" # Number, URL or branch of the pull request + --admin # Use administrator privileges to merge a pull request that does not meet requirements + --author-email(-A): text # Email text for merge commit author + --auto # Automatically merge only after necessary requirements are met + --body(-b): text # Body text for the merge commit + --body-file(-F): path # Read body text from file ("-" for stdin) + --delete-branch(-d) # Delete the local and remote branch after merge + --disable-auto # Disable auto-merge for this pull request + --match-head-commit: by "nu-complete gh commits" # Commit SHA that the pull request head must match to allow merge + --merge(-m) # Merge the commits with the base branch + --rebase(-r) # Rebase the commits onto the base branch + --squash(-s) # Squash the commits into one commit and merge it into the base branch + --subject(-t): text # Subject text for the merge commit + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--merge --squash --rebase] + at-most-one [--auto --disable-auto] + at-most-one [--admin --auto --disable-auto] + at-most-one [--body --body-file] + terminal [--help] +} + +export complete [gh pr close] [ + pr: by "nu-complete gh prs" # Number, URL or branch of the pull request + --comment(-c): text # Leave a closing comment + --delete-branch(-d) # Delete the local and remote branch after close + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh pr reopen] [ + pr: by "nu-complete gh prs-closed" [repo: --repo] # Number, URL or branch of the closed pull request + --comment(-c): text # Add a reopening comment + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh pr diff] [ + pr?: by "nu-complete gh prs" # Number, URL or branch of the pull request + --allow-escape-sequences # Allow printing terminal escape sequences + --color: words [always never auto] # Use color in diff output + --exclude(-e): text # Exclude files matching glob patterns from the diff + --name-only # Display only names of changed files + --patch # Display diff in patch format + --web(-w) # Open the pull request diff in the browser + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--name-only --patch --web] + terminal [--help] +} + +export complete [gh pr review] [ + pr?: by "nu-complete gh prs" # Number, URL or branch of the pull request + --approve(-a) # Approve pull request + --body(-b): text # Specify the body of a review + --body-file(-F): path # Read body text from file ("-" for stdin) + --comment(-c) # Comment on a pull request + --request-changes(-r) # Request changes on a pull request + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--approve --request-changes --comment] + at-most-one [--body --body-file] + terminal [--help] +} + +export complete [gh pr edit] [ + pr?: by "nu-complete gh prs" # Number, URL or branch of the pull request + --add-assignee: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Add assigned users by their login + --add-label: by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Add labels by name + --add-project: by "nu-complete gh projects" [repo: --repo] within gh.list at item.name # Add the pull request to projects by title + --add-reviewer: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Add or re-request reviewers by their login + --attach: path # Attach an image or video file + --base(-B): by "nu-complete gh branches" [repo: --repo] # Change the base branch for this pull request + --body(-b): text # Set the new body + --body-file(-F): path # Read body text from file ("-" for stdin) + --milestone(-m): by "nu-complete gh milestones" [repo: --repo] # Edit the milestone the pull request belongs to by name + --remove-assignee: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Remove assigned users by their login + --remove-label: by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Remove labels by name + --remove-milestone # Remove the milestone association from the pull request + --remove-project: by "nu-complete gh projects" [repo: --repo] within gh.list at item.name # Remove the pull request from projects by title + --remove-reviewer: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Remove reviewers by their login + --title(-t): text # Set the new title + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--body --body-file] + at-most-one [--milestone --remove-milestone] + terminal [--help] +} + +export complete [gh pr comment] [ + pr?: by "nu-complete gh prs" # Number, URL or branch of the pull request + --attach: path # Attach an image or video file + --body(-b): text # The comment body text + --body-file(-F): path # Read body text from file ("-" for stdin) + --create-if-none # Create a new comment if no comments are found + --delete-last # Delete the last comment of the current user + --edit-last # Edit the last comment of the current user + --editor(-e) # Open the text editor to write the body in + --web(-w) # Open the web browser to write the comment + --yes # Skip the delete confirmation prompt + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--body --body-file --editor --web] + at-most-one [--edit-last --delete-last] + requires --create-if-none --edit-last + requires --yes --delete-last + terminal [--help] +} + +export complete [gh pr checks] [ + pr?: by "nu-complete gh prs" # Number, URL or branch of the pull request + --fail-fast # Exit watch mode on first check failure + --interval(-i): text # Refresh interval in seconds in watch mode (default 10) + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields pr checks" within gh.list at item.name # Output JSON with the specified fields + --required # Only show checks that are required + --template(-t): text # Format JSON output using a Go template + --watch # Watch checks until they finish + --web(-w) # Open the web browser to show details about checks + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --fail-fast --watch + requires --interval --watch + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--watch --web --json] + terminal [--help] +} + +export complete [gh pr ready] [ + pr?: by "nu-complete gh prs" # Number, URL or branch of the pull request + --undo # Convert a pull request to "draft" + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh pr status] [ + --conflict-status(-c) # Display the merge conflict status of each pull request + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields pr status" within gh.list at item.name # Output JSON with the specified fields + --template(-t): text # Format JSON output using a Go template + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +# --- gh issue ----------------------------------------------------------------------------- + +export complete [gh issue] [ + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] + +export complete [gh issue list] [ + --app: text # Filter by GitHub App author + --assignee(-a): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by assignee + --author(-A): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by author + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields issue list" within gh.list at item.name # Output JSON with the specified fields + --label(-l): by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Filter by label + --limit(-L): text # Maximum number of issues to fetch (default 30) + --mention: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by mention + --milestone(-m): by "nu-complete gh milestones" [repo: --repo] # Filter by milestone number or title + --search(-S): text # Search issues with query + --state(-s): words [open closed all] # Filter by state + --template(-t): text # Format JSON output using a Go template + --type: text # Filter by issue type name + --web(-w) # List issues in the web browser + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +export complete [gh issue view] [ + issue: by "nu-complete gh issues" # Number or URL of the issue + --comments(-c) # View issue comments + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields issue view" within gh.list at item.name # Output JSON with the specified fields + --template(-t): text # Format JSON output using a Go template + --web(-w) # Open an issue in the browser + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +export complete [gh issue create] [ + --assignee(-a): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Assign people by their login; "@me" self-assigns + --attach: path # Attach an image or video file + --blocked-by: by "nu-complete gh issues" [repo: --repo] within gh.list at item.name # Mark the new issue as blocked by these issue numbers or URLs + --blocking: by "nu-complete gh issues" [repo: --repo] within gh.list at item.name # Mark the new issue as blocking these issue numbers or URLs + --body(-b): text # Supply a body + --body-file(-F): path # Read body text from file ("-" for stdin) + --editor(-e) # Open the text editor to write the title and body + --label(-l): by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Add labels by name + --milestone(-m): by "nu-complete gh milestones" [repo: --repo] # Add the issue to a milestone by name + --parent: by "nu-complete gh issues" # Add the new issue as a sub-issue of this parent + --project(-p): by "nu-complete gh projects" [repo: --repo] within gh.list at item.name # Add the issue to projects by title + --recover: path # Recover input from a failed run of create + --template(-T): by "nu-complete gh issue-templates" # Template name to use as starting body text + --title(-t): text # Supply a title + --type: text # Set the issue type by name + --web(-w) # Open the browser to create an issue + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--body --body-file] + at-most-one [--editor --web] + terminal [--help] +} + +export complete [gh issue close] [ + issue: by "nu-complete gh issues" # Number or URL of the issue + --comment(-c): text # Leave a closing comment + --duplicate-of: by "nu-complete gh issues" # Mark as duplicate of another issue by number or URL + --reason(-r): words [completed "not planned" duplicate] # Reason for closing + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue reopen] [ + issue: by "nu-complete gh issues-closed" [repo: --repo] # Number or URL of the closed issue + --comment(-c): text # Add a reopening comment + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue edit] [ + ...issues: by "nu-complete gh issues" # Numbers or URLs of the issues + --add-assignee: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Add assigned users by their login + --add-blocked-by: by "nu-complete gh issues" # Add 'blocked by' relationships + --add-blocking: by "nu-complete gh issues" # Add 'blocking' relationships + --add-label: by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Add labels by name + --add-project: by "nu-complete gh projects" [repo: --repo] within gh.list at item.name # Add the issue to projects by title + --add-sub-issue: by "nu-complete gh issues" # Add sub-issues by number or URL + --attach: path # Attach an image or video file + --body(-b): text # Set the new body + --body-file(-F): path # Read body text from file ("-" for stdin) + --milestone(-m): by "nu-complete gh milestones" [repo: --repo] # Edit the milestone the issue belongs to by name + --parent: by "nu-complete gh issues" # Set the parent issue by number or URL + --remove-assignee: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Remove assigned users by their login + --remove-blocked-by: by "nu-complete gh issues" # Remove 'blocked by' relationships + --remove-blocking: by "nu-complete gh issues" # Remove 'blocking' relationships + --remove-label: by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Remove labels by name + --remove-milestone # Remove the milestone association from the issue + --remove-parent # Remove the parent issue + --remove-project: by "nu-complete gh projects" [repo: --repo] within gh.list at item.name # Remove the issue from projects by title + --remove-sub-issue: by "nu-complete gh issues" # Remove sub-issues by number or URL + --remove-type # Remove the issue type from the issue + --title(-t): text # Set the new title + --type: text # Set the issue type by name + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--body --body-file] + at-most-one [--milestone --remove-milestone] + at-most-one [--parent --remove-parent] + at-most-one [--type --remove-type] + terminal [--help] +} + +export complete [gh issue comment] [ + issue: by "nu-complete gh issues" # Number or URL of the issue + --attach: path # Attach an image or video file + --body(-b): text # The comment body text + --body-file(-F): path # Read body text from file ("-" for stdin) + --create-if-none # Create a new comment if no comments are found + --delete-last # Delete the last comment of the current user + --edit-last # Edit the last comment of the current user + --editor(-e) # Open the text editor to write the body in + --web(-w) # Open the web browser to write the comment + --yes # Skip the delete confirmation prompt + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--body --body-file --editor --web] + at-most-one [--edit-last --delete-last] + requires --create-if-none --edit-last + requires --yes --delete-last + terminal [--help] +} + +export complete [gh issue status] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields issue status" within gh.list at item.name # Output JSON with the specified fields + --template(-t): text # Format JSON output using a Go template + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +# --- gh repo ------------------------------------------------------------------------------ + +export complete [gh repo] [ + --help # Show help for command +] + +export complete [gh repo view] [ + repository?: by "nu-complete gh repos" # OWNER/REPO or URL of the repository + --branch(-b): text # View a specific branch of the repository + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields repo view" within gh.list at item.name # Output JSON with the specified fields + --template(-t): text # Format JSON output using a Go template + --web(-w) # Open a repository in the browser + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +export complete [gh repo clone] [ + repository: by "nu-complete gh repos" # OWNER/REPO or URL of the repository + directory?: dir # The directory to clone into + --no-upstream # Do not add an upstream remote when cloning a fork + --upstream-remote-name(-u): text # Upstream remote name when cloning a fork (default "upstream") + --help # Show help for command +] where { + at-most-one [--no-upstream --upstream-remote-name] + terminal [--help] +} + +export complete [gh repo create] [ + name?: text # Name of the new repository, optionally OWNER/REPO + --add-readme # Add a README file to the new repository + --clone(-c) # Clone the new repository to the current directory + --description(-d): text # Description of the repository + --disable-issues # Disable issues in the new repository + --disable-wiki # Disable wiki in the new repository + --gitignore(-g): by "nu-complete gh gitignores" # Specify a gitignore template for the repository + --homepage(-h): text # Repository home page URL + --include-all-branches # Include all branches from template repository + --internal # Make the new repository internal + --license(-l): by "nu-complete gh licenses" # Specify an Open Source License for the repository + --private # Make the new repository private + --public # Make the new repository public + --push # Push local commits to the new repository + --remote(-r): text # Specify remote name for the new repository + --source(-s): dir # Specify path to local repository to use as source + --team(-t): text # The name of the organization team to be granted access + --template(-p): by "nu-complete gh repos" # Make the new repository based on a template repository + --help # Show help for command +] where { + at-most-one [--public --private --internal] + at-most-one [--clone --source] + requires --push --source + requires --remote --source + requires --include-all-branches --template + excludes --template --gitignore + excludes --template --license + excludes --template --add-readme + terminal [--help] +} + +export complete [gh repo fork] [ + repository?: by "nu-complete gh repos" # OWNER/REPO or URL of the repository to fork + --clone # Clone the fork + --default-branch-only # Only include the default branch in the fork + --fork-name: text # Rename the forked repository + --org: by "nu-complete gh orgs" # Create the fork in an organization + --remote # Add a git remote for the fork + --remote-name: text # Specify the name for the new remote (default "origin") + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo list] [ + owner?: by "nu-complete gh owners" # List repositories of this owner + --archived # Show only archived repositories + --fork # Show only forks + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields repo list" within gh.list at item.name # Output JSON with the specified fields + --language(-l): text # Filter by primary coding language + --limit(-L): text # Maximum number of repositories to list (default 30) + --no-archived # Omit archived repositories + --source # Show only non-forks + --template(-t): text # Format JSON output using a Go template + --topic: text # Filter by topic + --visibility: words [public private internal] # Filter by repository visibility + --help # Show help for command +] where { + at-most-one [--archived --no-archived] + at-most-one [--fork --source] + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +export complete [gh repo sync] [ + destination?: by "nu-complete gh repos" # The destination repository, OWNER/REPO + --branch(-b): by "nu-complete gh branches" # Branch to sync (default [default branch]) + --force # Hard reset the branch of the destination repository to match the source repository + --source(-s): by "nu-complete gh repos" # Source repository + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo delete] [ + repository?: by "nu-complete gh repos" # OWNER/REPO of the repository to delete + --yes # Confirm deletion without prompting + --accept-cascading-deletion-of-private-forks # Accept that deleting a private repository also deletes its forks + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo edit] [ + repository?: by "nu-complete gh repos" # OWNER/REPO of the repository to edit + --accept-visibility-change-consequences # Accept the consequences of changing the repository visibility + --add-topic: text # Add repository topic + --allow-forking # Allow forking of an organization repository + --allow-update-branch # Allow a pull request head branch that is behind its base branch to be updated + --default-branch: by "nu-complete gh branches" # Set the default branch name for the repository + --delete-branch-on-merge # Delete head branch when pull requests are merged + --description(-d): text # Description of the repository + --enable-advanced-security # Enable advanced security in the repository + --enable-auto-merge # Enable auto-merge functionality + --enable-discussions # Enable discussions in the repository + --enable-issues # Enable issues in the repository + --enable-merge-commit # Enable merging pull requests via merge commit + --enable-projects # Enable projects in the repository + --enable-rebase-merge # Enable merging pull requests via rebase + --enable-secret-scanning # Enable secret scanning in the repository + --enable-secret-scanning-push-protection # Enable secret scanning push protection in the repository + --enable-squash-merge # Enable merging pull requests via squashed commit + --enable-wiki # Enable wiki in the repository + --homepage(-h): text # Repository home page URL + --remove-topic: by "nu-complete gh repo-topics" # Remove repository topic + --squash-merge-commit-message: words [default pr-title pr-title-commits pr-title-description] # The default value for a squash merge commit message + --template # Make the repository available as a template repository + --visibility: words [public private internal] # Change the visibility of the repository + --help # Show help for command +] where { + requires --accept-visibility-change-consequences --visibility + requires --squash-merge-commit-message --enable-squash-merge + terminal [--help] +} + +# --- gh run ------------------------------------------------------------------------------- + +export complete [gh run] [ + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] + +export complete [gh run list] [ + --all(-a) # Include disabled workflows + --branch(-b): by "nu-complete gh branches" [repo: --repo] # Filter runs by branch + --commit(-c): by "nu-complete gh commits" # Filter runs by the SHA of the commit + --created: text # Filter runs by the date it was created + --event(-e): words [push pull_request pull_request_target workflow_dispatch schedule release workflow_run merge_group issues issue_comment "branch_protection_rule" "check_run" "check_suite" "create" "delete" "deployment" "deployment_status" "discussion" "discussion_comment" "fork" "gollum" "label" "milestone" "page_build" "public" "pull_request_review" "pull_request_review_comment" "registry_package" "repository_dispatch" "status" "watch" "workflow_call"] # Filter runs by which event triggered the run + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields run list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of runs to fetch (default 20) + --status(-s): words [queued completed in_progress requested waiting pending action_required cancelled failure neutral skipped stale startup_failure success timed_out] # Filter runs by status + --template(-t): text # Format JSON output using a Go template + --user(-u): text # Filter runs by user who triggered the run + --workflow(-w): by "nu-complete gh workflows" # Filter runs by workflow + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +export complete [gh run view] [ + run?: by "nu-complete gh runs" # The run ID + --attempt(-a): text # The attempt number of the workflow run + --exit-status # Exit with non-zero status if run failed + --job(-j): by "nu-complete gh run-jobs" [run: run] # View a specific job ID from a run + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields run view" within gh.list at item.name # Output JSON with the specified fields + --log # View full log for either a run or specific job + --log-failed # View the log for any failed steps in a run or specific job + --template(-t): text # Format JSON output using a Go template + --verbose(-v) # Show job steps + --web(-w) # Open run in the browser + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--log --log-failed --web --json] + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +export complete [gh run watch] [ + run?: by "nu-complete gh runs" # The run ID + --compact # Show only relevant/failed steps + --exit-status # Exit with non-zero status if run fails + --interval(-i): text # Refresh interval in seconds (default 3) + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh run rerun] [ + run?: by "nu-complete gh runs" # The run ID + --debug(-d) # Rerun with debug logging + --failed # Rerun only failed jobs, including dependencies + --job(-j): by "nu-complete gh run-jobs" [run: run] # Rerun a specific job ID from a run, including dependencies + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--failed --job] + terminal [--help] +} + +export complete [gh run cancel] [ + run?: by "nu-complete gh runs" # The run ID + --force # Force cancel a workflow run + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh run download] [ + run?: by "nu-complete gh runs" # The run ID + --dir(-D): dir # The directory to download artifacts into (default ".") + --name(-n): by "nu-complete gh artifacts" [run: run] # Download artifacts that match any of the given names + --pattern(-p): text # Download artifacts that match a glob pattern + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +# --- gh workflow -------------------------------------------------------------------------- + +export complete [gh workflow] [ + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] + +export complete [gh workflow list] [ + --all(-a) # Include disabled workflows + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields workflow list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of workflows to fetch (default 50) + --template(-t): text # Format JSON output using a Go template + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +export complete [gh workflow view] [ + workflow?: by "nu-complete gh workflows" # Workflow ID, name or file name + --ref(-r): text # The branch or tag name which contains the version of the workflow file + --web(-w) # Open workflow in the browser + --yaml(-y) # View the workflow yaml file + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--web --yaml] + terminal [--help] +} + +export complete [gh workflow run] [ + workflow?: by "nu-complete gh workflows" # Workflow ID, name or file name + --field(-F): text # Add a string parameter in key=value format, respecting @ syntax + --json # Read workflow inputs as JSON via STDIN + --raw-field(-f): text # Add a string parameter in key=value format + --ref(-r): by "nu-complete gh branches" [repo: --repo] # Branch or tag name which contains the version of the workflow file + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + excludes --json --field + excludes --json --raw-field + terminal [--help] +} + +export complete [gh workflow enable] [ + workflow?: by "nu-complete gh workflows" # Workflow ID, name or file name + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh workflow disable] [ + workflow?: by "nu-complete gh workflows" # Workflow ID, name or file name + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +# --- gh release --------------------------------------------------------------------------- + +export complete [gh release] [ + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] + +export complete [gh release list] [ + --exclude-drafts # Exclude draft releases + --exclude-pre-releases # Exclude pre-releases + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields release list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of items to fetch (default 30) + --order(-O): words [asc desc] # Order of releases returned + --template(-t): text # Format JSON output using a Go template + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +export complete [gh release view] [ + tag?: by "nu-complete gh releases" # The release tag + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields release view" within gh.list at item.name # Output JSON with the specified fields + --template(-t): text # Format JSON output using a Go template + --web(-w) # Open the release in the browser + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +export complete [gh release create] [ + tag?: text # The tag to release + ...files: path # Asset files or patterns to upload + --discussion-category: text # Start a discussion in the specified category + --draft(-d) # Save the release as a draft instead of publishing it + --fail-on-no-commits # Fail if there are no commits since the last release + --generate-notes # Automatically generate title and notes for the release + --latest?: words [true false] # Mark this release as "Latest" + --notes(-n): text # Release notes + --notes-file(-F): path # Read release notes from file ("-" for stdin) + --notes-from-tag # Fetch notes from the tag annotation or message of commit associated with tag + --notes-start-tag: by "nu-complete gh releases" # Tag to use as the starting point for generating release notes + --prerelease(-p) # Mark the release as a prerelease + --target: by "nu-complete gh branches" [repo: --repo] # Target branch or full commit SHA (default [main branch]) + --title(-t): text # Release title + --verify-tag # Abort in case the git tag doesn't already exist in the remote repository + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--notes --notes-file --notes-from-tag] + excludes --notes-from-tag --generate-notes + requires --notes-start-tag --generate-notes + terminal [--help] +} + +export complete [gh release download] [ + tag?: by "nu-complete gh releases" # The release tag (default: latest) + --allow-escape-sequences # Allow printing terminal escape sequences when writing an asset to stdout + --archive(-A): words [zip tar.gz] # Download the source code archive in the specified format + --clobber # Overwrite existing files of the same name + --dir(-D): dir # The directory to download files into (default ".") + --output(-O): path # The file to write a single asset to ("-" for stdout) + --pattern(-p): text # Download only assets that match a glob pattern + --skip-existing # Skip downloading when files of the same name exist + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--clobber --skip-existing] + at-most-one [--dir --output] + terminal [--help] +} + +export complete [gh release delete] [ + tag: by "nu-complete gh releases" # The release tag + --cleanup-tag # Delete the specified tag in addition to its release + --yes(-y) # Skip the confirmation prompt + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh release upload] [ + tag: by "nu-complete gh releases" # The release tag + ...files: path # The files to upload, optionally FILE#LABEL + --clobber # Delete and re-upload existing assets of the same name + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +# --- gh auth ------------------------------------------------------------------------------ + +export complete [gh auth] [ + --help # Show help for command +] + +export complete [gh auth login] [ + --clipboard(-c) # Copy one-time OAuth device code to clipboard + --expiring # Prefer expiring credentials that gh refreshes automatically + --git-protocol(-p): words [ssh https] # The protocol to use for git operations on this host + --hostname(-h): by "nu-complete gh hosts" # The hostname of the GitHub instance to authenticate with + --insecure-storage # Save authentication credentials in plain text instead of credential store + --scopes(-s): words ["repo" "repo:status" "repo_deployment" "public_repo" "repo:invite" "security_events" "admin:repo_hook" "write:repo_hook" "read:repo_hook" "admin:org" "write:org" "read:org" "admin:public_key" "write:public_key" "read:public_key" "admin:org_hook" "gist" "notifications" "user" "read:user" "user:email" "user:follow" "project" "read:project" "delete_repo" "write:packages" "read:packages" "delete:packages" "admin:gpg_key" "write:gpg_key" "read:gpg_key" "codespace" "workflow" "admin:ssh_signing_key" "write:ssh_signing_key" "read:ssh_signing_key" "copilot" "audit_log" "read:audit_log" "admin:enterprise" "manage_runners:enterprise" "manage_billing:enterprise" "read:enterprise"] # Additional authentication scopes to request + --skip-ssh-key # Skip generate/upload SSH key prompt + --web(-w) # Open a browser to authenticate + --with-token # Read token from standard input + --help # Show help for command +] where { + at-most-one [--web --with-token] + excludes --with-token --clipboard + terminal [--help] +} + +export complete [gh auth logout] [ + --hostname(-h): by "nu-complete gh hosts" # The hostname of the GitHub instance to log out of + --user(-u): by "nu-complete gh users" # The account to log out of + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh auth status] [ + --active(-a) # Display the active account only + --hostname(-h): by "nu-complete gh hosts" # Check only a specific hostname's auth status + --jq: text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields auth status" within gh.list at item.name # Output JSON with the specified fields + --no-refresh # Do not automatically refresh expired tokens + --show-token(-t) # Display the auth token + --template: text # Format JSON output using a Go template + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +export complete [gh auth refresh] [ + --clipboard(-c) # Copy one-time OAuth device code to clipboard + --expiring # Prefer expiring credentials that gh refreshes automatically + --hostname(-h): by "nu-complete gh hosts" # The GitHub host to use for authentication + --insecure-storage # Save authentication credentials in plain text instead of credential store + --remove-scopes(-r): words ["repo" "repo:status" "repo_deployment" "public_repo" "repo:invite" "security_events" "admin:repo_hook" "write:repo_hook" "read:repo_hook" "admin:org" "write:org" "read:org" "admin:public_key" "write:public_key" "read:public_key" "admin:org_hook" "gist" "notifications" "user" "read:user" "user:email" "user:follow" "project" "read:project" "delete_repo" "write:packages" "read:packages" "delete:packages" "admin:gpg_key" "write:gpg_key" "read:gpg_key" "codespace" "workflow" "admin:ssh_signing_key" "write:ssh_signing_key" "read:ssh_signing_key" "copilot" "audit_log" "read:audit_log" "admin:enterprise" "manage_runners:enterprise" "manage_billing:enterprise" "read:enterprise"] # Authentication scopes to remove from gh + --reset-scopes # Reset authentication scopes to the default minimum set of scopes + --scopes(-s): words ["repo" "repo:status" "repo_deployment" "public_repo" "repo:invite" "security_events" "admin:repo_hook" "write:repo_hook" "read:repo_hook" "admin:org" "write:org" "read:org" "admin:public_key" "write:public_key" "read:public_key" "admin:org_hook" "gist" "notifications" "user" "read:user" "user:email" "user:follow" "project" "read:project" "delete_repo" "write:packages" "read:packages" "delete:packages" "admin:gpg_key" "write:gpg_key" "read:gpg_key" "codespace" "workflow" "admin:ssh_signing_key" "write:ssh_signing_key" "read:ssh_signing_key" "copilot" "audit_log" "read:audit_log" "admin:enterprise" "manage_runners:enterprise" "manage_billing:enterprise" "read:enterprise"] # Additional authentication scopes for gh to have + --help # Show help for command +] where { + at-most-one [--reset-scopes --remove-scopes] + terminal [--help] +} + +export complete [gh auth token] [ + --hostname(-h): by "nu-complete gh hosts" # The hostname of the GitHub instance authenticated with + --no-refresh # Do not automatically refresh an expired token + --user(-u): by "nu-complete gh users" # The account to output the token for + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh auth switch] [ + --hostname(-h): by "nu-complete gh hosts" # The hostname of the GitHub instance to switch account for + --user(-u): by "nu-complete gh users" # The account to switch to + --help # Show help for command +] where { + terminal [--help] +} + +# --- gh gist ------------------------------------------------------------------------------ + +export complete [gh gist] [ + --help # Show help for command +] + +export complete [gh gist list] [ + --filter: text # Filter gists using a regular expression + --include-content # Include gists' file content when filtering + --limit(-L): text # Maximum number of gists to fetch (default 10) + --public # Show only public gists + --secret # Show only secret gists + --help # Show help for command +] where { + at-most-one [--public --secret] + requires --include-content --filter + terminal [--help] +} + +export complete [gh gist view] [ + gist?: by "nu-complete gh gists" # Gist ID or URL + --allow-escape-sequences # Allow printing terminal escape sequences + --filename(-f): by "nu-complete gh gist-files" [gist: gist] # Display a single file from the gist + --files # List file names from the gist + --raw(-r) # Print raw instead of rendered gist contents + --web(-w) # Open gist in the browser + --help # Show help for command +] where { + at-most-one [--files --filename --web] + terminal [--help] +} + +export complete [gh gist create] [ + ...files: path # Files to add, or "-" for stdin + --desc(-d): text # A description for this gist + --filename(-f): text # Provide a filename to be used when reading from standard input + --public(-p) # List the gist publicly (default "secret") + --web(-w) # Open the web browser with created gist + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh gist edit] [ + gist: by "nu-complete gh gists" # Gist ID or URL + filename?: by "nu-complete gh gist-files" [gist: gist] # The file in the gist to edit + --add(-a): path # Add a new file to the gist + --desc(-d): text # New description for the gist + --filename(-f): by "nu-complete gh gist-files" [gist: gist] # Select a file to edit + --remove(-r): by "nu-complete gh gist-files" [gist: gist] # Remove a file from the gist + --help # Show help for command +] where { + at-most-one [--add --remove --filename] + terminal [--help] +} + +export complete [gh gist delete] [ + gist: by "nu-complete gh gists" # Gist ID or URL + --yes # Confirm deletion without prompting + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh gist clone] [ + gist: by "nu-complete gh gists" # Gist ID or URL + directory?: dir # The directory to clone into + --help # Show help for command +] + +export complete [gh gist rename] [ + gist: by "nu-complete gh gists" # Gist ID or URL + old_filename: by "nu-complete gh gist-files" [gist: gist] # The current file name + new_filename: text # The new file name + --help # Show help for command ] -const GH_API_ENDPOINTS = [ - [value description]; - [graphql "GraphQL API"] - [user "The authenticated user"] - [user/repos "Repositories of the authenticated user"] - [user/orgs "Organizations of the authenticated user"] - [notifications "Notifications of the authenticated user"] - [rate_limit "Rate limit status"] - ["repos/{owner}/{repo}" "The current repository"] - ["repos/{owner}/{repo}/branches" "Branches"] - ["repos/{owner}/{repo}/commits" "Commits"] - ["repos/{owner}/{repo}/contents" "Contents"] - ["repos/{owner}/{repo}/contributors" "Contributors"] - ["repos/{owner}/{repo}/issues" "Issues"] - ["repos/{owner}/{repo}/issues/comments" "Issue comments"] - ["repos/{owner}/{repo}/labels" "Labels"] - ["repos/{owner}/{repo}/milestones" "Milestones"] - ["repos/{owner}/{repo}/pulls" "Pull requests"] - ["repos/{owner}/{repo}/pulls/comments" "Pull request review comments"] - ["repos/{owner}/{repo}/releases" "Releases"] - ["repos/{owner}/{repo}/releases/latest" "Latest release"] - ["repos/{owner}/{repo}/tags" "Tags"] - ["repos/{owner}/{repo}/actions/runs" "Workflow runs"] - ["repos/{owner}/{repo}/actions/workflows" "Workflows"] - ["repos/{owner}/{repo}/actions/artifacts" "Artifacts"] - ["repos/{owner}/{repo}/actions/caches" "Actions caches"] - ["repos/{owner}/{repo}/actions/secrets" "Actions secrets"] - ["repos/{owner}/{repo}/actions/variables" "Actions variables"] - ["repos/{owner}/{repo}/collaborators" "Collaborators"] - ["repos/{owner}/{repo}/deployments" "Deployments"] - ["repos/{owner}/{repo}/environments" "Environments"] - ["repos/{owner}/{repo}/forks" "Forks"] - ["repos/{owner}/{repo}/hooks" "Webhooks"] - ["repos/{owner}/{repo}/rulesets" "Rulesets"] - ["repos/{owner}/{repo}/stargazers" "Stargazers"] - ["repos/{owner}/{repo}/topics" "Topics"] - ["search/code" "Search code"] - ["search/commits" "Search commits"] - ["search/issues" "Search issues and pull requests"] - ["search/repositories" "Search repositories"] - ["search/users" "Search users"] -] +# --- gh api ------------------------------------------------------------------------------- + +export complete [gh api] [ + endpoint: words ["graphql": "GraphQL API" "user": "The authenticated user" "user/repos": "Repositories of the authenticated user" "user/orgs": "Organizations of the authenticated user" "notifications": "Notifications of the authenticated user" "rate_limit": "Rate limit status" "repos/{owner}/{repo}": "The current repository" "repos/{owner}/{repo}/branches": "Branches" "repos/{owner}/{repo}/commits": "Commits" "repos/{owner}/{repo}/contents": "Contents" "repos/{owner}/{repo}/contributors": "Contributors" "repos/{owner}/{repo}/issues": "Issues" "repos/{owner}/{repo}/issues/comments": "Issue comments" "repos/{owner}/{repo}/labels": "Labels" "repos/{owner}/{repo}/milestones": "Milestones" "repos/{owner}/{repo}/pulls": "Pull requests" "repos/{owner}/{repo}/pulls/comments": "Pull request review comments" "repos/{owner}/{repo}/releases": "Releases" "repos/{owner}/{repo}/releases/latest": "Latest release" "repos/{owner}/{repo}/tags": "Tags" "repos/{owner}/{repo}/actions/runs": "Workflow runs" "repos/{owner}/{repo}/actions/workflows": "Workflows" "repos/{owner}/{repo}/actions/artifacts": "Artifacts" "repos/{owner}/{repo}/actions/caches": "Actions caches" "repos/{owner}/{repo}/actions/secrets": "Actions secrets" "repos/{owner}/{repo}/actions/variables": "Actions variables" "repos/{owner}/{repo}/collaborators": "Collaborators" "repos/{owner}/{repo}/deployments": "Deployments" "repos/{owner}/{repo}/environments": "Environments" "repos/{owner}/{repo}/forks": "Forks" "repos/{owner}/{repo}/hooks": "Webhooks" "repos/{owner}/{repo}/rulesets": "Rulesets" "repos/{owner}/{repo}/stargazers": "Stargazers" "repos/{owner}/{repo}/topics": "Topics" "search/code": "Search code" "search/commits": "Search commits" "search/issues": "Search issues and pull requests" "search/repositories": "Search repositories" "search/users": "Search users"] # A GitHub API v3 path, or "graphql" + --allow-escape-sequences # Allow printing terminal escape sequences + --cache: text # Cache the response, e.g. "3600s", "60m", "1h" + --field(-F): text # Add a typed parameter in key=value format + --header(-H): words ["Accept: application/vnd.github+json" "Accept: application/vnd.github.raw+json" "Accept: application/vnd.github.diff" "X-GitHub-Api-Version: 2022-11-28"] # Add a HTTP request header in key:value format + --hostname: by "nu-complete gh hosts" # The GitHub hostname for the request (default "github.com") + --include(-i) # Include HTTP response status line and headers in the output + --input: path # The file to use as body for the HTTP request ("-" for stdin) + --jq(-q): text # Query to select values from the response using jq syntax + --method(-X): words [GET POST PUT PATCH DELETE "HEAD"] # The HTTP method for the request (default "GET") + --paginate # Make additional HTTP requests to fetch all pages of results + --preview(-p): text # Opt into GitHub API previews + --raw-field(-f): text # Add a string parameter in key=value format + --silent # Do not print the response body + --slurp # Use with "--paginate" to return an array of all pages + --template(-t): text # Format JSON output using a Go template + --verbose # Include full HTTP request and response in the output + --help # Show help for command +] where { + requires --slurp --paginate + excludes --slurp --jq + excludes --slurp --template + at-most-one [--jq --template] + at-most-one [--silent --verbose] + terminal [--help] +} + +# --- gh search ---------------------------------------------------------------------------- + +export complete [gh search] [ + --help # Show help for command +] + +export complete [gh search repos] [ + ...query: text # Search keywords + --archived?: words [true false] # Filter based on the repository archived state + --created: text # Filter based on created at date + --followers: text # Filter based on number of followers + --forks: text # Filter on number of forks + --good-first-issues: text # Filter on number of issues with the 'good first issue' label + --help-wanted-issues: text # Filter on number of issues with the 'help wanted' label + --include-forks: words [false true only] # Include forks in fetched repositories + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields search repos" within gh.list at item.name # Output JSON with the specified fields + --language: text # Filter based on the coding language + --license: by "nu-complete gh licenses" within gh.list at item.name # Filter based on license type + --limit(-L): text # Maximum number of repositories to fetch (default 30) + --match: words [name description readme] # Restrict search to specific field of repository + --number-topics: text # Filter on number of topics + --order: words [asc desc] # Order of repositories returned + --owner: by "nu-complete gh owners" within gh.list at item.name # Filter on owner + --size: text # Filter on a size range, in kilobytes + --sort: words [forks help-wanted-issues stars updated] # Sort fetched repositories + --stars: text # Filter on number of stars + --template(-t): text # Format JSON output using a Go template + --topic: text # Filter on topic + --updated: text # Filter on last updated at date + --visibility: words [public private internal] # Filter based on visibility + --web(-w) # Open the search query in the web browser + --help # Show help for command +] where { + requires --order --sort + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +export complete [gh search issues] [ + ...query: text # Search keywords + --app: text # Filter by GitHub App author + --archived?: words [true false] # Filter based on the repository archived state + --assignee: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by assignee + --author: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by author + --closed: text # Filter on closed at date + --commenter: words ["@me": "The authenticated user"] # Filter based on comments by user + --comments: text # Filter on number of comments + --created: text # Filter based on created at date + --include-prs # Include pull requests in results + --interactions: text # Filter on number of reactions and comments + --involves: words ["@me": "The authenticated user"] # Filter based on involvement of user + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields search issues" within gh.list at item.name # Output JSON with the specified fields + --label: by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Filter on label + --language: text # Filter based on the coding language + --limit(-L): text # Maximum number of results to fetch (default 30) + --locked # Filter on locked conversation status + --match: words [title body comments] # Restrict search to specific field of issue + --mentions: words ["@me": "The authenticated user"] # Filter based on user mentions + --milestone: by "nu-complete gh milestones" [repo: --repo] # Filter by milestone title + --no-assignee # Filter on missing assignee + --no-label # Filter on missing label + --no-milestone # Filter on missing milestone + --no-project # Filter on missing project + --order: words [asc desc] # Order of results returned + --owner: by "nu-complete gh owners" within gh.list at item.name # Filter on repository owner + --project: text # Filter on project board owner/number + --reactions: text # Filter on number of reactions + --repo(-R): by "nu-complete gh repos" # Filter on repository, in OWNER/REPO format + --search-type: words [lexical semantic hybrid] # Type of issue search to perform + --sort: words [comments created interactions reactions reactions-+1 reactions--1 reactions-heart reactions-smile reactions-tada reactions-thinking_face updated] # Sort fetched results + --state: words [open closed] # Filter based on state + --team-mentions: text # Filter based on team mentions + --template(-t): text # Format JSON output using a Go template + --updated: text # Filter on last updated at date + --visibility: words [public private internal] # Filter based on repository visibility + --web(-w) # Open the search query in the web browser + --help # Show help for command +] where { + at-most-one [--assignee --no-assignee] + at-most-one [--label --no-label] + at-most-one [--milestone --no-milestone] + at-most-one [--project --no-project] + requires --order --sort + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +export complete [gh search prs] [ + ...query: text # Search keywords + --app: text # Filter by GitHub App author + --archived?: words [true false] # Filter based on the repository archived state + --assignee: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by assignee + --author: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by author + --base(-B): text # Filter on base branch name + --checks: words [pending success failure] # Filter based on status of the checks + --closed: text # Filter on closed at date + --commenter: words ["@me": "The authenticated user"] # Filter based on comments by user + --comments: text # Filter on number of comments + --created: text # Filter based on created at date + --draft # Filter based on draft state + --head(-H): text # Filter on head branch name + --interactions: text # Filter on number of reactions and comments + --involves: words ["@me": "The authenticated user"] # Filter based on involvement of user + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields search prs" within gh.list at item.name # Output JSON with the specified fields + --label: by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Filter on label + --language: text # Filter based on the coding language + --limit(-L): text # Maximum number of results to fetch (default 30) + --locked # Filter on locked conversation status + --match: words [title body comments] # Restrict search to specific field of issue + --mentions: words ["@me": "The authenticated user"] # Filter based on user mentions + --merged # Filter based on merged state + --merged-at: text # Filter on merged at date + --milestone: by "nu-complete gh milestones" [repo: --repo] # Filter by milestone title + --no-assignee # Filter on missing assignee + --no-label # Filter on missing label + --no-milestone # Filter on missing milestone + --no-project # Filter on missing project + --order: words [asc desc] # Order of results returned + --owner: by "nu-complete gh owners" within gh.list at item.name # Filter on repository owner + --project: text # Filter on project board owner/number + --reactions: text # Filter on number of reactions + --repo(-R): by "nu-complete gh repos" # Filter on repository, in OWNER/REPO format + --review: words [none required approved changes_requested] # Filter based on review status + --review-requested: words ["@me": "The authenticated user"] # Filter on user or team requested to review + --reviewed-by: words ["@me": "The authenticated user"] # Filter on user who reviewed + --sort: words [comments reactions reactions-+1 reactions--1 reactions-smile reactions-thinking_face reactions-heart reactions-tada interactions created updated] # Sort fetched results + --state: words [open closed] # Filter based on state + --team-mentions: text # Filter based on team mentions + --template(-t): text # Format JSON output using a Go template + --updated: text # Filter on last updated at date + --visibility: words [public private internal] # Filter based on repository visibility + --web(-w) # Open the search query in the web browser + --help # Show help for command +] where { + at-most-one [--assignee --no-assignee] + at-most-one [--label --no-label] + at-most-one [--milestone --no-milestone] + at-most-one [--project --no-project] + requires --order --sort + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +export complete [gh search code] [ + ...query: text # Search keywords + --extension: text # Filter on file extension + --filename: text # Filter on filename + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields search code" within gh.list at item.name # Output JSON with the specified fields + --language: text # Filter results by language + --limit(-L): text # Maximum number of code results to fetch (default 30) + --match: words [file path] # Restrict search to file contents or file path + --owner: by "nu-complete gh owners" within gh.list at item.name # Filter on owner + --repo(-R): by "nu-complete gh repos" # Filter on repository, in OWNER/REPO format + --size: text # Filter on size range, in kilobytes + --template(-t): text # Format JSON output using a Go template + --web(-w) # Open the search query in the web browser + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +export complete [gh search commits] [ + ...query: text # Search keywords + --author: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by author + --author-date: text # Filter based on authored date + --author-email: text # Filter on author email + --author-name: text # Filter on author name + --committer: text # Filter by committer + --committer-date: text # Filter based on committed date + --committer-email: text # Filter on committer email + --committer-name: text # Filter on committer name + --hash: text # Filter by commit hash + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields search commits" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of commits to fetch (default 30) + --merge # Filter on merge commits + --order: words [asc desc] # Order of commits returned + --owner: by "nu-complete gh owners" within gh.list at item.name # Filter on repository owner + --parent: by "nu-complete gh issues" [repo: --repo] within gh.list at item.name # Filter by parent hash + --repo(-R): by "nu-complete gh repos" # Filter on repository, in OWNER/REPO format + --sort: words [author-date committer-date] # Sort fetched commits + --template(-t): text # Format JSON output using a Go template + --tree: text # Filter by tree hash + --visibility: words [public private internal] # Filter based on repository visibility + --web(-w) # Open the search query in the web browser + --help # Show help for command +] where { + requires --order --sort + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +# --- gh browse, gh status ----------------------------------------------------------------- + +export complete [gh browse] [ + target?: path # Issue or PR number, file path, or commit SHA + --actions(-a) # Open repository actions + --blame # Open blame view for a file + --branch(-b): by "nu-complete gh branches" [repo: --repo] # Select another branch by passing in the branch name + --commit(-c)?: text # Select another commit by passing in the commit SHA (default: last commit) + --no-browser(-n) # Print destination URL instead of opening the browser + --projects(-p) # Open repository projects + --releases(-r) # Open repository releases + --settings(-s) # Open repository settings + --wiki(-w) # Open repository wiki + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--branch --commit] + at-most-one [--actions --projects --releases --settings --wiki] + terminal [--help] +} + +export complete [gh status] [ + --exclude(-e): by "nu-complete gh repos" within gh.list at item.name # Comma separated list of repos to exclude in owner/name format + --org(-o): by "nu-complete gh orgs" # Report status within an organization + --help # Show help for command +] where { + terminal [--help] +} + +# --- gh label ----------------------------------------------------------------------------- + +export complete [gh label] [ + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] + +export complete [gh label list] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields label list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of labels to fetch (default 30) + --order: words [asc desc] # Order of labels returned + --search(-S): text # Search label names and descriptions + --sort: words [created name] # Sort fetched labels + --template(-t): text # Format JSON output using a Go template + --web(-w) # List labels in the web browser + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] +} + +export complete [gh label create] [ + name: text # Name of the new label + --color(-c): text # Color of the label + --description(-d): text # Description of the label + --force(-f) # Update the label color and description if label already exists + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +# --- gh secret, gh variable --------------------------------------------------------------- + +export complete [gh secret] [ + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] + +export complete [gh secret set] [ + name?: by "nu-complete gh secrets" [repo: --repo] # Name of the secret + --app(-a): words [actions agents codespaces dependabot] # Set the application for a secret + --body(-b): text # The value for the secret (reads from standard input if not specified) + --env(-e): by "nu-complete gh environments" [repo: --repo] # Set deployment environment secret + --env-file(-f): path # Load secret names and values from a dotenv-formatted file + --no-repos-selected # No repositories can access the organization secret + --no-store # Print the encrypted, base64-encoded value instead of storing it on GitHub + --org(-o): by "nu-complete gh orgs" # Set organization secret + --repos(-r): by "nu-complete gh repos" within gh.list at item.name # List of repositories that can access an organization or user secret + --user(-u) # Set a secret for your user + --visibility(-v): words [all private selected] # Set visibility for an organization secret + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--org --env --user] + at-most-one [--body --env-file] + at-most-one [--repos --no-repos-selected] + terminal [--help] +} + +export complete [gh secret list] [ + --app(-a): words [actions agents codespaces dependabot] # List secrets for a specific application + --env(-e): by "nu-complete gh environments" [repo: --repo] # List secrets for an environment + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields secret list" within gh.list at item.name # Output JSON with the specified fields + --org(-o): by "nu-complete gh orgs" # List secrets for an organization + --template(-t): text # Format JSON output using a Go template + --user(-u) # List a secret for your user + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--org --env --user] + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +export complete [gh variable] [ + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] + +export complete [gh variable set] [ + name?: by "nu-complete gh variables" [repo: --repo] # Name of the variable + --body(-b): text # The value for the variable (reads from standard input if not specified) + --env(-e): by "nu-complete gh environments" [repo: --repo] # Set deployment environment variable + --env-file(-f): path # Load variable names and values from a dotenv-formatted file + --org(-o): by "nu-complete gh orgs" # Set organization variable + --repos(-r): by "nu-complete gh repos" within gh.list at item.name # List of repositories that can access an organization variable + --visibility(-v): words [all private selected] # Set visibility for an organization variable + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--org --env] + at-most-one [--body --env-file] + terminal [--help] +} + +export complete [gh variable list] [ + --env(-e): by "nu-complete gh environments" [repo: --repo] # List variables for an environment + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields variable list" within gh.list at item.name # Output JSON with the specified fields + --org(-o): by "nu-complete gh orgs" # List variables for an organization + --template(-t): text # Format JSON output using a Go template + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--org --env] + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +export complete [gh variable get] [ + name: by "nu-complete gh variables" [repo: --repo] # Name of the variable + --env(-e): by "nu-complete gh environments" [repo: --repo] # Get a variable for an environment + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields variable get" within gh.list at item.name # Output JSON with the specified fields + --org(-o): by "nu-complete gh orgs" # Get a variable for an organization + --template(-t): text # Format JSON output using a Go template + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--org --env] + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +export complete [gh variable delete] [ + name: by "nu-complete gh variables" [repo: --repo] # Name of the variable + --env(-e): by "nu-complete gh environments" [repo: --repo] # Delete a variable for an environment + --org(-o): by "nu-complete gh orgs" # Delete a variable for an organization + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--org --env] + terminal [--help] +} + +# --- gh cache ----------------------------------------------------------------------------- + +export complete [gh cache] [ + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] + +export complete [gh cache list] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields cache list" within gh.list at item.name # Output JSON with the specified fields + --key(-k): text # Filter by cache key prefix + --limit(-L): text # Maximum number of caches to fetch (default 30) + --order(-O): words [asc desc] # Order of caches returned + --ref(-r): by "nu-complete gh cache-refs" [repo: --repo] # Filter by ref, as refs/heads/ or refs/pull//merge + --sort(-S): words [created_at last_accessed_at size_in_bytes] # Sort fetched caches + --template(-t): text # Format JSON output using a Go template + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +export complete [gh cache delete] [ + cache?: by "nu-complete gh caches" [repo: --repo] # Cache ID or key + --all(-a) # Delete all caches + --ref(-r): by "nu-complete gh cache-refs" [repo: --repo] # Delete by cache key and ref + --succeed-on-no-caches # Return exit code 0 if no caches found; requires --all + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --succeed-on-no-caches --all + terminal [--help] +} + +# --- Other command groups ----------------------------------------------------------------- + +export complete [gh completion] [ + --shell(-s): words [bash zsh fish powershell] # Shell type + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace] [ + --help # Show help for command +] + +export complete [gh org] [ + --help # Show help for command +] + +export complete [gh project] [ + --help # Show help for command +] + +export complete [gh alias] [ + --help # Show help for command +] + +export complete [gh config] [ + --help # Show help for command +] + +export complete [gh extension] [ + --help # Show help for command +] + +export complete [gh gpg-key] [ + --help # Show help for command +] + +export complete [gh ssh-key] [ + --help # Show help for command +] + +export complete [gh ruleset] [ + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] + +# --- Further commands (from `gh help reference`) ------------------------------------- + +export complete [gh agent-task] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agent-task create] [ + --base(-b): by "nu-complete gh branches" [repo: --repo] # Base branch for the pull request (use default branch if not provided) + --custom-agent(-a): text # Use a custom agent for the task. e.g., use 'my-agent' for the 'my-agent.md' agent + --follow # Follow agent session logs + --from-file(-F): path # Read task description from file (use "-" to read from standard input) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agent-task list] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields agent-task list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of agent tasks to fetch (default 30) + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open agent tasks in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agent-task view] [ + pr?: by "nu-complete gh prs" [repo: --repo] # Number, URL or branch of the pull request + --follow # Follow agent session logs + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields agent-task view" within gh.list at item.name # Output JSON with the specified fields + --log # Show agent session logs + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open agent task in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh alias delete] [ + alias?: by "nu-complete gh aliases" # Alias name + --all # Delete all aliases + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh alias import] [ + file?: path # File + --clobber # Overwrite existing aliases of the same name + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh alias list] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh alias set] [ + --clobber # Overwrite existing aliases of the same name + --shell(-s) # Declare an alias to be passed through a shell interpreter + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh attestation] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh attestation download] [ + file?: path # File + --digest-alg(-d): words ["sha256" "sha512"] # The algorithm used to compute a digest of the artifact: {sha256|sha512} (default "sha256") + --hostname: by "nu-complete gh hosts" # Configure host to use + --limit(-L): text # Maximum number of attestations to fetch (default 30) + --owner(-o): by "nu-complete gh owners" within gh.list at item.name # GitHub organization to scope attestation lookup by + --predicate-type: text # Filter attestations by provided predicate type + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Repository name in the format / + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh attestation trusted-root] [ + --hostname: by "nu-complete gh hosts" # Configure host to use + --tuf-root: text # Path to the TUF root.json file on disk + --tuf-url: text # URL to the TUF repository mirror + --verify-only # Don't output trusted_root.jsonl contents + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh attestation verify] [ + file?: path # File + --bundle(-b): text # Path to bundle on disk, either a single bundle in a JSON file or a JSON lines file with multiple bundles + --bundle-from-oci # When verifying an OCI image, fetch the attestation bundle from the OCI registry instead of from GitHub + --cert-identity: text # Enforce that the certificate's SubjectAlternativeName matches the provided value exactly + --cert-identity-regex(-i): text # Enforce that the certificate's SubjectAlternativeName matches the provided regex + --cert-oidc-issuer: text # Enforce that the issuer of the OIDC token matches the provided value (default "https://token.actions.githubusercontent.com") + --custom-trusted-root: text # Path to a trusted_root.jsonl file; likely for offline verification + --deny-self-hosted-runners # Fail verification for attestations generated on self-hosted runners + --digest-alg(-d): words ["sha256" "sha512"] # The algorithm used to compute a digest of the artifact: {sha256|sha512} (default "sha256") + --format: words ["json"] # Output format: {json} + --hostname: by "nu-complete gh hosts" # Configure host to use + --jq(-q): text # Filter JSON output using a jq expression + --limit(-L): text # Maximum number of attestations to fetch (default 30) + --no-public-good # Do not verify attestations signed with Sigstore public good instance + --owner(-o): by "nu-complete gh owners" within gh.list at item.name # GitHub organization to scope attestation lookup by + --predicate-type: text # Enforce that verified attestations' predicate type matches the provided value (default "https://slsa.dev/provenance/v1") + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Repository name in the format / + --signer-digest: text # Enforce that the digest associated with the signer workflow matches the provided value + --signer-repo: by "nu-complete gh repos" within gh.list at item.name # Enforce that the workflow that signed the attestation's repository matches the provided value (/) + --signer-workflow: text # Enforce that the workflow that signed the attestation matches the provided value ([host/]////) + --source-digest: text # Enforce that the digest associated with the source repository matches the provided value + --source-ref: text # Enforce that the git ref associated with the source repository matches the provided value + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh auth setup-git] [ + --force(-f) # Force setup even if the host is not known. Must be used in conjunction with --hostname + --hostname(-h): by "nu-complete gh hosts" # The hostname to configure git for + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace code] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --insiders # Use the insiders version of Visual Studio Code + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --web(-w) # Use the web version of Visual Studio Code + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace cp] [ + ...file: path # File + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --expand(-e) # Expand remote file names on remote shell + --profile(-p): text # Name of the SSH profile to use + --recursive(-r) # Recursively copy directories + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace create] [ + --branch(-b): by "nu-complete gh branches" [repo: --repo] # Repository branch + --default-permissions # Do not prompt to accept additional permissions requested by the codespace + --devcontainer-path: text # Path to the devcontainer.json file to use when creating codespace + --display-name(-d): text # Display name for the codespace (48 characters or less) + --idle-timeout: text # Allowed inactivity before codespace is stopped, e.g. "10m", "1h" + --location(-l): words ["EastUs" "SouthEastAsia" "WestEurope" "WestUs2"] # Location: {EastUs|SouthEastAsia|WestEurope|WestUs2} (determined automatically if not provided) + --machine(-m): text # Hardware specifications for the VM + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Repository name with owner: user/repo + --retention-period: text # Allowed time after shutting down before the codespace is automatically deleted (maximum 30 days), e.g. "1h", "72h" + --status(-s) # Show status of post-create command and dotfiles + --web(-w) # Create codespace from browser, cannot be used with --display-name, --idle-timeout, or --retention-period + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace delete] [ + --all # Delete all codespaces + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --days: text # Delete codespaces older than N days + --force(-f) # Skip confirmation for codespaces that contain unsaved changes + --org(-o): by "nu-complete gh orgs" # The login handle of the organization (admin-only) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --user(-u): text # The username to delete codespaces for (used with --org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace edit] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --display-name(-d): text # Set the display name + --machine(-m): text # Set hardware specifications for the VM + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace jupyter] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace list] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields codespace list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of codespaces to list (default 30) + --org(-o): by "nu-complete gh orgs" # The login handle of the organization to list codespaces for (admin-only) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Repository name with owner: user/repo + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --user(-u): text # The username to list codespaces for (used with --org) + --web(-w) # List codespaces in the web browser, cannot be used with --user or --org + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace logs] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --follow(-f) # Tail and follow the logs + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace ports] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields codespace ports" within gh.list at item.name # Output JSON with the specified fields + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace ports forward] [ + --all-interfaces # Listen on all network interfaces + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace ports visibility] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace rebuild] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --full # Perform a full rebuild + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace ssh] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --config # Write OpenSSH configuration to stdout + --debug(-d) # Log debug data to a file + --debug-file: text # Path of the file log to + --profile: text # Name of the SSH profile to use + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --server-port: text # SSH server port number (0 => pick unused) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace stop] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --org(-o): by "nu-complete gh orgs" # The login handle of the organization (admin-only) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --user(-u): text # The username to stop codespace for (used with --org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh codespace view] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields codespace view" within gh.list at item.name # Output JSON with the specified fields + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh config clear-cache] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh config get] [ + config-key?: by "nu-complete gh config-keys" # Configuration key + --host(-h): by "nu-complete gh hosts" # Get per-host setting + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh config list] [ + --host(-h): by "nu-complete gh hosts" # Get per-host configuration + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh config set] [ + config-key?: by "nu-complete gh config-keys" # Configuration key + config-value?: by "nu-complete gh config-values" [key: config-key] # Configuration value + --host(-h): by "nu-complete gh hosts" # Set per-host setting + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh copilot] [ + --remove # Remove the downloaded Copilot CLI + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh discussion] [ + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh discussion comment] [ + discussion?: by "nu-complete gh discussions" [repo: --repo] # Discussion number + --body(-b): text # Comment body text + --body-file(-F): text # Read body text from file (use "-" to read from standard input) + --delete # Delete the specified comment + --edit # Edit the specified comment + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --yes # Skip the delete confirmation prompt + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh discussion create] [ + --body(-b): text # Body for the discussion + --body-file(-F): text # Read body text from file (use "-" to read from stdin) + --category(-c): text # Category name or slug for the discussion + --label(-l): by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Labels to apply to the discussion + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --title(-t): text # Title for the discussion + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh discussion edit] [ + discussion?: by "nu-complete gh discussions" [repo: --repo] # Discussion number + --add-label: by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Add labels by name + --body(-b): text # New body for the discussion + --body-file(-F): text # Read body text from file (use "-" to read from standard input) + --category(-c): text # New category name or slug for the discussion + --remove-label: by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Remove labels by name + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --title(-t): text # New title for the discussion + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh discussion list] [ + --after: text # Cursor for the next page of results + --answered # Filter by answered state + --author(-A): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by author + --category(-c): text # Filter by category name or slug + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields discussion list" within gh.list at item.name # Output JSON with the specified fields + --label(-l): by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Filter by label + --limit(-L): text # Maximum number of discussions to fetch (default 30) + --order: words ["asc" "desc"] # Order of results: {asc|desc} (default "desc") + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --search(-S): text # Search discussions with query + --sort: words ["created" "updated"] # Sort by field: {created|updated} (default "updated") + --state(-s): words ["open" "closed" "all"] # Filter by state: {open|closed|all} (default "open") + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # List discussions in the web browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh discussion view] [ + discussion?: by "nu-complete gh discussions" [repo: --repo] # Discussion number + --after: text # Cursor for the next page + --comments(-c) # View discussion comments + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields discussion view" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of comments or replies to fetch (default 30) + --order: words ["oldest" "newest"] # Order of comments or replies: {oldest|newest} (default "newest") + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open a discussion in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extension browse] [ + --debug # Log to /tmp/extBrowse-* + --single-column(-s) # Render TUI with only one column of text + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extension create] [ + --precompiled: words ["go" "other"] # Create a precompiled extension. Possible values: go, other + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extension exec] [ + extension?: by "nu-complete gh extensions" # Extension name + ...none: text # Argument + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extension install] [ + --force # Force upgrade extension, or ignore if latest already installed + --pin: text # Pin extension to a release tag or commit ref + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extension list] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extension remove] [ + extension?: by "nu-complete gh extensions" # Extension name + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extension search] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields extension search" within gh.list at item.name # Output JSON with the specified fields + --license: by "nu-complete gh licenses" within gh.list at item.name # Filter based on license type + --limit(-L): text # Maximum number of extensions to fetch (default 30) + --order: words ["asc" "desc"] # Order of repositories returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc") + --owner: by "nu-complete gh owners" within gh.list at item.name # Filter on owner + --sort: words ["forks" "help-wanted-issues" "stars" "updated"] # Sort fetched repositories: {forks|help-wanted-issues|stars|updated} (default "best-match") + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open the search query in the web browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extension upgrade] [ + extension?: by "nu-complete gh extensions" # Extension name + --all # Upgrade all extensions + --dry-run # Only display upgrades + --force # Force upgrade extension + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh gpg-key add] [ + file?: path # File + --title(-t): text # Title for the new key + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh gpg-key delete] [ + gpg-key?: by "nu-complete gh gpg-keys" # GPG key ID + --yes(-y) # Skip the confirmation prompt + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh gpg-key list] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue artifact] [ + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue artifact create] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + ...file: path # File + --attach: path # Attach an image or video file, in '#' format + --body(-b): text # Content for a single document + --body-file(-F): path # Read content for a single artifact from file (use "-" to read from standard input) + --name: text # Name for a single artifact + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --type: words ["generic" "plan" "embedded_html"] # Type for documents: {generic|plan|embedded_html} + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue artifact delete] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --yes # Confirm deletion without prompting + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue artifact download] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --clobber # Overwrite existing files of the same name + --dir(-D): path # The directory to download files into (default ".") + --output(-O): path # The file to write a single artifact to (use "-" to write to standard output) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --skip-existing # Skip downloading when files of the same name exist + --version: text # Download the version with this number from the edit history + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue artifact edit] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --attach: path # Attach an image or video file, in '#' format + --body(-b): text # New content; for a link, a URL + --body-file(-F): path # Read new content from file (use "-" to read from standard input) + --name: text # New name + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --restore-version: text # Restore the version with this number from the edit history + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue artifact list] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields issue artifact list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of artifacts to fetch + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --type: words ["generic" "plan" "link" "embedded_html"] # Filter by type: {generic|plan|link|embedded_html} + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue artifact view] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields issue artifact view" within gh.list at item.name # Output JSON with the specified fields + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --version: text # Show the version with this number from the edit history + --web(-w) # Open a document's page on GitHub, or a link's URL + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue delete] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --yes # Confirm deletion without prompting + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue develop] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --base(-b): by "nu-complete gh branches" [repo: --repo] # Name of the remote branch you want to make your new branch from + --branch-repo: by "nu-complete gh repos" within gh.list at item.name # Name or URL of the repository where you want to create your new branch + --checkout(-c) # Checkout the branch after creating it + --list(-l) # List linked branches for the issue + --name(-n): text # Name of the branch to create + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --worktree: path # Check out the branch into a worktree at the given path + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue lock] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --reason(-r): words ["off_topic" "resolved" "spam" "too_heated"] # Optional reason for locking conversation (off_topic, resolved, spam, too_heated). + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue pin] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue transfer] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + repo?: by "nu-complete gh repos" # Repository as [HOST/]OWNER/REPO + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue unlock] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh issue unpin] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh label clone] [ + repo?: by "nu-complete gh repos" # Repository as [HOST/]OWNER/REPO + --force(-f) # Overwrite labels in the destination repository + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh label delete] [ + label?: by "nu-complete gh labels" [repo: --repo] # Label name + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --yes # Confirm deletion without prompting + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh label edit] [ + label?: by "nu-complete gh labels" [repo: --repo] # Label name + --color(-c): text # Color of the label + --description(-d): text # Description of the label + --name(-n): text # New name of the label + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh licenses] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh org list] [ + --limit(-L): text # Maximum number of organizations to list (default 30) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh pr lock] [ + pr?: by "nu-complete gh prs" [repo: --repo] # Number, URL or branch of the pull request + --reason(-r): words ["off_topic" "resolved" "spam" "too_heated"] # Optional reason for locking conversation (off_topic, resolved, spam, too_heated). + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh pr revert] [ + pr-merged?: by "nu-complete gh prs-merged" [repo: --repo] # Number or URL of the merged pull request + --body(-b): text # Body for the revert pull request + --body-file(-F): path # Read body text from file (use "-" to read from standard input) + --draft(-d) # Mark revert pull request as a draft + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --title(-t): text # Title for the revert pull request + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh pr unlock] [ + pr?: by "nu-complete gh prs" [repo: --repo] # Number, URL or branch of the pull request + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh pr update-branch] [ + pr?: by "nu-complete gh prs" [repo: --repo] # Number, URL or branch of the pull request + --rebase # Update PR branch by rebasing on top of latest base branch + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh preview] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh preview prompter] [ + prompt-type?: words ["select" "multi-select" "multi-select-with-search" "input" "password" "confirm" "auth-token" "confirm-deletion" "input-hostname" "markdown-editor"] # Prompt type + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project close] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --undo # Reopen a closed project + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project copy] [ + project?: by "nu-complete gh project-numbers" # Project number + --drafts # Include draft issues when copying + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --source-owner: by "nu-complete gh owners" within gh.list at item.name # Login of the source owner. Use "@me" for the current user. + --target-owner: by "nu-complete gh owners" within gh.list at item.name # Login of the target owner. Use "@me" for the current user. + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --title: text # Title for the new project + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project create] [ + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --title: text # Title for the project + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project delete] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project edit] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --description(-d): text # New description of the project + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --readme: text # New readme for the project + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --title: text # New title for the project + --visibility: words ["PUBLIC" "PRIVATE"] # Change project visibility: {PUBLIC|PRIVATE} + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project field-create] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --data-type: words ["TEXT" "SINGLE_SELECT" "DATE" "NUMBER"] # DataType of the new field.: {TEXT|SINGLE_SELECT|DATE|NUMBER} + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --name: text # Name of the new field + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --single-select-options: text # Options for SINGLE_SELECT data type + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project field-delete] [ + --format: words ["json"] # Output format: {json} + --id: text # ID of the field to delete + --jq(-q): text # Filter JSON output using a jq expression + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project field-list] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --limit(-L): text # Maximum number of fields to fetch (default 30) + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project item-add] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --url: text # URL of the issue or pull request to add to the project + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project item-archive] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --format: words ["json"] # Output format: {json} + --id: text # ID of the item to archive + --jq(-q): text # Filter JSON output using a jq expression + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --undo # Unarchive an item + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project item-create] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --body: text # Body for the draft issue + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --title: text # Title for the draft issue + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project item-delete] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --format: words ["json"] # Output format: {json} + --id: text # ID of the item to delete + --jq(-q): text # Filter JSON output using a jq expression + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project item-edit] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --body: text # Body of the draft issue item + --clear # Remove field value + --date: text # Date value for the field (YYYY-MM-DD) + --field: text # Name of the field to update + --field-id: text # ID of the field to update + --format: words ["json"] # Output format: {json} + --id: text # ID of the item to edit + --iteration-id: text # ID of the iteration value to set on the field + --jq(-q): text # Filter JSON output using a jq expression + --number: text # Number value for the field + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --project-id: text # ID of the project to which the field belongs to + --single-select-option-id: text # ID of the single select option value to set on the field + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --text: text # Text value for the field + --title: text # Title of the draft issue item + --url: text # URL of the issue or pull request whose project item to edit + --value: text # Value to set on the field named by --field + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project item-list] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --field: text # Name of a field to show as an extra column + --field-id: text # ID of a field to show as an extra column + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --limit(-L): text # Maximum number of items to fetch (default 30) + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user + --query: text # Filter items using the Projects filter syntax, e.g. "assignee:octocat -status:Done" + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project link] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # The repository to be linked to this project + --team(-T): text # The team to be linked to this project + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project list] [ + --closed # Include closed projects + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --limit(-L): text # Maximum number of projects to fetch (default 30) + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open projects list in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project mark-template] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the org owner. + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --undo # Unmark the project as a template. + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project unlink] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # The repository to be unlinked from this project + --team(-T): text # The team to be unlinked from this project + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh project view] [ + project?: by "nu-complete gh project-numbers" [owner: --owner] # Project number + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner. Use "@me" for the current user. + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open a project in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh release delete-asset] [ + release?: by "nu-complete gh releases" [repo: --repo] # Release tag + release-asset?: by "nu-complete gh release-assets" [tag: release] # Asset name + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --yes(-y) # Skip the confirmation prompt + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh release edit] [ + release?: by "nu-complete gh releases" [repo: --repo] # Release tag + --discussion-category: text # Start a discussion in the specified category when publishing a draft + --draft # Save the release as a draft instead of publishing it + --latest # Explicitly mark the release as "Latest" + --notes(-n): text # Release notes + --notes-file(-F): path # Read release notes from file (use "-" to read from standard input) + --prerelease # Mark the release as a prerelease + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --tag: text # The name of the tag + --target: by "nu-complete gh branches" [repo: --repo] # Target branch or full commit SHA (default [main branch]) + --title(-t): text # Release title + --verify-tag # Abort in case the git tag doesn't already exist in the remote repository + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh release verify] [ + release?: by "nu-complete gh releases" [repo: --repo] # Release tag + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh release verify-asset] [ + release?: by "nu-complete gh releases" [repo: --repo] # Release tag + file?: path # File + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo archive] [ + repo?: by "nu-complete gh repos" # Repository as [HOST/]OWNER/REPO + --yes(-y) # Skip the confirmation prompt + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo autolink] [ + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo autolink create] [ + --numeric(-n) # Mark autolink as numeric + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo autolink delete] [ + autolink?: by "nu-complete gh autolinks" [repo: --repo] # Autolink ID + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --yes # Confirm deletion without prompting + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo autolink list] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields repo autolink list" within gh.list at item.name # Output JSON with the specified fields + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # List autolink references in the web browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo autolink view] [ + autolink?: by "nu-complete gh autolinks" [repo: --repo] # Autolink ID + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields repo autolink view" within gh.list at item.name # Output JSON with the specified fields + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo deploy-key] [ + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo deploy-key add] [ + file?: path # File + --allow-write(-w) # Allow write access for the key + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --title(-t): text # Title of the new key + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo deploy-key delete] [ + deploy-key?: by "nu-complete gh deploy-keys" [repo: --repo] # Deploy key ID + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo deploy-key list] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields repo deploy-key list" within gh.list at item.name # Output JSON with the specified fields + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo gitignore] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo gitignore list] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo gitignore view] [ + gitignore?: by "nu-complete gh gitignores" # Gitignore template + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo license] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo license list] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo license view] [ + license?: by "nu-complete gh licenses" # License key + --web(-w) # Open https://choosealicense.com/ in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo read-dir] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields repo read-dir" within gh.list at item.name # Output JSON with the specified fields + --ref: by "nu-complete gh branches" [repo: --repo] # The branch, tag, or commit to list from + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo read-file] [ + --allow-escape-sequences # Allow printing terminal escape sequences + --clobber # Overwrite the output path if it already exists + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields repo read-file" within gh.list at item.name # Output JSON with the specified fields + --output(-o): path # Write the file to a path instead of stdout + --ref: by "nu-complete gh branches" [repo: --repo] # The branch, tag, or commit to read from + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo rename] [ + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --yes(-y) # Skip the confirmation prompt + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo set-default] [ + repo?: by "nu-complete gh repos" # Repository as [HOST/]OWNER/REPO + --unset(-u) # Unset the current default repository + --view(-v) # View the current default repository + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh repo unarchive] [ + repo?: by "nu-complete gh repos" # Repository as [HOST/]OWNER/REPO + --yes(-y) # Skip the confirmation prompt + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh ruleset check] [ + branch?: by "nu-complete gh branches" [repo: --repo] # Branch + --default # Check rules on default branch + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --web(-w) # Open the branch rules page in a web browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh ruleset list] [ + --limit(-L): text # Maximum number of rulesets to list (default 30) + --org(-o): by "nu-complete gh orgs" # List organization-wide rulesets for the provided organization + --parents(-p) # Whether to include rulesets configured at higher levels that also apply (default true) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --web(-w) # Open the list of rulesets in the web browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh ruleset view] [ + ruleset?: by "nu-complete gh rulesets" [repo: --repo] # Ruleset ID + --org(-o): by "nu-complete gh orgs" # Organization name if the provided ID is an organization-level ruleset + --parents(-p) # Whether to include rulesets configured at higher levels that also apply (default true) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --web(-w) # Open the ruleset in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh run delete] [ + run?: by "nu-complete gh runs" [repo: --repo] # Workflow run ID + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} -const GH_SCOPES = [ - repo repo:status repo_deployment public_repo repo:invite security_events - admin:repo_hook write:repo_hook read:repo_hook admin:org write:org read:org - admin:public_key write:public_key read:public_key admin:org_hook gist notifications - user read:user user:email user:follow project read:project delete_repo - write:packages read:packages delete:packages admin:gpg_key write:gpg_key read:gpg_key - codespace workflow admin:ssh_signing_key write:ssh_signing_key read:ssh_signing_key - copilot audit_log read:audit_log admin:enterprise manage_runners:enterprise - manage_billing:enterprise read:enterprise +export complete [gh secret delete] [ + secret?: by "nu-complete gh secrets" [repo: --repo] # Secret name + --app(-a): words ["actions" "agents" "codespaces" "dependabot"] # Delete a secret for a specific application: {actions|agents|codespaces|dependabot} + --env(-e): by "nu-complete gh environments" [repo: --repo] # Delete a secret for an environment + --org(-o): by "nu-complete gh orgs" # Delete a secret for an organization + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --user(-u) # Delete a secret for your user + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh skill] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh skill install] [ + --agent: text # Target agent (see supported values above) + --all # Install all skills without prompting for skill selection + --allow-hidden-dirs # Include skills in hidden directories (e.g. .claude/skills/, .agents/skills/) + --dir: text # Install to a custom directory (overrides --agent and --scope) + --force(-f) # Overwrite existing skills without prompting + --from-local # Treat the argument as a local directory path instead of a repository + --pin: text # Pin to a specific git tag or commit SHA + --scope: words ["project" "user"] # Installation scope: {project|user} (default "project") + --upstream # Install from the upstream source when a re-published skill is detected + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh skill list] [ + --agent: words ["github-copilot" "claude-code" "cursor" "codex" "gemini-cli" "antigravity" "antigravity-cli" "antigravity2.0" "adal" "amp" "augment" "bob" "cline" "codebuddy" "command-code" "continue" "cortex" "crush" "deepagents" "devin" "droid" "firebender" "goose" "grok" "iflow-cli" "junie" "kilo" "kimi-cli" "kiro-cli" "kode" "mcpjam" "mistral-vibe" "mux" "neovate" "openclaw" "opencode" "openhands" "pi" "pochi" "qoder" "qwen-code" "replit" "roo" "trae" "trae-cn" "universal" "warp" "zencoder"] # Filter by target agent: {github-copilot|claude-code|cursor|codex|gemini-cli|antigravity|antigravity-cli|antigravity2.0|adal|amp|augment|bob|cline|codebuddy|command-code|continue|cortex|crush|deepagents|devin|droid|firebender|goose|grok|iflow-cli|junie|kilo|kimi-cli|kiro-cli|kode|mcpjam|mistral-vibe|mux|neovate|openclaw|opencode|openhands|pi|pochi|qoder|qwen-code|replit|roo|trae|trae-cn|universal|warp|zencoder} + --dir: text # Scan a custom directory for installed skills + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields skill list" within gh.list at item.name # Output JSON with the specified fields + --scope: words ["project" "user"] # Filter by installation scope: {project|user} + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh skill preview] [ + --allow-hidden-dirs # Include skills in hidden directories (e.g. .claude/skills/, .agents/skills/) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh skill publish] [ + file?: path # File + --dry-run # Validate without publishing + --fix # Auto-fix issues where possible without publishing (e.g. strip install metadata) + --tag: text # Version tag for the release (e.g. v1.0.0) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh skill search] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields skill search" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of results per page (default 15) + --owner: by "nu-complete gh owners" within gh.list at item.name # Filter results to a specific GitHub user or organization + --page: text # Page number of results to fetch (default 1) + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh skill update] [ + ...skill: by "nu-complete gh skills" # Skill name + --all # Update all skills without prompting + --dir: text # Scan a custom directory for installed skills + --dry-run # Report available updates without modifying files + --force # Re-download even if already up to date + --unpin # Clear pinned version and include pinned skills in update + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh ssh-key add] [ + file?: path # File + --title(-t): text # Title for the new key + --type: words ["authentication" "signing"] # Type of the ssh key: {authentication|signing} (default "authentication") + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh ssh-key delete] [ + ssh-key?: by "nu-complete gh ssh-keys" # SSH key ID + --yes(-y) # Skip the confirmation prompt + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh ssh-key list] [ + --help # Show help for command +] where { + terminal [--help] +} + +# --- Command aliases gh accepts (`gh pr co`, `gh cs`) ----------------------------------- + +export complete [gh agent-tasks] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agent-tasks create] [ + --base(-b): by "nu-complete gh branches" [repo: --repo] # Base branch for the pull request (use default branch if not provided) + --custom-agent(-a): text # Use a custom agent for the task. e.g., use 'my-agent' for the 'my-agent.md' agent + --follow # Follow agent session logs + --from-file(-F): path # Read task description from file (use "-" to read from standard input) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agent-tasks list] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields agent-task list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of agent tasks to fetch (default 30) + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open agent tasks in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agent-tasks view] [ + pr?: by "nu-complete gh prs" [repo: --repo] # Number, URL or branch of the pull request + --follow # Follow agent session logs + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields agent-task view" within gh.list at item.name # Output JSON with the specified fields + --log # Show agent session logs + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open agent task in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agent] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agent create] [ + --base(-b): by "nu-complete gh branches" [repo: --repo] # Base branch for the pull request (use default branch if not provided) + --custom-agent(-a): text # Use a custom agent for the task. e.g., use 'my-agent' for the 'my-agent.md' agent + --follow # Follow agent session logs + --from-file(-F): path # Read task description from file (use "-" to read from standard input) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agent list] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields agent-task list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of agent tasks to fetch (default 30) + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open agent tasks in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agent view] [ + pr?: by "nu-complete gh prs" [repo: --repo] # Number, URL or branch of the pull request + --follow # Follow agent session logs + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields agent-task view" within gh.list at item.name # Output JSON with the specified fields + --log # Show agent session logs + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open agent task in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agents] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agents create] [ + --base(-b): by "nu-complete gh branches" [repo: --repo] # Base branch for the pull request (use default branch if not provided) + --custom-agent(-a): text # Use a custom agent for the task. e.g., use 'my-agent' for the 'my-agent.md' agent + --follow # Follow agent session logs + --from-file(-F): path # Read task description from file (use "-" to read from standard input) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agents list] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields agent-task list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of agent tasks to fetch (default 30) + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open agent tasks in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh agents view] [ + pr?: by "nu-complete gh prs" [repo: --repo] # Number, URL or branch of the pull request + --follow # Follow agent session logs + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields agent-task view" within gh.list at item.name # Output JSON with the specified fields + --log # Show agent session logs + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open agent task in the browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh at] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh at download] [ + file?: path # File + --digest-alg(-d): words ["sha256" "sha512"] # The algorithm used to compute a digest of the artifact: {sha256|sha512} (default "sha256") + --hostname: by "nu-complete gh hosts" # Configure host to use + --limit(-L): text # Maximum number of attestations to fetch (default 30) + --owner(-o): by "nu-complete gh owners" within gh.list at item.name # GitHub organization to scope attestation lookup by + --predicate-type: text # Filter attestations by provided predicate type + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Repository name in the format / + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh at trusted-root] [ + --hostname: by "nu-complete gh hosts" # Configure host to use + --tuf-root: text # Path to the TUF root.json file on disk + --tuf-url: text # URL to the TUF repository mirror + --verify-only # Don't output trusted_root.jsonl contents + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh at verify] [ + file?: path # File + --bundle(-b): text # Path to bundle on disk, either a single bundle in a JSON file or a JSON lines file with multiple bundles + --bundle-from-oci # When verifying an OCI image, fetch the attestation bundle from the OCI registry instead of from GitHub + --cert-identity: text # Enforce that the certificate's SubjectAlternativeName matches the provided value exactly + --cert-identity-regex(-i): text # Enforce that the certificate's SubjectAlternativeName matches the provided regex + --cert-oidc-issuer: text # Enforce that the issuer of the OIDC token matches the provided value (default "https://token.actions.githubusercontent.com") + --custom-trusted-root: text # Path to a trusted_root.jsonl file; likely for offline verification + --deny-self-hosted-runners # Fail verification for attestations generated on self-hosted runners + --digest-alg(-d): words ["sha256" "sha512"] # The algorithm used to compute a digest of the artifact: {sha256|sha512} (default "sha256") + --format: words ["json"] # Output format: {json} + --hostname: by "nu-complete gh hosts" # Configure host to use + --jq(-q): text # Filter JSON output using a jq expression + --limit(-L): text # Maximum number of attestations to fetch (default 30) + --no-public-good # Do not verify attestations signed with Sigstore public good instance + --owner(-o): by "nu-complete gh owners" within gh.list at item.name # GitHub organization to scope attestation lookup by + --predicate-type: text # Enforce that verified attestations' predicate type matches the provided value (default "https://slsa.dev/provenance/v1") + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Repository name in the format / + --signer-digest: text # Enforce that the digest associated with the signer workflow matches the provided value + --signer-repo: by "nu-complete gh repos" within gh.list at item.name # Enforce that the workflow that signed the attestation's repository matches the provided value (/) + --signer-workflow: text # Enforce that the workflow that signed the attestation matches the provided value ([host/]////) + --source-digest: text # Enforce that the digest associated with the source repository matches the provided value + --source-ref: text # Enforce that the git ref associated with the source repository matches the provided value + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs] [ + --help # Show help for command ] -const GH_EVENTS = [ - branch_protection_rule check_run check_suite create delete deployment - deployment_status discussion discussion_comment fork gollum issue_comment issues - label merge_group milestone page_build public pull_request pull_request_review - pull_request_review_comment pull_request_target push registry_package release - repository_dispatch schedule status watch workflow_call workflow_dispatch workflow_run +export complete [gh cs code] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --insiders # Use the insiders version of Visual Studio Code + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --web(-w) # Use the web version of Visual Studio Code + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs cp] [ + ...file: path # File + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --expand(-e) # Expand remote file names on remote shell + --profile(-p): text # Name of the SSH profile to use + --recursive(-r) # Recursively copy directories + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs create] [ + --branch(-b): by "nu-complete gh branches" [repo: --repo] # Repository branch + --default-permissions # Do not prompt to accept additional permissions requested by the codespace + --devcontainer-path: text # Path to the devcontainer.json file to use when creating codespace + --display-name(-d): text # Display name for the codespace (48 characters or less) + --idle-timeout: text # Allowed inactivity before codespace is stopped, e.g. "10m", "1h" + --location(-l): words ["EastUs" "SouthEastAsia" "WestEurope" "WestUs2"] # Location: {EastUs|SouthEastAsia|WestEurope|WestUs2} (determined automatically if not provided) + --machine(-m): text # Hardware specifications for the VM + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Repository name with owner: user/repo + --retention-period: text # Allowed time after shutting down before the codespace is automatically deleted (maximum 30 days), e.g. "1h", "72h" + --status(-s) # Show status of post-create command and dotfiles + --web(-w) # Create codespace from browser, cannot be used with --display-name, --idle-timeout, or --retention-period + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs delete] [ + --all # Delete all codespaces + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --days: text # Delete codespaces older than N days + --force(-f) # Skip confirmation for codespaces that contain unsaved changes + --org(-o): by "nu-complete gh orgs" # The login handle of the organization (admin-only) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --user(-u): text # The username to delete codespaces for (used with --org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs edit] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --display-name(-d): text # Set the display name + --machine(-m): text # Set hardware specifications for the VM + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs jupyter] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs list] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields codespace list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of codespaces to list (default 30) + --org(-o): by "nu-complete gh orgs" # The login handle of the organization to list codespaces for (admin-only) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Repository name with owner: user/repo + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --user(-u): text # The username to list codespaces for (used with --org) + --web(-w) # List codespaces in the web browser, cannot be used with --user or --org + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs logs] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --follow(-f) # Tail and follow the logs + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs ports] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields codespace ports" within gh.list at item.name # Output JSON with the specified fields + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs ports forward] [ + --all-interfaces # Listen on all network interfaces + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs ports visibility] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs rebuild] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --full # Perform a full rebuild + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs ssh] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --config # Write OpenSSH configuration to stdout + --debug(-d) # Log debug data to a file + --debug-file: text # Path of the file log to + --profile: text # Name of the SSH profile to use + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --server-port: text # SSH server port number (0 => pick unused) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs stop] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --org(-o): by "nu-complete gh orgs" # The login handle of the organization (admin-only) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --user(-u): text # The username to stop codespace for (used with --org) + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh cs view] [ + --codespace(-c): by "nu-complete gh codespaces" # Name of the codespace + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields codespace view" within gh.list at item.name # Output JSON with the specified fields + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Filter codespace selection by repository name (user/repo) + --repo-owner: by "nu-complete gh owners" within gh.list at item.name # Filter codespace selection by repository owner (username or org) + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extensions] [ + --help # Show help for command ] -const GH_PROMPT_TYPES = [ - select multi-select multi-select-with-search input password confirm auth-token - confirm-deletion input-hostname markdown-editor +export complete [gh extensions browse] [ + --debug # Log to /tmp/extBrowse-* + --single-column(-s) # Render TUI with only one column of text + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extensions create] [ + --precompiled: words ["go" "other"] # Create a precompiled extension. Possible values: go, other + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extensions exec] [ + extension?: by "nu-complete gh extensions" # Extension name + ...none: text # Argument + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extensions install] [ + --force # Force upgrade extension, or ignore if latest already installed + --pin: text # Pin extension to a release tag or commit ref + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extensions list] [ + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extensions remove] [ + extension?: by "nu-complete gh extensions" # Extension name + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extensions search] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields extension search" within gh.list at item.name # Output JSON with the specified fields + --license: by "nu-complete gh licenses" within gh.list at item.name # Filter based on license type + --limit(-L): text # Maximum number of extensions to fetch (default 30) + --order: words ["asc" "desc"] # Order of repositories returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc") + --owner: by "nu-complete gh owners" within gh.list at item.name # Filter on owner + --sort: words ["forks" "help-wanted-issues" "stars" "updated"] # Sort fetched repositories: {forks|help-wanted-issues|stars|updated} (default "best-match") + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open the search query in the web browser + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh extensions upgrade] [ + extension?: by "nu-complete gh extensions" # Extension name + --all # Upgrade all extensions + --dry-run # Only display upgrades + --force # Force upgrade extension + --help # Show help for command +] where { + terminal [--help] +} + +export complete [gh ext] [ + --help # Show help for command ] -# A completion value that Nushell parses back to the same string, so it is quoted -# only when it is not a plain word (spaces, globs, leading dash, octal-looking ints). -def gh-bare [text: string]: nothing -> bool { - ($text =~ '^[\w@./:+=,%][\w@./:+=,%-]*$') and ($text !~ '^0[0-9xob]') and $text != 'null' -} - -# Completion records for rows of {value, description}. With `--multi`, the text up to -# the last comma of the current word is kept, for flags that take comma-separated lists. -def gh-items [token: record, --multi]: list -> record { - let text = $token.text? | default '' | str trim -c '"' | str trim -c "'" - let prefix = if $multi { $text | str replace -r '[^,]*$' '' } else { '' } - let completions = $in | each {|row| - let full = $"($prefix)($row.value)" - let description = $row.description? | default '' - if (gh-bare $full) { - {value: $full, description: $description} - } else { - {value: ($full | to nuon), display_override: $full, description: $description} - } - } - {options: {sort: false, case_sensitive: false}, completions: $completions} +export complete [gh ext browse] [ + --debug # Log to /tmp/extBrowse-* + --single-column(-s) # Render TUI with only one column of text + --help # Show help for command +] where { + terminal [--help] } -def gh-rows [description: string = '']: list -> list { - each {|value| {value: $value, description: $description} } +export complete [gh ext create] [ + --precompiled: words ["go" "other"] # Create a precompiled extension. Possible values: go, other + --help # Show help for command +] where { + terminal [--help] } -# Words of the command line up to (but excluding) the word under the cursor. The first -# entry of `place.command` is the resolved command name, e.g. `gh pr view`. -def gh-words [place: record]: nothing -> list { - let command = $place.command? | default [] - if ($command | is-empty) { return [] } - $command.0 | split row ' ' | append ($command | skip 1 | drop 1) - | each {|word| $word | str trim -c '"' | str trim -c "'" } +export complete [gh ext exec] [ + extension?: by "nu-complete gh extensions" # Extension name + ...none: text # Argument + --help # Show help for command +] where { + terminal [--help] } -# Value of the last occurrence of one of `names` (`--repo x`, `--repo=x`, `-R x`, `-Rx`). -def gh-flag-value [words: list, names: list]: nothing -> any { - $words | enumerate | each {|it| - $names | each {|name| - if $it.item == $name { - $words | get -o ($it.index + 1) - } else if ($name | str starts-with '--') and ($it.item | str starts-with $"($name)=") { - $it.item | str substring (($name | str length) + 1).. - } else if ($name =~ '^-\w$') and ($it.item | str starts-with $name) and ($it.item | str length) > 2 { - $it.item | str substring 2.. - } - } - } | flatten | compact | last +export complete [gh ext install] [ + --force # Force upgrade extension, or ignore if latest already installed + --pin: text # Pin extension to a release tag or commit ref + --help # Show help for command +] where { + terminal [--help] } -# Run gh for a completer. Returns null instead of failing when gh is missing, the -# directory is not a repository, the user is signed out, or the network is down. -const GH_QUIET_ENV = {GH_PROMPT_DISABLED: '1', GH_NO_UPDATE_NOTIFIER: '1', NO_COLOR: '1'} +export complete [gh ext list] [ + --help # Show help for command +] where { + terminal [--help] +} -def gh-run [words: list, args: list]: nothing -> any { - let repo = gh-flag-value $words [--repo -R] - let env_vars = $GH_QUIET_ENV | merge (if $repo == null { {} } else { {GH_REPO: $repo} }) - let result = try { with-env $env_vars { '' | ^gh ...$args | complete } } catch { return null } - if $result.exit_code != 0 { return null } - $result.stdout +export complete [gh ext remove] [ + extension?: by "nu-complete gh extensions" # Extension name + --help # Show help for command +] where { + terminal [--help] } -def gh-json [words: list, args: list]: nothing -> any { - let out = gh-run $words $args - if $out == null { return null } - try { $out | from json } catch { null } +export complete [gh ext search] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields extension search" within gh.list at item.name # Output JSON with the specified fields + --license: by "nu-complete gh licenses" within gh.list at item.name # Filter based on license type + --limit(-L): text # Maximum number of extensions to fetch (default 30) + --order: words ["asc" "desc"] # Order of repositories returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc") + --owner: by "nu-complete gh owners" within gh.list at item.name # Filter on owner + --sort: words ["forks" "help-wanted-issues" "stars" "updated"] # Sort fetched repositories: {forks|help-wanted-issues|stars|updated} (default "best-match") + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open the search query in the web browser + --help # Show help for command +] where { + terminal [--help] } -# A cached `gh api` call; `{owner}`/`{repo}` follow `-R` on the line or the current repo. -def gh-api [words: list, ttl: string, endpoint: string, jq: string]: nothing -> list { - gh-json $words [api --cache $ttl $endpoint --jq $jq] | default [] +export complete [gh ext upgrade] [ + extension?: by "nu-complete gh extensions" # Extension name + --all # Upgrade all extensions + --dry-run # Only display upgrades + --force # Force upgrade extension + --help # Show help for command +] where { + terminal [--help] } -def --wrapped gh-git-lines [...args: string]: nothing -> list { - let result = try { ^git ...$args | complete } catch { return [] } - if $result.exit_code != 0 { return [] } - $result.stdout | lines +export complete [gh rs] [ + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] + +export complete [gh rs check] [ + branch?: by "nu-complete gh branches" [repo: --repo] # Branch + --default # Check rules on default branch + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --web(-w) # Open the branch rules page in a web browser + --help # Show help for command +] where { + terminal [--help] } -# Directory that holds gh's config.yml and hosts.yml. -def gh-config-dir []: nothing -> path { - if ($env.GH_CONFIG_DIR? | is-not-empty) { return $env.GH_CONFIG_DIR } - if ($env.XDG_CONFIG_HOME? | is-not-empty) { return ($env.XDG_CONFIG_HOME | path join gh) } - if $nu.os-info.name == 'windows' and ($env.AppData? | is-not-empty) { - return ($env.AppData | path join 'GitHub CLI') - } - $nu.home-dir | path join .config gh +export complete [gh rs list] [ + --limit(-L): text # Maximum number of rulesets to list (default 30) + --org(-o): by "nu-complete gh orgs" # List organization-wide rulesets for the provided organization + --parents(-p) # Whether to include rulesets configured at higher levels that also apply (default true) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --web(-w) # Open the list of rulesets in the web browser + --help # Show help for command +] where { + terminal [--help] } -def gh-hosts-file []: nothing -> record { - let file = gh-config-dir | path join hosts.yml - if not ($file | path exists) { return {} } - try { open --raw $file | from yaml | default {} } catch { {} } -} - -# Command rows of GH_COMMANDS: {path, kinds, desc}. -def gh-commands []: nothing -> table { - $GH_COMMANDS | lines | where $it != '' | split column "\t" path kinds desc -} - -# Flag rows of GH_FLAGS for one command: {long, short, kind, completer, desc}. -def gh-flags [path: string]: nothing -> table { - $GH_FLAGS | lines | where {|line| $line starts-with $"($path)\t" } - | split column "\t" path long short kind completer desc -} - -# The command path (with aliases resolved) and its spec, from the words on the line. -def gh-spec [words: list, commands?: table]: nothing -> record { - let commands = if $commands == null { gh-commands } else { $commands } - let aliases = $GH_ALIASES | lines | where $it != '' | split column "\t" alias path - mut path = '' - mut used = 0 - for word in ($words | skip 1) { - if $word !~ '^[a-z][a-z0-9-]*$' { break } - let candidate = [$path $word] | where $it != '' | str join ' ' - let canonical = if $candidate in $commands.path { $candidate } else { $aliases | where alias == $candidate | get -o 0.path } - if $canonical == null { break } - $path = $canonical - $used += 1 - } - let path = $path - let row = $commands | where path == $path | get -o 0 - let flags = gh-flags $path - let valued = $flags | where kind != b | each {|f| [$"--($f.long)"] | append (if $f.short != '' { [$"-($f.short)"] } else { [] }) } | flatten - { - path: $path, rest: ($words | skip ($used + 1)), flags: $flags, valued: $valued - pos: ($row.kinds? | default '' | split row ' ' | where $it != ''), desc: ($row.desc? | default '') - } +export complete [gh rs view] [ + ruleset?: by "nu-complete gh rulesets" [repo: --repo] # Ruleset ID + --org(-o): by "nu-complete gh orgs" # Organization name if the provided ID is an organization-level ruleset + --parents(-p) # Whether to include rulesets configured at higher levels that also apply (default true) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --web(-w) # Open the ruleset in the browser + --help # Show help for command +] where { + terminal [--help] } -# Positional words after the command path, and whether `--` was seen. -def gh-positionals [spec: record]: nothing -> record { - mut positionals = [] - mut skip_value = false - mut after_dashes = false - for word in $spec.rest { - if $skip_value { $skip_value = false; continue } - if not $after_dashes and $word == '--' { $after_dashes = true; continue } - if not $after_dashes and ($word | str starts-with '-') and $word != '-' { - if $word in $spec.valued { $skip_value = true } - continue - } - $positionals = $positionals | append $word - } - {words: $positionals, after_dashes: $after_dashes} +export complete [gh skills] [ + --help # Show help for command +] where { + terminal [--help] } -def gh-kind [spec: record, index: int]: nothing -> string { - let pos = $spec.pos - if $index < ($pos | length) { return ($pos | get $index | str replace '...' '') } - let last = $pos | last - if $last != null and ($last | str ends-with '...') { $last | str replace '...' '' } else { 'none' } +export complete [gh skills install] [ + --agent: text # Target agent (see supported values above) + --all # Install all skills without prompting for skill selection + --allow-hidden-dirs # Include skills in hidden directories (e.g. .claude/skills/, .agents/skills/) + --dir: text # Install to a custom directory (overrides --agent and --scope) + --force(-f) # Overwrite existing skills without prompting + --from-local # Treat the argument as a local directory path instead of a repository + --pin: text # Pin to a specific git tag or commit SHA + --scope: words ["project" "user"] # Installation scope: {project|user} (default "project") + --upstream # Install from the upstream source when a re-published skill is detected + --help # Show help for command +] where { + terminal [--help] } -# Flag names of a command, for a word that starts with `-`. -def gh-flag-rows [spec: record]: nothing -> list { - $spec.flags | each {|flag| - [{value: $"--($flag.long)", description: $flag.desc}] - | append (if $flag.short != '' { [{value: $"-($flag.short)", description: $flag.desc}] } else { [] }) - } | flatten | append {value: '--help', description: 'Show help for command'} +export complete [gh skills list] [ + --agent: words ["github-copilot" "claude-code" "cursor" "codex" "gemini-cli" "antigravity" "antigravity-cli" "antigravity2.0" "adal" "amp" "augment" "bob" "cline" "codebuddy" "command-code" "continue" "cortex" "crush" "deepagents" "devin" "droid" "firebender" "goose" "grok" "iflow-cli" "junie" "kilo" "kimi-cli" "kiro-cli" "kode" "mcpjam" "mistral-vibe" "mux" "neovate" "openclaw" "opencode" "openhands" "pi" "pochi" "qoder" "qwen-code" "replit" "roo" "trae" "trae-cn" "universal" "warp" "zencoder"] # Filter by target agent: {github-copilot|claude-code|cursor|codex|gemini-cli|antigravity|antigravity-cli|antigravity2.0|adal|amp|augment|bob|cline|codebuddy|command-code|continue|cortex|crush|deepagents|devin|droid|firebender|goose|grok|iflow-cli|junie|kilo|kimi-cli|kiro-cli|kode|mcpjam|mistral-vibe|mux|neovate|openclaw|opencode|openhands|pi|pochi|qoder|qwen-code|replit|roo|trae|trae-cn|universal|warp|zencoder} + --dir: text # Scan a custom directory for installed skills + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields skill list" within gh.list at item.name # Output JSON with the specified fields + --scope: words ["project" "user"] # Filter by installation scope: {project|user} + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] } -def gh-prs [words: list, state: string]: nothing -> list { - let query = if $state == 'open' { 'open' } else { 'closed' } - let jq = '[.[] | {number, title, branch: .head.ref, author: .user.login, merged: (.merged_at != null)}]' - gh-api $words 1m $"repos/{owner}/{repo}/pulls?state=($query)&sort=updated&direction=desc&per_page=50" $jq - | where {|pr| $state == 'open' or ($pr.merged == ($state == 'merged')) } - | each {|pr| {value: $"($pr.number)", description: $"($pr.title) [($pr.branch)] by ($pr.author)"} } +export complete [gh skills preview] [ + --allow-hidden-dirs # Include skills in hidden directories (e.g. .claude/skills/, .agents/skills/) + --help # Show help for command +] where { + terminal [--help] } -def gh-issues [words: list, state: string]: nothing -> list { - let jq = '[.[] | select(.pull_request == null) | {number, title, author: .user.login}]' - gh-api $words 1m $"repos/{owner}/{repo}/issues?state=($state)&sort=updated&direction=desc&per_page=50" $jq - | each {|issue| {value: $"($issue.number)", description: $"($issue.title) by ($issue.author)"} } +export complete [gh skills publish] [ + file?: path # File + --dry-run # Validate without publishing + --fix # Auto-fix issues where possible without publishing (e.g. strip install metadata) + --tag: text # Version tag for the release (e.g. v1.0.0) + --help # Show help for command +] where { + terminal [--help] } -def gh-repos []: nothing -> list { - let remotes = gh-git-lines remote --verbose - | parse -r '^(?\S+)\s+\S*github\.com[:/](?[^/\s]+/[^/\s]+?)(?:\.git)?/?\s' - | uniq-by repo - | each {|it| {value: $it.repo, description: $"git remote ($it.remote)"} } - let mine = gh-api [] 1h 'user/repos?per_page=100&sort=pushed' '[.[] | {name: .full_name, description}]' - | each {|repo| {value: $repo.name, description: ($repo.description | default '')} } - $remotes | append $mine | uniq-by value +export complete [gh skills search] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields skill search" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of results per page (default 15) + --owner: by "nu-complete gh owners" within gh.list at item.name # Filter results to a specific GitHub user or organization + --page: text # Page number of results to fetch (default 1) + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] } -def gh-branches [words: list]: nothing -> list { - if (gh-flag-value $words [--repo -R]) == null { - let local = gh-git-lines for-each-ref '--format=%(refname:lstrip=2)' refs/heads - let remote = gh-git-lines for-each-ref '--format=%(refname:lstrip=3)' refs/remotes | where $it != 'HEAD' - let branches = $local | append $remote | uniq - if ($branches | is-not-empty) { return $branches } - } - gh-api $words 10m 'repos/{owner}/{repo}/branches?per_page=100' '[.[].name]' +export complete [gh skills update] [ + ...skill: by "nu-complete gh skills" # Skill name + --all # Update all skills without prompting + --dir: text # Scan a custom directory for installed skills + --dry-run # Report available updates without modifying files + --force # Re-download even if already up to date + --unpin # Clear pinned version and include pinned skills in update + --help # Show help for command +] where { + terminal [--help] } -def gh-orgs []: nothing -> list { - gh-api [] 1h 'user/orgs?per_page=100' '[.[] | {login, description}]' - | each {|org| {value: $org.login, description: ($org.description | default 'Organization')} } +export complete [gh alias ls] [ + --help # Show help for command +] where { + terminal [--help] } -def gh-positional [words: list, index: int]: nothing -> any { - gh-positionals (gh-spec $words) | get words | get -o $index +export complete [gh cache ls] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields cache list" within gh.list at item.name # Output JSON with the specified fields + --key(-k): text # Filter by cache key prefix + --limit(-L): text # Maximum number of caches to fetch (default 30) + --order(-O): words [asc desc] # Order of caches returned + --ref(-r): by "nu-complete gh cache-refs" [repo: --repo] # Filter by ref, as refs/heads/ or refs/pull//merge + --sort(-S): words [created_at last_accessed_at size_in_bytes] # Sort fetched caches + --template(-t): text # Format JSON output using a Go template + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] } -def gh-labels [words: list]: nothing -> list { - gh-api $words 10m 'repos/{owner}/{repo}/labels?per_page=100' '[.[] | {name, description}]' - | each {|label| {value: $label.name, description: ($label.description | default '')} } +export complete [gh codespace ls] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields codespace list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of codespaces to list (default 30) + --org(-o): by "nu-complete gh orgs" # The login handle of the organization to list codespaces for (admin-only) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Repository name with owner: user/repo + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --user(-u): text # The username to list codespaces for (used with --org) + --web(-w) # List codespaces in the web browser, cannot be used with --user or --org + --help # Show help for command +] where { + terminal [--help] } -def gh-releases [words: list]: nothing -> list { - let jq = '[.[] | {tag: .tag_name, name, draft, prerelease}]' - gh-api $words 10m 'repos/{owner}/{repo}/releases?per_page=50' $jq - | each {|release| - let kind = if $release.draft { ' (draft)' } else if $release.prerelease { ' (pre-release)' } else { '' } - {value: $release.tag, description: $"($release.name | default '')($kind)"} - } +export complete [gh cs ls] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields codespace list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of codespaces to list (default 30) + --org(-o): by "nu-complete gh orgs" # The login handle of the organization to list codespaces for (admin-only) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Repository name with owner: user/repo + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --user(-u): text # The username to list codespaces for (used with --org) + --web(-w) # List codespaces in the web browser, cannot be used with --user or --org + --help # Show help for command +] where { + terminal [--help] } -def gh-gist-files [words: list]: nothing -> list { - let gist = gh-positional $words 0 - if $gist == null { return [] } - let id = $gist | split row / | last - gh-api [] 10m $"gists/($id)" '[.files[] | {filename, language}]' - | each {|file| {value: $file.filename, description: ($file.language | default 'File')} } +export complete [gh config ls] [ + --host(-h): by "nu-complete gh hosts" # Get per-host configuration + --help # Show help for command +] where { + terminal [--help] } -# REST endpoint listing secrets or variables for the scope selected on the line -# (`--org`, `--env`, `--user`, `--app`), like `gh secret list` would. -def gh-secrets-endpoint [words: list, what: string]: nothing -> string { - let org = gh-flag-value $words [--org -o] - let env_name = gh-flag-value $words [--env -e] - let app = gh-flag-value $words [--app -a] | default actions - if $org != null { return $"orgs/($org)/($app)/($what)?per_page=100" } - if $env_name != null { return $"repos/{owner}/{repo}/environments/($env_name | url encode)/($what)?per_page=100" } - if $what == 'secrets' and ([--user -u] | any {|flag| $flag in $words }) { - return 'user/codespaces/secrets?per_page=100' - } - $"repos/{owner}/{repo}/($app)/($what)?per_page=100" +export complete [gh discussion ls] [ + --after: text # Cursor for the next page of results + --answered # Filter by answered state + --author(-A): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by author + --category(-c): text # Filter by category name or slug + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields discussion list" within gh.list at item.name # Output JSON with the specified fields + --label(-l): by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Filter by label + --limit(-L): text # Maximum number of discussions to fetch (default 30) + --order: words ["asc" "desc"] # Order of results: {asc|desc} (default "desc") + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --search(-S): text # Search discussions with query + --sort: words ["created" "updated"] # Sort by field: {created|updated} (default "updated") + --state(-s): words ["open" "closed" "all"] # Filter by state: {open|closed|all} (default "open") + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # List discussions in the web browser + --help # Show help for command +] where { + terminal [--help] } -def gh-run-id [words: list]: nothing -> any { - gh-positional $words 0 | default (gh-flag-value $words [--run-id]) +export complete [gh ext ls] [ + --help # Show help for command +] where { + terminal [--help] } -def gh-skill-names []: nothing -> list { - gh-json [] [skill list --json 'skillName,scope'] | default [] - | each {|skill| {value: $skill.skillName, description: $"Skill \(($skill.scope)\)"} } - | uniq-by value +export complete [gh extension ls] [ + --help # Show help for command +] where { + terminal [--help] } -def gh-config-keys []: nothing -> list { - gh-run [] [config --help] | default '' - | lines - | parse -r '^- `(?[^`]+)`: (?.*)$' +export complete [gh extensions ls] [ + --help # Show help for command +] where { + terminal [--help] } -def gh-help-commands [first?: string]: nothing -> list { - let commands = gh-commands | where path != '' and path != 'help' - if $first == null { - $commands | where path !~ ' ' | each {|c| {value: $c.path, description: $c.desc} } | append $GH_HELP_TOPICS - } else { - $commands | where {|c| $c.path starts-with $"($first) " } | each {|c| $c.path | split row ' ' | get 1 } - | uniq | gh-rows Subcommand - } +export complete [gh ext uninstall] [ + extension?: by "nu-complete gh extensions" # Extension name + --help # Show help for command +] where { + terminal [--help] } -# User aliases from gh's config.yml (`gh alias set`), as {name: expansion}. -def gh-user-aliases []: nothing -> record { - let file = gh-config-dir | path join config.yml - if not ($file | path exists) { return {} } - try { open --raw $file | from yaml | get -o aliases | default {} } catch { {} } +export complete [gh extension uninstall] [ + extension?: by "nu-complete gh extensions" # Extension name + --help # Show help for command +] where { + terminal [--help] } -# Installed extensions, from gh's data directory (`gh extension list` would cost a gh start). -def gh-extensions []: nothing -> list { - let base = if ($env.XDG_DATA_HOME? | is-not-empty) { - $env.XDG_DATA_HOME | path join gh - } else if $nu.os-info.name == 'windows' and ($env.LocalAppData? | is-not-empty) { - $env.LocalAppData | path join 'GitHub CLI' - } else { - $nu.home-dir | path join .local share gh - } - let dir = $base | path join extensions - if not ($dir | path exists) { return [] } - ls $dir | where type in [dir symlink] | get name | path basename | where $it starts-with 'gh-' | str replace 'gh-' '' -} - -# Replace a leading user alias with what it stands for (`gh co 12` -> `gh pr checkout 12`). -# A `!` alias runs a shell command; only a `gh ` inside it is followed. -def gh-expand-alias [words: list, commands: table]: nothing -> list { - let aliases = gh-user-aliases - mut words = $words - for _ in 1..8 { - let name = $words | get -o 1 - if $name == null or ($name in $commands.path) { break } - let value = $aliases | get -o $name - if $value == null { break } - let expansion = if ($value starts-with '!') { - let parts = $value | str substring 1.. | split row -r '\s+' - let start = $parts | enumerate | where item == gh | get -o 0.index - if $start == null { [] } else { $parts | skip ($start + 1) | take until {|w| $w in [';' '&&' '||' '|'] } } - } else { - $value | split row -r '\s+' | where $it != '' - } - let expansion = $expansion | where $it !~ '^\$' - if ($expansion | is-empty) { break } - $words = [gh] | append $expansion | append ($words | skip 2) - } - $words -} - -# Completions for one positional slot kind. -def gh-complete-kind [kind: string, words: list]: nothing -> any { - match $kind { - none => [] - file => null - gh-command => { - let aliases = gh-user-aliases | transpose value description - | update description {|it| $"Alias for ($it.description)" } - let extensions = gh-extensions | each {|name| {value: $name, description: 'Extension'} } - $aliases | append $extensions - } - pr => (gh-prs $words open) - pr-closed => (gh-prs $words closed) - pr-merged => (gh-prs $words merged) - issue => (gh-issues $words open) - issue-closed => (gh-issues $words closed) - repo => (gh-repos) - branch => (gh-branches $words | gh-rows Branch) - owner => { - let me = gh-api [] 1h user '[.login]' | gh-rows 'You' - $me | append (gh-orgs) - } - release => (gh-releases $words) - release-asset => { - let tag = gh-positional $words 0 - if $tag == null { return [] } - gh-api $words 10m $"repos/{owner}/{repo}/releases/tags/($tag | url encode)" '[.assets[] | {name, size}]' - | each {|asset| {value: $asset.name, description: $"($asset.size | into filesize)"} } - } - workflow => { - gh-api $words 10m 'repos/{owner}/{repo}/actions/workflows?per_page=100' '[.workflows[] | {name, path, state}]' - | each {|wf| {value: ($wf.path | path basename), description: $"($wf.name) \(($wf.state)\)"} } - } - run => { - let jq = '[.workflow_runs[] | {id, name, title: .display_title, status, conclusion, branch: .head_branch}]' - gh-api $words 1m 'repos/{owner}/{repo}/actions/runs?per_page=30' $jq - | each {|run| {value: $"($run.id)", description: $"($run.name): ($run.title) [($run.branch)] ($run.conclusion | default $run.status)"} } - } - cache => { - gh-api $words 1m 'repos/{owner}/{repo}/actions/caches?per_page=100' '[.actions_caches[] | {id, key, ref}]' - | each {|cache| {value: $"($cache.id)", description: $"($cache.key) \(($cache.ref)\)"} } - } - gist => { - gh-api [] 5m 'gists?per_page=100' '[.[] | {id, description, files: (.files | keys)}]' - | each {|gist| {value: $gist.id, description: ($gist.description | default ($gist.files | str join ', '))} } - } - gist-file => (gh-gist-files $words) - secret => { - let endpoint = gh-secrets-endpoint $words secrets - gh-api $words 1m $endpoint '[.secrets[] | {name, updated_at}]' - | each {|secret| {value: $secret.name, description: $"Updated ($secret.updated_at)"} } - } - variable => { - let endpoint = gh-secrets-endpoint $words variables - gh-api $words 1m $endpoint '[.variables[] | {name, value}]' - | each {|var| {value: $var.name, description: $var.value} } - } - label => (gh-labels $words) - alias => (gh-user-aliases | transpose value description) - extension => (gh-extensions | gh-rows Extension) - skill => (gh-skill-names) - ssh-key => { - gh-api [] 10m 'user/keys?per_page=100' '[.[] | {id, title}]' - | each {|key| {value: $"($key.id)", description: $key.title} } - } - gpg-key => { - gh-api [] 10m 'user/gpg_keys?per_page=100' '[.[] | {key_id, emails: [.emails[].email]}]' - | each {|key| {value: $key.key_id, description: ($key.emails | str join ', ')} } - } - ruleset => { - gh-api $words 10m 'repos/{owner}/{repo}/rulesets?per_page=100' '[.[] | {id, name, enforcement}]' - | each {|rule| {value: $"($rule.id)", description: $"($rule.name) \(($rule.enforcement)\)"} } - } - deploy-key => { - gh-api $words 10m 'repos/{owner}/{repo}/keys?per_page=100' '[.[] | {id, title}]' - | each {|key| {value: $"($key.id)", description: $key.title} } - } - autolink => { - gh-api $words 10m 'repos/{owner}/{repo}/autolinks' '[.[] | {id, key_prefix, url_template}]' - | each {|link| {value: $"($link.id)", description: $"($link.key_prefix) -> ($link.url_template)"} } - } - project => { - let owner = gh-flag-value $words [--owner] | default '@me' - gh-json [] [project list --owner $owner --format json --limit 50] | default {projects: []} - | get projects | each {|project| {value: $"($project.number)", description: $project.title} } - } - discussion => { - let query = 'query($owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { discussions(first: 50, orderBy: {field: UPDATED_AT, direction: DESC}) { nodes { number title } } } }' - gh-json $words [api --cache 5m graphql -F 'owner={owner}' -F 'repo={repo}' -f $"query=($query)" --jq '.data.repository.discussions.nodes'] - | default [] | each {|d| {value: $"($d.number)", description: $d.title} } - } - gitignore => (gh-api [] 24h gitignore/templates '.' | gh-rows Template) - license => { - gh-api [] 24h licenses '[.[] | {key, name}]' | each {|lic| {value: $lic.key, description: $lic.name} } - } - config-key => (gh-config-keys) - config-value => { - let key = gh-positional $words 0 - gh-config-keys | where value == $key | get -o 0.description | default '' - | parse -r '`\{(?[^}]+)\}`' | get -o 0.values | default '' - | split row '|' | str trim | where $it != '' | gh-rows - } - help-topic => (gh-help-commands) - help-subcommand => (gh-help-commands (gh-positional $words 0)) - prompt-type => ($GH_PROMPT_TYPES | gh-rows 'Prompt type') - api-endpoint => $GH_API_ENDPOINTS - _ => [] - } +export complete [gh extensions uninstall] [ + extension?: by "nu-complete gh extensions" # Extension name + --help # Show help for command +] where { + terminal [--help] } -# The value of a flag (`--label `, `--label=`): its completer or fixed values. -def gh-flag-value-rows [flag: record, token: record, place: record]: nothing -> any { - if $flag.kind == f { return null } - let source = $flag.completer - if ($source | str starts-with '=') { - return ($source | str substring 1.. | split row '|' | gh-rows | gh-items $token) - } - match $source { - '' => [] - repos => (nu-complete gh repos $token) - json-fields => (nu-complete gh json-fields $token $place) - labels => (nu-complete gh labels $token $place) - users => (nu-complete gh users $token $place) - me => (nu-complete gh me $token) - milestones => (nu-complete gh milestones $token $place) - branches => (nu-complete gh branches $token $place) - cache-refs => (nu-complete gh cache-refs $token $place) - workflows => (nu-complete gh workflows $token $place) - orgs => (nu-complete gh orgs $token) - owners => (nu-complete gh owners $token) - hosts => (nu-complete gh hosts $token) - accounts => (nu-complete gh accounts $token) - codespaces => (nu-complete gh codespaces $token) - environments => (nu-complete gh environments $token $place) - projects => (nu-complete gh projects $token $place) - scopes => (nu-complete gh scopes $token) - gitignores => (nu-complete gh gitignores $token) - licenses => (nu-complete gh licenses $token) - issues => (nu-complete gh issues $token $place) - issue-templates => (nu-complete gh issue-templates $token) - run-jobs => (nu-complete gh run-jobs $token $place) - artifacts => (nu-complete gh artifacts $token $place) - gist-files => (nu-complete gh gist-files $token $place) - releases => (nu-complete gh releases $token $place) - commits => (nu-complete gh commits $token) - repo-topics => (nu-complete gh repo-topics $token $place) - events => (nu-complete gh events $token) - http-methods => (nu-complete gh http-methods $token) - api-headers => (nu-complete gh api-headers $token) - close-reasons => (nu-complete gh close-reasons $token) - lock-reasons => (nu-complete gh lock-reasons $token) - archive-formats => (nu-complete gh archive-formats $token) - _ => [] - } +export complete [gh gist new] [ + ...files: path # Files to add, or "-" for stdin + --desc(-d): text # A description for this gist + --filename(-f): text # Provide a filename to be used when reading from standard input + --public(-p) # List the gist publicly (default "secret") + --web(-w) # Open the web browser with created gist + --help # Show help for command +] where { + terminal [--help] } -# Prefix completion values with `--flag=` (quoting again where needed). -def gh-prefixed [prefix: string]: any -> any { - let out = $in - if $out == null { return null } - let rows = if ($out | describe | str starts-with 'record') { $out.completions } else { $out } - let rows = $rows | each {|row| - let text = $"($prefix)($row.display_override? | default $row.value)" - if (gh-bare $text) { {value: $text, description: ($row.description? | default '')} } else { - {value: ($text | to nuon), display_override: $text, description: ($row.description? | default '')} - } - } - {options: {sort: false, case_sensitive: false}, completions: $rows} -} - -# Completions for everything after `gh`. -def "nu-complete gh" [token: record, place: record] { - let commands = gh-commands - let words = gh-expand-alias (gh-words $place) $commands - let spec = gh-spec $words $commands - let text = $token.text - # `place` for the completers: the resolved command followed by its arguments. - let inner = {command: ([$"gh ($spec.path)" | str trim] | append $spec.rest | append $text)} - let positionals = gh-positionals $spec - # The cursor is where a subcommand goes. - let children = $commands | where {|c| $c.path =~ $'^($spec.path | str replace -a '-' '\-') ?[a-z0-9-]+$' and $c.path != $spec.path and ($c.path | split row ' ' | length) == (($spec.path | split row ' ' | where $it != '' | length) + 1) } - if ($children | is-not-empty) and ($spec.rest | is-empty) and not ($text starts-with '-') { - let rows = $children | each {|c| {value: ($c.path | split row ' ' | last), description: $c.desc} } - let extra = if $spec.path == '' { gh-complete-kind gh-command $words } else { [] } - return ($rows | append $extra | gh-items $token) - } - if ($text starts-with '-') { - if $positionals.after_dashes { return null } - let eq = $text | parse --regex '^(?--[^=]+)=(?.*)$' | get -o 0 - if $eq != null { - let flag = $spec.flags | where long == ($eq.flag | str substring 2..) | get -o 0 - if $flag == null or $flag.kind == b { return [] } - return (gh-flag-value-rows $flag ($token | update text $eq.rest) $inner | gh-prefixed $"($eq.flag)=") - } - return (gh-flag-rows $spec) - } - if $positionals.after_dashes { return null } - # The value of the flag just before the cursor. - let prev = $spec.rest | last - if $prev in $spec.valued { - let flag = $spec.flags | where {|f| $"--($f.long)" == $prev or ($f.short != '' and $"-($f.short)" == $prev) } | get 0 - return (gh-flag-value-rows $flag $token $inner) - } - let rows = gh-complete-kind (gh-kind $spec ($positionals.words | length)) $words - if $rows == null { return null } - $rows | gh-items $token +export complete [gh gist ls] [ + --filter: text # Filter gists using a regular expression + --include-content # Include gists' file content when filtering + --limit(-L): text # Maximum number of gists to fetch (default 10) + --public # Show only public gists + --secret # Show only secret gists + --help # Show help for command +] where { + at-most-one [--public --secret] + requires --include-content --filter + terminal [--help] } -def "nu-complete gh json-fields" [token: record, place: record] { - let spec = gh-spec (gh-words $place) - # gh lists the fields on stderr when `--json` has no value; it needs no network for that. - let result = try { with-env $GH_QUIET_ENV { '' | ^gh ...($spec.path | split row ' ') --json | complete } } catch { return [] } - $result.stderr | lines | skip 1 | str trim | where $it != '' | gh-rows Field | gh-items $token --multi +export complete [gh gpg-key ls] [ + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh repos" [token: record] { gh-repos | gh-items $token --multi } +export complete [gh issue new] [ + --assignee(-a): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Assign people by their login; "@me" self-assigns + --attach: path # Attach an image or video file + --blocked-by: by "nu-complete gh issues" [repo: --repo] within gh.list at item.name # Mark the new issue as blocked by these issue numbers or URLs + --blocking: by "nu-complete gh issues" [repo: --repo] within gh.list at item.name # Mark the new issue as blocking these issue numbers or URLs + --body(-b): text # Supply a body + --body-file(-F): path # Read body text from file ("-" for stdin) + --editor(-e) # Open the text editor to write the title and body + --label(-l): by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Add labels by name + --milestone(-m): by "nu-complete gh milestones" [repo: --repo] # Add the issue to a milestone by name + --parent: by "nu-complete gh issues" # Add the new issue as a sub-issue of this parent + --project(-p): by "nu-complete gh projects" [repo: --repo] within gh.list at item.name # Add the issue to projects by title + --recover: path # Recover input from a failed run of create + --template(-T): by "nu-complete gh issue-templates" # Template name to use as starting body text + --title(-t): text # Supply a title + --type: text # Set the issue type by name + --web(-w) # Open the browser to create an issue + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--body --body-file] + at-most-one [--editor --web] + terminal [--help] +} -def "nu-complete gh labels" [token: record, place: record] { - gh-labels (gh-words $place) | gh-items $token --multi +export complete [gh issue ls] [ + --app: text # Filter by GitHub App author + --assignee(-a): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by assignee + --author(-A): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by author + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields issue list" within gh.list at item.name # Output JSON with the specified fields + --label(-l): by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Filter by label + --limit(-L): text # Maximum number of issues to fetch (default 30) + --mention: by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by mention + --milestone(-m): by "nu-complete gh milestones" [repo: --repo] # Filter by milestone number or title + --search(-S): text # Search issues with query + --state(-s): words [open closed all] # Filter by state + --template(-t): text # Format JSON output using a Go template + --type: text # Filter by issue type name + --web(-w) # List issues in the web browser + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] } -def "nu-complete gh users" [token: record, place: record] { - let users = gh-api (gh-words $place) 10m 'repos/{owner}/{repo}/assignees?per_page=100' '[.[].login]' - ['@me'] | append $users | gh-rows User | gh-items $token --multi +export complete [gh label ls] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields label list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of labels to fetch (default 30) + --order: words [asc desc] # Order of labels returned + --search(-S): text # Search label names and descriptions + --sort: words [created name] # Sort fetched labels + --template(-t): text # Format JSON output using a Go template + --web(-w) # List labels in the web browser + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] } -def "nu-complete gh me" [token: record] { ['@me'] | gh-rows 'The authenticated user' | gh-items $token } +export complete [gh org ls] [ + --limit(-L): text # Maximum number of organizations to list (default 30) + --help # Show help for command +] where { + terminal [--help] +} -def "nu-complete gh milestones" [token: record, place: record] { - gh-api (gh-words $place) 10m 'repos/{owner}/{repo}/milestones?state=all&per_page=100' '[.[] | {title, state, due_on}]' - | each {|m| {value: $m.title, description: $"($m.state) ($m.due_on | default '')"} } - | gh-items $token +export complete [gh pr co] [ + pr?: by "nu-complete gh prs" # Number, URL or branch of the pull request + --branch(-b): text # Local branch name to use + --detach # Checkout PR with a detached HEAD + --force(-f) # Reset the existing local branch to the latest state of the pull request + --recurse-submodules # Update all submodules after checkout + --worktree: dir # Check out the pull request into a worktree at the given path + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--branch --detach] + terminal [--help] } -def "nu-complete gh branches" [token: record, place: record] { - gh-branches (gh-words $place) | gh-rows Branch | gh-items $token +export complete [gh pr new] [ + --assignee(-a): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Assign people by their login; "@me" self-assigns + --attach: path # Attach an image or video file + --base(-B): by "nu-complete gh branches" [repo: --repo] # The branch into which you want your code merged + --body(-b): text # Body for the pull request + --body-file(-F): path # Read body text from file ("-" for stdin) + --draft(-d) # Mark pull request as a draft + --dry-run # Print details instead of creating the PR + --editor(-e) # Open the text editor to write the title and body + --fill(-f) # Use commit info for title and body + --fill-first # Use first commit info for title and body + --fill-verbose # Use commits msg+body for description + --head(-H): by "nu-complete gh branches" [repo: --repo] # The branch that contains commits for your pull request + --label(-l): by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Add labels by name + --milestone(-m): by "nu-complete gh milestones" [repo: --repo] # Add the pull request to a milestone by name + --no-maintainer-edit # Disable maintainer's ability to modify pull request + --project(-p): by "nu-complete gh projects" [repo: --repo] within gh.list at item.name # Add the pull request to projects by title + --recover: path # Recover input from a failed run of create + --reviewer(-r): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Request reviews from people or teams by their handle + --template(-T): path # Template file to use as starting body text + --title(-t): text # Title for the pull request + --web(-w) # Open the web browser to create a pull request + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--fill --fill-first --fill-verbose] + excludes --fill --title + excludes --fill --body + at-most-one [--body --body-file] + at-most-one [--draft --web] + at-most-one [--editor --web] + at-most-one [--dry-run --web] + terminal [--help] } -def "nu-complete gh cache-refs" [token: record, place: record] { - gh-branches (gh-words $place) | each {|b| $"refs/heads/($b)" } | gh-rows Ref | gh-items $token +export complete [gh pr ls] [ + --app: text # Filter by GitHub App author + --assignee(-a): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by assignee + --author(-A): by "nu-complete gh users" [repo: --repo] within gh.list at item.name # Filter by author + --base(-B): by "nu-complete gh branches" [repo: --repo] # Filter by base branch + --draft(-d) # Filter by draft state + --head(-H): by "nu-complete gh branches" [repo: --repo] # Filter by head branch + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields pr list" within gh.list at item.name # Output JSON with the specified fields + --label(-l): by "nu-complete gh labels" [repo: --repo] within gh.list at item.name # Filter by label + --limit(-L): text # Maximum number of items to fetch (default 30) + --search(-S): text # Search pull requests with query + --state(-s): words [open closed merged all] # Filter by state + --template(-t): text # Format JSON output using a Go template + --web(-w) # List pull requests in the web browser + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + at-most-one [--web --json] + terminal [--help] } -def "nu-complete gh workflows" [token: record, place: record] { - gh-complete-kind workflow (gh-words $place) | gh-items $token +export complete [gh project ls] [ + --closed # Include closed projects + --format: words ["json"] # Output format: {json} + --jq(-q): text # Filter JSON output using a jq expression + --limit(-L): text # Maximum number of projects to fetch (default 30) + --owner: by "nu-complete gh owners" within gh.list at item.name # Login of the owner + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # Open projects list in the browser + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh orgs" [token: record] { gh-orgs | gh-items $token } +export complete [gh release new] [ + tag?: text # The tag to release + ...files: path # Asset files or patterns to upload + --discussion-category: text # Start a discussion in the specified category + --draft(-d) # Save the release as a draft instead of publishing it + --fail-on-no-commits # Fail if there are no commits since the last release + --generate-notes # Automatically generate title and notes for the release + --latest?: words [true false] # Mark this release as "Latest" + --notes(-n): text # Release notes + --notes-file(-F): path # Read release notes from file ("-" for stdin) + --notes-from-tag # Fetch notes from the tag annotation or message of commit associated with tag + --notes-start-tag: by "nu-complete gh releases" # Tag to use as the starting point for generating release notes + --prerelease(-p) # Mark the release as a prerelease + --target: by "nu-complete gh branches" [repo: --repo] # Target branch or full commit SHA (default [main branch]) + --title(-t): text # Release title + --verify-tag # Abort in case the git tag doesn't already exist in the remote repository + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--notes --notes-file --notes-from-tag] + excludes --notes-from-tag --generate-notes + requires --notes-start-tag --generate-notes + terminal [--help] +} -def "nu-complete gh owners" [token: record] { - [{value: '@me', description: 'The authenticated user'}] | append (gh-orgs) | gh-items $token --multi +export complete [gh release ls] [ + --exclude-drafts # Exclude draft releases + --exclude-pre-releases # Exclude pre-releases + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields release list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of items to fetch (default 30) + --order(-O): words [asc desc] # Order of releases returned + --template(-t): text # Format JSON output using a Go template + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] } -def "nu-complete gh hosts" [token: record] { - gh-hosts-file | columns | append github.com | uniq | gh-rows Host | gh-items $token +export complete [gh repo new] [ + name?: text # Name of the new repository, optionally OWNER/REPO + --add-readme # Add a README file to the new repository + --clone(-c) # Clone the new repository to the current directory + --description(-d): text # Description of the repository + --disable-issues # Disable issues in the new repository + --disable-wiki # Disable wiki in the new repository + --gitignore(-g): by "nu-complete gh gitignores" # Specify a gitignore template for the repository + --homepage(-h): text # Repository home page URL + --include-all-branches # Include all branches from template repository + --internal # Make the new repository internal + --license(-l): by "nu-complete gh licenses" # Specify an Open Source License for the repository + --private # Make the new repository private + --public # Make the new repository public + --push # Push local commits to the new repository + --remote(-r): text # Specify remote name for the new repository + --source(-s): dir # Specify path to local repository to use as source + --team(-t): text # The name of the organization team to be granted access + --template(-p): by "nu-complete gh repos" # Make the new repository based on a template repository + --help # Show help for command +] where { + at-most-one [--public --private --internal] + at-most-one [--clone --source] + requires --push --source + requires --remote --source + requires --include-all-branches --template + excludes --template --gitignore + excludes --template --license + excludes --template --add-readme + terminal [--help] } -def "nu-complete gh accounts" [token: record] { - gh-hosts-file | items {|host, conf| - $conf.users? | default {} | columns | each {|user| {value: $user, description: $host} } - } | flatten | gh-items $token +export complete [gh repo ls] [ + owner?: by "nu-complete gh owners" # List repositories of this owner + --archived # Show only archived repositories + --fork # Show only forks + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields repo list" within gh.list at item.name # Output JSON with the specified fields + --language(-l): text # Filter by primary coding language + --limit(-L): text # Maximum number of repositories to list (default 30) + --no-archived # Omit archived repositories + --source # Show only non-forks + --template(-t): text # Format JSON output using a Go template + --topic: text # Filter by topic + --visibility: words [public private internal] # Filter by repository visibility + --help # Show help for command +] where { + at-most-one [--archived --no-archived] + at-most-one [--fork --source] + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] } -def "nu-complete gh codespaces" [token: record] { - gh-api [] 1m 'user/codespaces?per_page=100' '[.codespaces[] | {name, display_name, repo: .repository.full_name, state}]' - | each {|cs| {value: $cs.name, description: $"($cs.display_name) ($cs.repo) \(($cs.state)\)"} } - | gh-items $token +export complete [gh rs ls] [ + --limit(-L): text # Maximum number of rulesets to list (default 30) + --org(-o): by "nu-complete gh orgs" # List organization-wide rulesets for the provided organization + --parents(-p) # Whether to include rulesets configured at higher levels that also apply (default true) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --web(-w) # Open the list of rulesets in the web browser + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh environments" [token: record, place: record] { - gh-api (gh-words $place) 10m 'repos/{owner}/{repo}/environments' '[.environments[].name]' - | gh-rows Environment | gh-items $token +export complete [gh ruleset ls] [ + --limit(-L): text # Maximum number of rulesets to list (default 30) + --org(-o): by "nu-complete gh orgs" # List organization-wide rulesets for the provided organization + --parents(-p) # Whether to include rulesets configured at higher levels that also apply (default true) + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --web(-w) # Open the list of rulesets in the web browser + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh projects" [token: record, place: record] { - let query = 'query($owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { projectsV2(first: 50) { nodes { title number } } } }' - gh-json (gh-words $place) [api --cache 10m graphql -F 'owner={owner}' -F 'repo={repo}' -f $"query=($query)" --jq '.data.repository.projectsV2.nodes'] - | default [] | each {|p| {value: $p.title, description: $"Project ($p.number)"} } - | gh-items $token --multi +export complete [gh run ls] [ + --all(-a) # Include disabled workflows + --branch(-b): by "nu-complete gh branches" [repo: --repo] # Filter runs by branch + --commit(-c): by "nu-complete gh commits" # Filter runs by the SHA of the commit + --created: text # Filter runs by the date it was created + --event(-e): words [push pull_request pull_request_target workflow_dispatch schedule release workflow_run merge_group issues issue_comment "branch_protection_rule" "check_run" "check_suite" "create" "delete" "deployment" "deployment_status" "discussion" "discussion_comment" "fork" "gollum" "label" "milestone" "page_build" "public" "pull_request_review" "pull_request_review_comment" "registry_package" "repository_dispatch" "status" "watch" "workflow_call"] # Filter runs by which event triggered the run + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields run list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of runs to fetch (default 20) + --status(-s): words [queued completed in_progress requested waiting pending action_required cancelled failure neutral skipped stale startup_failure success timed_out] # Filter runs by status + --template(-t): text # Format JSON output using a Go template + --user(-u): text # Filter runs by user who triggered the run + --workflow(-w): by "nu-complete gh workflows" # Filter runs by workflow + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] } -def "nu-complete gh scopes" [token: record] { $GH_SCOPES | gh-rows Scope | gh-items $token --multi } +export complete [gh secret remove] [ + secret?: by "nu-complete gh secrets" [repo: --repo] # Secret name + --app(-a): words ["actions" "agents" "codespaces" "dependabot"] # Delete a secret for a specific application: {actions|agents|codespaces|dependabot} + --env(-e): by "nu-complete gh environments" [repo: --repo] # Delete a secret for an environment + --org(-o): by "nu-complete gh orgs" # Delete a secret for an organization + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --user(-u) # Delete a secret for your user + --help # Show help for command +] where { + terminal [--help] +} -def "nu-complete gh gitignores" [token: record] { - gh-complete-kind gitignore [] | gh-items $token +export complete [gh secret ls] [ + --app(-a): words [actions agents codespaces dependabot] # List secrets for a specific application + --env(-e): by "nu-complete gh environments" [repo: --repo] # List secrets for an environment + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields secret list" within gh.list at item.name # Output JSON with the specified fields + --org(-o): by "nu-complete gh orgs" # List secrets for an organization + --template(-t): text # Format JSON output using a Go template + --user(-u) # List a secret for your user + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--org --env --user] + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] } -def "nu-complete gh licenses" [token: record] { - gh-complete-kind license [] | gh-items $token --multi +export complete [gh skill add] [ + --agent: text # Target agent (see supported values above) + --all # Install all skills without prompting for skill selection + --allow-hidden-dirs # Include skills in hidden directories (e.g. .claude/skills/, .agents/skills/) + --dir: text # Install to a custom directory (overrides --agent and --scope) + --force(-f) # Overwrite existing skills without prompting + --from-local # Treat the argument as a local directory path instead of a repository + --pin: text # Pin to a specific git tag or commit SHA + --scope: words ["project" "user"] # Installation scope: {project|user} (default "project") + --upstream # Install from the upstream source when a re-published skill is detected + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh issues" [token: record, place: record] { - gh-issues (gh-words $place) open | gh-items $token --multi +export complete [gh skills add] [ + --agent: text # Target agent (see supported values above) + --all # Install all skills without prompting for skill selection + --allow-hidden-dirs # Include skills in hidden directories (e.g. .claude/skills/, .agents/skills/) + --dir: text # Install to a custom directory (overrides --agent and --scope) + --force(-f) # Overwrite existing skills without prompting + --from-local # Treat the argument as a local directory path instead of a repository + --pin: text # Pin to a specific git tag or commit SHA + --scope: words ["project" "user"] # Installation scope: {project|user} (default "project") + --upstream # Install from the upstream source when a re-published skill is detected + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh issue-templates" [token: record] { - let root = gh-git-lines rev-parse --show-toplevel | get -o 0 - if $root == null { return [] } - let dir = $root | path join .github ISSUE_TEMPLATE - if not ($dir | path exists) { return [] } - ls $dir | where type == 'file' | get name - | where {|f| ($f | path parse | get extension) in [md yml yaml] and ($f | path basename) != 'config.yml' } - | each {|f| open --raw $f | lines | where $it =~ '^name:' | get -o 0 } - | compact | str replace -r '^name:\s*' '' | str trim -c '"' | str trim -c "'" - | gh-rows 'Issue template' | gh-items $token +export complete [gh skill ls] [ + --agent: words ["github-copilot" "claude-code" "cursor" "codex" "gemini-cli" "antigravity" "antigravity-cli" "antigravity2.0" "adal" "amp" "augment" "bob" "cline" "codebuddy" "command-code" "continue" "cortex" "crush" "deepagents" "devin" "droid" "firebender" "goose" "grok" "iflow-cli" "junie" "kilo" "kimi-cli" "kiro-cli" "kode" "mcpjam" "mistral-vibe" "mux" "neovate" "openclaw" "opencode" "openhands" "pi" "pochi" "qoder" "qwen-code" "replit" "roo" "trae" "trae-cn" "universal" "warp" "zencoder"] # Filter by target agent: {github-copilot|claude-code|cursor|codex|gemini-cli|antigravity|antigravity-cli|antigravity2.0|adal|amp|augment|bob|cline|codebuddy|command-code|continue|cortex|crush|deepagents|devin|droid|firebender|goose|grok|iflow-cli|junie|kilo|kimi-cli|kiro-cli|kode|mcpjam|mistral-vibe|mux|neovate|openclaw|opencode|openhands|pi|pochi|qoder|qwen-code|replit|roo|trae|trae-cn|universal|warp|zencoder} + --dir: text # Scan a custom directory for installed skills + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields skill list" within gh.list at item.name # Output JSON with the specified fields + --scope: words ["project" "user"] # Filter by installation scope: {project|user} + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh run-jobs" [token: record, place: record] { - let words = gh-words $place - let run = gh-run-id $words - if $run == null { return [] } - gh-api $words 1m $"repos/{owner}/{repo}/actions/runs/($run)/jobs?per_page=100" '[.jobs[] | {id, name, conclusion, status}]' - | each {|job| {value: $"($job.id)", description: $"($job.name) ($job.conclusion | default $job.status)"} } - | gh-items $token +export complete [gh skills ls] [ + --agent: words ["github-copilot" "claude-code" "cursor" "codex" "gemini-cli" "antigravity" "antigravity-cli" "antigravity2.0" "adal" "amp" "augment" "bob" "cline" "codebuddy" "command-code" "continue" "cortex" "crush" "deepagents" "devin" "droid" "firebender" "goose" "grok" "iflow-cli" "junie" "kilo" "kimi-cli" "kiro-cli" "kode" "mcpjam" "mistral-vibe" "mux" "neovate" "openclaw" "opencode" "openhands" "pi" "pochi" "qoder" "qwen-code" "replit" "roo" "trae" "trae-cn" "universal" "warp" "zencoder"] # Filter by target agent: {github-copilot|claude-code|cursor|codex|gemini-cli|antigravity|antigravity-cli|antigravity2.0|adal|amp|augment|bob|cline|codebuddy|command-code|continue|cortex|crush|deepagents|devin|droid|firebender|goose|grok|iflow-cli|junie|kilo|kimi-cli|kiro-cli|kode|mcpjam|mistral-vibe|mux|neovate|openclaw|opencode|openhands|pi|pochi|qoder|qwen-code|replit|roo|trae|trae-cn|universal|warp|zencoder} + --dir: text # Scan a custom directory for installed skills + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields skill list" within gh.list at item.name # Output JSON with the specified fields + --scope: words ["project" "user"] # Filter by installation scope: {project|user} + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh artifacts" [token: record, place: record] { - let words = gh-words $place - let run = gh-run-id $words - let endpoint = if $run == null { - 'repos/{owner}/{repo}/actions/artifacts?per_page=100' - } else { - $"repos/{owner}/{repo}/actions/runs/($run)/artifacts?per_page=100" - } - gh-api $words 1m $endpoint '[.artifacts[].name]' | uniq | gh-rows Artifact | gh-items $token +export complete [gh skill show] [ + --allow-hidden-dirs # Include skills in hidden directories (e.g. .claude/skills/, .agents/skills/) + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh gist-files" [token: record, place: record] { - gh-gist-files (gh-words $place) | gh-items $token +export complete [gh skills show] [ + --allow-hidden-dirs # Include skills in hidden directories (e.g. .claude/skills/, .agents/skills/) + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh releases" [token: record, place: record] { - gh-releases (gh-words $place) | gh-items $token +export complete [gh ssh-key ls] [ + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh commits" [token: record] { - gh-git-lines log -n 50 '--format=%h%x09%s' | split column "\t" value description | gh-items $token +export complete [gh variable remove] [ + name: by "nu-complete gh variables" [repo: --repo] # Name of the variable + --env(-e): by "nu-complete gh environments" [repo: --repo] # Delete a variable for an environment + --org(-o): by "nu-complete gh orgs" # Delete a variable for an organization + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--org --env] + terminal [--help] } -def "nu-complete gh repo-topics" [token: record, place: record] { - let words = gh-words $place - let repo = gh-positional $words 0 - let endpoint = if $repo == null { 'repos/{owner}/{repo}/topics' } else { $"repos/($repo)/topics" } - gh-api $words 10m $endpoint '.names' | gh-rows Topic | gh-items $token --multi +export complete [gh variable ls] [ + --env(-e): by "nu-complete gh environments" [repo: --repo] # List variables for an environment + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields variable list" within gh.list at item.name # Output JSON with the specified fields + --org(-o): by "nu-complete gh orgs" # List variables for an organization + --template(-t): text # Format JSON output using a Go template + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + at-most-one [--org --env] + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] +} + +export complete [gh workflow ls] [ + --all(-a) # Include disabled workflows + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields workflow list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of workflows to fetch (default 50) + --template(-t): text # Format JSON output using a Go template + --repo(-R): by "nu-complete gh repos" # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + requires --jq --json + requires --template --json + at-most-one [--jq --template] + terminal [--help] } -def "nu-complete gh events" [token: record] { $GH_EVENTS | gh-rows Event | gh-items $token } +export complete [gh issue artifact new] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + ...file: path # File + --attach: path # Attach an image or video file, in '#' format + --body(-b): text # Content for a single document + --body-file(-F): path # Read content for a single artifact from file (use "-" to read from standard input) + --name: text # Name for a single artifact + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --type: words ["generic" "plan" "embedded_html"] # Type for documents: {generic|plan|embedded_html} + --help # Show help for command +] where { + terminal [--help] +} -def "nu-complete gh http-methods" [token: record] { - [GET POST PUT PATCH DELETE HEAD] | gh-rows 'HTTP method' | gh-items $token +export complete [gh issue artifact ls] [ + issue?: by "nu-complete gh issues" [repo: --repo] # Number or URL of the issue + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields issue artifact list" within gh.list at item.name # Output JSON with the specified fields + --limit(-L): text # Maximum number of artifacts to fetch + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --type: words ["generic" "plan" "link" "embedded_html"] # Filter by type: {generic|plan|link|embedded_html} + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh api-headers" [token: record] { - ['Accept: application/vnd.github+json' 'Accept: application/vnd.github.raw+json' - 'Accept: application/vnd.github.diff' 'X-GitHub-Api-Version: 2022-11-28'] - | gh-rows Header | gh-items $token +export complete [gh repo autolink new] [ + --numeric(-n) # Mark autolink as numeric + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh close-reasons" [token: record] { - [completed 'not planned' duplicate] | gh-rows Reason | gh-items $token +export complete [gh repo autolink ls] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields repo autolink list" within gh.list at item.name # Output JSON with the specified fields + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --web(-w) # List autolink references in the web browser + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh lock-reasons" [token: record] { - [off_topic resolved spam too_heated] | gh-rows Reason | gh-items $token +export complete [gh repo deploy-key ls] [ + --jq(-q): text # Filter JSON output using a jq expression + --json: by "nu-complete gh json-fields repo deploy-key list" within gh.list at item.name # Output JSON with the specified fields + --repo(-R): by "nu-complete gh repos" within gh.list at item.name # Select another repository using the [HOST/]OWNER/REPO format + --template(-t): text # Format JSON output using a Go template; see "gh help formatting" + --help # Show help for command +] where { + terminal [--help] } -def "nu-complete gh archive-formats" [token: record] { - [zip tar.gz] | gh-rows Format | gh-items $token +export complete [gh repo gitignore ls] [ + --help # Show help for command +] where { + terminal [--help] } +export complete [gh repo license ls] [ + --help # Show help for command +] where { + terminal [--help] +} -export extern "gh" [ - ...args: external_arg@"nu-complete gh" # a gh command or alias, and its arguments -] +# --- Commands ----------------------------------------------------------------------------- -# Review comments of a pull request, with the diff hunk each one is attached to +# The inline review comments of a pull request: who wrote each, the comment and the diff hunk. +@example "Show the inline comments of the current pull request" { gh pr view inlined-comments } +@example "Show those of another pull request" { gh pr view inlined-comments 1105 nushell/nu_scripts } export def "gh pr view inlined-comments" [ - pr?: int # pull request number (default: the pull request of the current branch) - repo?: string # e.g. nushell/nu_scripts (default: the current repository) + pr?: int + repo?: string # e.g. nushell/nu_scripts ] { - let pr = if ($pr == null) { ^gh pr view --json number | from json | get number } else { $pr } - let repo = if ($repo == null) { - ^gh repo view --json name,owner | from json | select owner.login name | rename owner name - } else { - $repo | parse '{owner}/{name}' | get 0 - } + let pr = if ($pr == null) { ^gh pr view --json number | from json | get number } else { $pr } + let repo = if ($repo == null) { + ^gh repo view --json name,owner | from json | select owner.login name | rename owner name + } else { + $repo | parse '{owner}/{name}' | get 0 + } - (^gh api + ( (gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" $"/repos/($repo.owner)/($repo.name)/pulls/($pr)/comments") | from json | select user.login body diff_hunk - | rename user comment diff + | rename user comment diff ) } def "gh get stars" [ - end_cursor: string = "" # endCursor from a previous query - --first: int = 100 # returns the first n elements from the list + end_cursor: string = "" # endCursor from a previous query + --first: int = 100 # returns the first n elements from the list ] { - # https://docs.github.com/en/graphql/reference/objects#user - ^gh api graphql -F $'first=($first)' -F $'endCursor=($end_cursor)' -f query=' - query($first: Int, $endCursor: String!){ - viewer { - starredRepositories(first: $first, after: $endCursor, orderBy: {field: STARRED_AT, direction: DESC}) { - edges { node { url description } starredAt } - pageInfo { hasNextPage endCursor } - } + # https://docs.github.com/en/graphql/reference/objects#user + ^gh api graphql -F $'first=($first)' -F $'endCursor=($end_cursor)' -f query=' + query($first: Int, $endCursor: String!){ + viewer { + starredRepositories(first: $first, after: $endCursor, orderBy: {field: STARRED_AT, direction: DESC}) { + edges { node { url description } starredAt } + pageInfo { hasNextPage endCursor } } } - ' - | from json | select data.viewer.starredRepositories.edges data.viewer.starredRepositories.pageInfo - | rename stars pageInfo + } + ' + | from json | select data.viewer.starredRepositories.edges data.viewer.starredRepositories.pageInfo + | rename stars pageInfo } -# Repositories the authenticated user has starred, oldest star first +# Your starred repositories, oldest star first. +@example "List your starred repositories, most recent last" { gh my stars } export def "gh my stars" [] { - mut stars = [] - mut end_cursor = "" - loop { - let part = gh get stars $end_cursor - $stars = $stars | append $part.stars - if $part.pageInfo?.hasNextPage? == true { - $end_cursor = $part.pageInfo.endCursor - } else { - break - } + mut stars = [] + mut end_cursor = "" + loop { + let part = gh get stars $end_cursor + $stars = $stars | append $part.stars + if $part.pageInfo?.hasNextPage? == true { + $end_cursor = $part.pageInfo.endCursor + } else { + break } - $stars | flatten | update cells { $in | into datetime } starredAt | sort-by starredAt + } + $stars | flatten | update cells { $in | into datetime } starredAt | sort-by starredAt } diff --git a/custom-completions/gh/tests/gh-completions.nu b/custom-completions/gh/tests/gh-completions.nu index c99968f18..057d3c889 100644 --- a/custom-completions/gh/tests/gh-completions.nu +++ b/custom-completions/gh/tests/gh-completions.nu @@ -1,7 +1,8 @@ # Run with `nu custom-completions/gh/tests/gh-completions.nu`. # A fake `gh` on PATH answers the calls the completers make, so no test touches the network. use std/assert -source ../gh-completions.nu +# The module declares its completions with `export complete`, which `use` activates. +use ../gh-completions.nu * const FAKE_GH_BODY = r#' printf "%s|%s\n" "${GH_REPO:-}" "$*" >> "$GH_FAKE_LOG" @@ -46,12 +47,23 @@ def with-fake-gh [test: closure] { } } -# Argument completions for `line`, leaving out subcommand names. +# Completions for `line`, leaving out Nushell's own commands (such as `gh my stars`). The +# subcommands of gh are declared routes, offered as external command names. def values-of [line: string]: nothing -> list { - $line | commandline complete --detailed | where kind? != command + $line | commandline complete --detailed | where {|row| $row.kind? != 'command' or $row.type? == 'external' } | each {|row| $row.display_override? | default $row.value } } +# The word `line` ends with once a completion is accepted. The engine replaces only the part of +# a word it completes (the value after `--opt=`, one item of a comma list), so compare whole words. +def completed [line: string]: nothing -> list { + $line | commandline complete --detailed | each {|row| + let before = $line | str substring ..<($row.span.start) + let start = $before | str index-of --end ' ' + ($before | str substring ($start + 1)..) + $row.value + } +} + def calls [log: string]: nothing -> list { if ($log | path exists) { open --raw $log | lines } else { [] } } @@ -122,7 +134,7 @@ def "labels follow --repo and quote names with spaces" [] { def "json fields come from gh and accept comma lists" [] { with-fake-gh {|log| assert equal (values-of 'gh pr list --json ') ['author' 'number' 'title'] - assert equal (values-of 'gh pr list --json number,ti') ['number,title'] + assert equal (completed 'gh pr list --json number,ti') ['number,title'] } } diff --git a/custom-completions/git/git-completions.nu b/custom-completions/git/git-completions.nu index d0a0fa09d..8c38e1513 100644 --- a/custom-completions/git/git-completions.nu +++ b/custom-completions/git/git-completions.nu @@ -1,16 +1,176 @@ -# nu-version: 0.116.1 +# Declarative completions for git. # -# Completions for git and every git alias in your config. One `git` extern with no declared flags -# hands the whole command line to `nu-complete git`, which -# - skips global options (and completes in the repository `-C`/`--git-dir` point at), -# - expands git aliases (`git co` completes like `git checkout`), -# - reads a builtin's flags from its own `-h` output when you complete a word starting with `-` -# (never for aliases or scripts, which could run anything; see GIT_NO_HELP), -# - completes flag values, subcommands, branches, remotes, tags, commits, stashes, worktrees, -# submodules, config keys and changed files. -# Declaring no flags means nushell passes every argument to git exactly as typed. - -module git-completion-utils { +# The `export complete` declarations describe each route once; the live providers below +# (all `@non-destructive`, all wrapped in `try`/`catch`) supply branches, tags, stashes, +# refs, commits, worktrees and changed paths. `export def` commands such as `git-branches` +# stay user-facing and are reused by the providers. +# +# `git-completion-utils` keeps the line-based completer from the extern version (`nu-complete +# git`: global options, alias expansion, option and argument tables). The root route's +# `...args` uses it to complete the arguments of git aliases. + +# Run git and return its output; fails, without writing git's error over the prompt, when git +# does (outside a repository, for one). Stdin is empty so nothing waits on it. +def --wrapped git-run [...args: string]: nothing -> string { + let result = '' | ^git ...$args | complete + if $result.exit_code != 0 { error make {msg: $"git ($args | first) failed"} } + $result.stdout +} + +const STATUS_DESCRIPTIONS = { + ".D": "Deleted" + ".M": "Modified" + "?": "Untracked" + "AU": "Staged, not merged" + "MD": "Some modifications staged, file deleted in work tree" + "MM": "Some modifications staged, some modifications untracked" + "UU": "Both modified (in merge conflict)" +} + +# Number of space separated fields in each kind of `git status --porcelain=2` entry, path included. +const STATUS_FIELDS = {"1": 9, "2": 10, "u": 11, "?": 2} + +# Paths reported by `git status`, as `{value, code}`: `code` is the XY status, or `?` for untracked. +# `-z` makes the paths literal (no quoting, newlines intact). +@non-destructive +def status-paths [--untracked]: nothing -> table { + git-run --no-optional-locks status (if $untracked { '-uall' } else { '-uno' }) --porcelain=2 -z + | split row "\u{0}" + | where $it != '' + # A renamed/copied entry owns the next NUL field: its original pathname. + | generate {|entry, skip| if $skip { {next: false} } else { {out: $entry, next: ($entry starts-with '2 ')} } } false + | each {|entry| + let fields = $entry | split row --number ($STATUS_FIELDS | get ($entry | str substring ..0)) ' ' + {value: ($fields | last), code: (if $fields.0 == '?' { '?' } else { $fields.1 })} + } +} + +# A path, which Nushell writes as the word that names it. The lazy preview is the file's diff against +# HEAD, or its first lines if it is untracked (`code` is `?`). +def path-suggestion [description: string, code: string]: string -> record { + let path = $in + let preview = if $code == '?' { {|| ^head -n 40 $path | lines } } else { {|| ^git diff --color=always HEAD -- $path | lines } } + {value: $path, description: $description, style: green, preview: $preview} +} + +# Changed files that `git checkout --` can restore; `--unmerged` adds files with conflicts. +@non-destructive +def restorable-files [--unmerged]: nothing -> list { + let pattern = if $unmerged { '^(?:[.MD]{2}|DD|AU|UD|UA|DU|AA|UU)$' } else { '^[.MD]{2}$' } + status-paths | where code =~ $pattern | each {|entry| $entry.value | path-suggestion File $entry.code } +} + +# Preserve fields as data: the completion engine renders them as a table sized +# for its preview pane. Git runs only when this suggestion is selected. +def ref-preview [ref: string] { + {|| + ^git log -5 --format='%h%x09%ar%x09%an%x09%s' --no-color --end-of-options $ref -- + | lines + | split column "\t" commit age author subject + } +} + +# A line count from `git --numstat`, or null where Git counts none (a binary file, `-`). +def count [text: string]: nothing -> any { + if $text == '-' { null } else { $text | into int } +} + +# A commit, tag or stash as data: who made it, when, its subject, and the files it changed with their +# line counts. Git runs only when this suggestion is selected. +def commit-preview [rev: string] { + {|| + let fields = ^git show -s --no-color --format='%h%x00%an%x00%ar%x00%s' --end-of-options $rev -- + | str trim + | split row (char nul) + let files = ^git show --no-color --numstat --format= --end-of-options $rev -- + | lines + | where $it != '' + | split column "\t" added removed file + # Git counts no lines in a binary file, and says `-`. + | each {|f| {file: $f.file, added: (count $f.added), removed: (count $f.removed)} } + {commit: $fields.0, author: $fields.1, age: $fields.2, subject: $fields.3, files: $files} + } +} + +# Local and remote branches, one row each: `name`, `kind` (local or remote), the abbreviated +# `commit` it points at, its `upstream` (empty for none), when it was last `updated`, and the +# `subject` of that commit. Reads only. `git-branches | where name == ` completes the names. +@non-destructive +@example "Names of the local branches" { git-branches | where kind == local | get name } +@example "Branches updated in the last week" { git-branches | where updated > ((date now) - 1wk) } +@example "Remote branches not updated for 30 days" { git-branches | where kind == remote and updated < ((date now) - 30day) | get name } +export def git-branches []: nothing -> table { + git-run for-each-ref --format '%(refname)%09%(refname:lstrip=2)%09%(objectname:short)%09%(upstream:short)%09%(committerdate:iso-strict)%09%(contents:subject)' refs/heads refs/remotes + | lines + | parse "{ref}\t{name}\t{commit}\t{upstream}\t{updated}\t{subject}" + | each {|row| + { + name: $row.name + kind: (if ($row.ref | str starts-with 'refs/heads/') { 'local' } else { 'remote' }) + commit: $row.commit + upstream: $row.upstream + updated: ($row.updated | into datetime) + subject: $row.subject + } + } +} + +# The remotes, one row each: `name` and the fetch `url`. Reads only. +@non-destructive +@example "The URL of origin" { git-remotes | where name == origin | get url.0 } +@example "Names of the remotes" { git-remotes | get name } +export def git-remotes []: nothing -> table { + git-run remote --verbose + | lines + | parse --regex '^(?\S+)\s+(?.+) \((?fetch|push)\)$' + | where direction == fetch + | select name url +} + +# The tags, one row each: `name`, the abbreviated `commit` they lead to, when they were +# `created` and the `subject` of the tag or commit. Newest first. Reads only. +@non-destructive +@example "The five most recent tags" { git-tags | first 5 | get name } +@example "Tags older than a year" { git-tags | where created < ((date now) - 365day) | get name } +export def git-tags []: nothing -> table { + git-run for-each-ref --sort=-creatordate --format '%(refname:lstrip=2)%09%(if)%(*objectname)%(then)%(*objectname:short)%(else)%(objectname:short)%(end)%09%(creatordate:iso-strict)%09%(contents:subject)' refs/tags + | lines + | parse "{name}\t{commit}\t{created}\t{subject}" + | update created { into datetime } +} + +# The stash entries, newest first: `name` (`stash@{0}`), when it was `created` and its `message`. +# Reads only. +@non-destructive +@example "Stashes older than a day" { git-stashes | where created < ((date now) - 1day) } +@example "Each stash with its message and date" { git-stashes | select name message created } +export def git-stashes []: nothing -> table { + git-run stash list '--format=%gd%x09%cI%x09%gs' + | lines + | parse "{name}\t{created}\t{message}" + | update created { into datetime } +} + +# The worktrees, one row each: `path`, the `commit` checked out and the `branch` (empty when +# detached). Reads only. +@non-destructive +@example "The worktree that has main checked out" { git-worktrees | where branch == main | get path.0 } +@example "Each worktree with its branch" { git-worktrees | select branch path } +export def git-worktrees []: nothing -> table { + git-run worktree list --porcelain + | split row "\n\n" + | where {|block| $block | is-not-empty } + | each {|block| + let fields = $block | lines | parse "{key} {value}" | transpose --header-row --as-record + { + path: ($fields.worktree? | default '') + commit: ($fields.HEAD? | default '' | str substring ..<7) + branch: ($fields.branch? | default '' | str replace 'refs/heads/' '') + } + } +} + +export module git-completion-utils { export const GIT_SKIPABLE_FLAGS = ['-v', '--version', '-h', '--help', '-p', '--paginate', '-P', '--no-pager', '--no-replace-objects', '--bare'] # Run git and return its stdout lines; empty when git fails (e.g. outside a repository), @@ -326,11 +486,11 @@ module git-completion-utils { } $out } -} + # Every command `git --list-cmds=main` knows. A word on the line that is not one of these is # looked up as an alias. -const GIT_COMMANDS = [ +export const GIT_COMMANDS = [ add am annotate apply archimport archive backfill bisect blame branch bugreport bundle cat-file check-attr check-ignore check-mailmap check-ref-format checkout checkout--worker checkout-index cherry cherry-pick clean clone column commit commit-graph commit-tree config count-objects credential credential-cache credential-cache--daemon credential-netrc credential-osxkeychain credential-store @@ -352,7 +512,7 @@ const GIT_COMMANDS = [ # Builtins whose `-h` lists their options. Only these are ever run with `-h`: an alias or a # script could do anything when invoked, and bisect/credential/rerere take subcommands that # are not option parsers. -const GIT_BUILTINS = [ +export const GIT_BUILTINS = [ add am annotate apply archive backfill blame branch bugreport bundle cat-file check-attr check-ignore check-mailmap check-ref-format checkout checkout-index cherry cherry-pick clean clone column commit commit-graph commit-tree config count-objects describe diagnose diff diff-files diff-index diff-pairs diff-tree @@ -369,31 +529,31 @@ const GIT_BUILTINS = [ # Builtin subcommands that do not treat `-h` as a help request: `git stash create -h` writes a # stash commit named "-h". The git tests run every other `-h` the completer can spawn and check # that it prints usage and changes nothing. -const GIT_NO_HELP = ['stash create'] +export const GIT_NO_HELP = ['stash create'] # Global options that take the next word as their value (`git -C log`). -const GIT_GLOBAL_VALUED = [-C -c --git-dir --work-tree --namespace --config-env --attr-source] +export const GIT_GLOBAL_VALUED = [-C -c --git-dir --work-tree --namespace --config-env --attr-source] # Commands that also take the revision options of `git log` / the diff options of `git diff`. -const GIT_WITH_REV = [log show whatchanged rev-list shortlog format-patch reflog "reflog show" last-modified fast-export "bisect visualize" "bisect view"] -const GIT_WITH_DIFF = [diff log show whatchanged format-patch diff-tree diff-index diff-files "stash show" reflog "reflog show" difftool "bisect visualize" "bisect view"] +export const GIT_WITH_REV = [log show whatchanged rev-list shortlog format-patch reflog "reflog show" last-modified fast-export "bisect visualize" "bisect view"] +export const GIT_WITH_DIFF = [diff log show whatchanged format-patch diff-tree diff-index diff-files "stash show" reflog "reflog show" difftool "bisect visualize" "bisect view"] # Their own `-h` is a legacy summary; the shared sets describe these options better. -const GIT_LEGACY_HELP = [rev-list diff-files diff-index diff-tree] +export const GIT_LEGACY_HELP = [rev-list diff-files diff-index diff-tree] # Short options whose value is usually attached (`-Xtheirs`): offer `-X` forms. -const GIT_STUCK_SHORTS = [X S G L I O] +export const GIT_STUCK_SHORTS = [X S G L I O] # Revision options git only parses as `--opt=value`. -const GIT_EQ_ONLY = [format min-parents max-parents] +export const GIT_EQ_ONLY = [format min-parents max-parents] # Options documented as `--opt ` whose value git lets you omit. -const GIT_LASTARG_DEFAULT = [contains no-contains with without merged no-merged points-at] +export const GIT_LASTARG_DEFAULT = [contains no-contains with without merged no-merged points-at] -const GIT_PRETTY_FORMATS = [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] -const GIT_DATE_FORMATS = [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] -const GIT_CONFIG_TYPES = [bool int bool-or-int bool-or-str path expiry-date color] +export const GIT_PRETTY_FORMATS = [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] +export const GIT_DATE_FORMATS = [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] +export const GIT_CONFIG_TYPES = [bool int bool-or-int bool-or-str path expiry-date color] # Values for options, by long name: an inline list, a completer kind (see `git-complete-kind`), # `path` for nushell's own path completion, or a record keyed by command (`_` = any other). -const GIT_FLAG_VALUES = { +export const GIT_FLAG_VALUES = { onto: refs source: {restore: refs, checkout: refs, check-attr: refs, _: null} attr-source: refs @@ -507,7 +667,7 @@ const GIT_FLAG_VALUES = { # Options of commands git cannot describe itself (scripts, non parse-options builtins) and the # revision (@rev) and diff (@diff) options shared by log, show, diff, ... One option per line: # command, short, long, value (none|req|opt), negatable (1 = also --no-), placeholder, description. -const GIT_OPTIONS = r#' +export const GIT_OPTIONS = r#' C req run as if git was started in c req = pass a configuration parameter to the command config-env req = pass a configuration parameter from an environment variable @@ -931,7 +1091,7 @@ send-email translate-aliases none Translate aliases read from standard input @diff output req output to a specific file '# -const GIT_SUBCOMMANDS = r#' +export const GIT_SUBCOMMANDS = r#' stash list List the stash entries that you currently have stash show Show the changes recorded in a stash entry stash drop Remove a single stash entry from the list of stash entries @@ -1072,7 +1232,7 @@ credential reject Erase a credential credential capability Announce the capabilities of git credential '# -const GIT_POSITIONALS = r#' +export const GIT_POSITIONALS = r#' command?:git-command add ...pathspec:add stage ...pathspec:add @@ -1257,7 +1417,7 @@ worktree repair ...path:paths worktree unlock worktree:worktrees '# -const GIT_DESC_FALLBACK = r#' +export const GIT_DESC_FALLBACK = r#' grep or combine the surrounding patterns with OR (the default) grep not negate the following pattern grep and combine the surrounding patterns with AND @@ -1273,21 +1433,18 @@ rev-list bisect-vars print variables ready to be eval'ed by the shell for bisect rev-list bisect-all output all commits between included and excluded commits, ordered by distance '# -def "nu-complete git available upstream" [] { - use git-completion-utils [git-lines] +export def "nu-complete git available upstream" [] { git-lines for-each-ref '--format=%(refname:short)' refs/heads refs/remotes } def "nu-complete git remotes" [] { - use git-completion-utils [git-lines] git-lines remote --verbose | parse --regex '^(?\S+)\s+(?.+) \((?:fetch|push)\)$' | uniq-by value # Deduplicate where fetch and push remotes are the same } # Branches of the remote named earlier on the line (`git pull origin `). -def "nu-complete git remote refs" [place?: record] { - use git-completion-utils [git-lines find-remote] +export def "nu-complete git remote refs" [place?: record] { let remote = find-remote ($place.command? | default []) if $remote == null { return (git-lines for-each-ref '--format=%(refname:short)' refs/heads) } let prefix = $'refs/remotes/($remote)/' @@ -1297,14 +1454,12 @@ def "nu-complete git remote refs" [place?: record] { } # Yield local branches like `main`, `feature/typo_fix` -def "nu-complete git local branches" [] { - use git-completion-utils [git-lines] +export def "nu-complete git local branches" [] { git-lines for-each-ref '--format=%(refname:short)' refs/heads } # Yield local and remote branch names which can be passed to `git merge` -def "nu-complete git mergable sources" [] { - use git-completion-utils [get-mergable-sources] +export def "nu-complete git mergable sources" [] { { options: { case_sensitive: false, @@ -1317,26 +1472,22 @@ def "nu-complete git mergable sources" [] { # Any revision: branches, remote branches, tags and pseudo refs. def "nu-complete git refs" [] { - use git-completion-utils [get-refs] {options: {sort: false}, completions: (get-refs)} } # Revisions plus recent commits, for commands that usually take a single commit. def "nu-complete git commits" [] { - use git-completion-utils [get-refs get-recent-commits] {options: {sort: false}, completions: (get-refs | append (get-recent-commits))} } # Fully qualified ref names, for plumbing that wants `refs/heads/main` rather than `main`. -def "nu-complete git full refs" [] { - use git-completion-utils [git-lines] +export def "nu-complete git full refs" [] { ['HEAD'] | append (git-lines for-each-ref '--format=%(refname)') } # `git checkout` arguments. `words` are the arguments after `checkout`, ending with the word # being completed. -def git-checkout-candidates [words: list]: nothing -> any { - use git-completion-utils [git-lines get-changed-files get-checkoutable-files format-checkout-files get-mergable-sources GIT_SKIPABLE_FLAGS] +export def git-checkout-candidates [words: list]: nothing -> any { # Earlier arguments, without flags that do not change what comes next. let prev = $words | drop 1 | where ($it not-in $GIT_SKIPABLE_FLAGS) # Only paths after `--`; right after a leading `--` only changed files (about to be reset). @@ -1366,31 +1517,27 @@ def git-checkout-candidates [words: list]: nothing -> any { # The words of the command line in `buffer` up to the cursor, ending with the word being # completed ('' after a space). -def git-buffer-words [buffer: string, place?: record]: nothing -> list { - use git-completion-utils [args-split] +export def git-buffer-words [buffer: string, place?: record]: nothing -> list { let preceding = $buffer | str substring ..($place.cursor? | default ($buffer | str length)) let words = $preceding | args-split if ($preceding | is-empty) or ($preceding ends-with ' ') { $words | append '' } else { $words } } -def "nu-complete git checkout" [buffer: string, place?: record] { +export def "nu-complete git checkout" [buffer: string, place?: record] { git-checkout-candidates (git-buffer-words $buffer $place | skip 2) } -def "nu-complete git stash-list" [] { - use git-completion-utils [git-lines] +export def "nu-complete git stash-list" [] { git-lines stash list | parse "{value}: {description}" } def "nu-complete git tags" [] { - use git-completion-utils [git-lines] git-lines tag --no-color } # Local branches, plus the named remote's branches as `:branch` (or bare after --delete). # `words` are the arguments after `push`, ending with the word being completed. -def git-push-candidates [words: list]: nothing -> list { - use git-completion-utils [git-lines] +export def git-push-candidates [words: list]: nothing -> list { mut remote = "" mut option_value = "" mut after_separator = false @@ -1446,41 +1593,36 @@ def git-push-candidates [words: list]: nothing -> list { $local_branches | append ($remote_branches | each { |branch| $":($branch)" }) } -def "nu-complete git push" [buffer: string, place: record] { +export def "nu-complete git push" [buffer: string, place: record] { let words = git-buffer-words $buffer $place let push_index = $words | enumerate | where item == push | get -o 0.index | default 1 git-push-candidates ($words | skip ($push_index + 1)) } # Changed and untracked files that `git add` would stage. -def "nu-complete git add" [] { - use git-completion-utils [repo-prefix status-entries format-status-files] +export def "nu-complete git add" [] { let prefix = repo-prefix status-entries --untracked --prefix $prefix | where {|e| ($e.xy | str substring 1..1) != '.' } | format-status-files $prefix } # Files with staged or unstaged changes, for `git commit `. -def "nu-complete git commit files" [] { - use git-completion-utils [status-entries format-status-files] +export def "nu-complete git commit files" [] { status-entries | format-status-files } # Untracked files and directories, for `git clean`. -def "nu-complete git untracked" [] { - use git-completion-utils [repo-prefix status-entries format-status-files] +export def "nu-complete git untracked" [] { let prefix = repo-prefix status-entries --untracked --prefix $prefix | where xy == '??' | format-status-files $prefix } # Paths with merge conflicts, for `git mergetool`. -def "nu-complete git conflicted" [] { - use git-completion-utils [status-entries describe-status format-status-files] +export def "nu-complete git conflicted" [] { status-entries | where {|e| (describe-status $e.xy) == 'Unmerged' } | format-status-files } # `git restore` restores the worktree by default and the index with --staged. -def "nu-complete git restore" [place?: record] { - use git-completion-utils [status-entries format-status-files] +export def "nu-complete git restore" [place?: record] { let words = $place.command? | default [] let staged = ($words | any {|w| $w in ['--staged' '-S'] or ($w =~ '^-[^-]*S') }) let worktree = ($words | any {|w| $w in ['--worktree' '-W'] }) @@ -1489,8 +1631,7 @@ def "nu-complete git restore" [place?: record] { } # `git diff`: changed files (staged ones with --cached/--staged) and revisions. -def "nu-complete git diff" [place?: record] { - use git-completion-utils [status-entries format-status-files get-refs] +export def "nu-complete git diff" [place?: record] { let words = $place.command? | default [] let column = if ($words | any {|w| $w in ['--cached' '--staged'] }) { 0 } else { 1 } let files = status-entries | where {|e| ($e.xy | str substring $column..$column) != '.' } | format-status-files @@ -1499,16 +1640,14 @@ def "nu-complete git diff" [place?: record] { } # `git reset`: a commit to reset to, or staged paths to unstage (only paths after `--`). -def "nu-complete git reset" [place?: record] { - use git-completion-utils [status-entries format-status-files get-refs get-recent-commits] +export def "nu-complete git reset" [place?: record] { let staged = status-entries | where {|e| ($e.xy | str substring 0..0) not-in ['.' '?'] } | format-status-files if '--' in ($place.command? | default [] | drop 1) { return $staged } {options: {sort: false}, completions: (get-refs | append (get-recent-commits) | append $staged)} } # Revisions first; falls back to path completion after `--` or when no ref matches. -def "nu-complete git refs or paths" [token?: record, place?: record] { - use git-completion-utils [get-refs] +export def "nu-complete git refs or paths" [token?: record, place?: record] { if '--' in ($place.command? | default [] | drop 1) { return null } let text = $token.text? | default '' | str lowercase let refs = get-refs @@ -1517,8 +1656,7 @@ def "nu-complete git refs or paths" [token?: record, place?: record] { } # Paths first; offers revisions only when the typed prefix matches one. -def "nu-complete git paths or refs" [token?: record, place?: record] { - use git-completion-utils [get-refs] +export def "nu-complete git paths or refs" [token?: record, place?: record] { let text = $token.text? | default '' | str lowercase if ($text | is-empty) or '--' in ($place.command? | default [] | drop 1) { return null } let refs = get-refs | where {|r| $r.value | str lowercase | str starts-with $text } @@ -1526,8 +1664,7 @@ def "nu-complete git paths or refs" [token?: record, place?: record] { } # `git branch`: branch names to delete/rename/configure, and a start point for a new branch. -def "nu-complete git branch" [place?: record] { - use git-completion-utils [git-lines get-refs] +export def "nu-complete git branch" [place?: record] { let words = $place.command? | default [] let flags = $words | where {|w| $w starts-with '-' } let remote = $flags | any {|f| $f in ['-r' '--remotes'] or ($f =~ '^-[^-]*r') } @@ -1542,8 +1679,7 @@ def "nu-complete git branch" [place?: record] { } # `git tag`: existing tags (to delete/verify or overwrite), then a commit for a new tag. -def "nu-complete git tag" [place?: record] { - use git-completion-utils [git-lines get-refs] +export def "nu-complete git tag" [place?: record] { let words = $place.command? | default [] let manage = $words | any {|w| $w in ['-d' '--delete' '-v' '--verify'] } let positionals = git-positional-words tag ($words | skip 1 | drop 1) @@ -1565,8 +1701,7 @@ def "nu-complete git worktrees" [] { } } -def "nu-complete git submodules" [] { - use git-completion-utils [git-lines from-repo-root] +export def "nu-complete git submodules" [] { let root = git-lines rev-parse --show-toplevel | get -o 0 if $root == null { return [] } git-lines config --file ($root | path join .gitmodules) --get-regexp '^submodule\..*\.path$' @@ -1577,28 +1712,24 @@ def "nu-complete git submodules" [] { } # Every config key git knows about, with the current value for keys that are set. -def "nu-complete git config keys" [] { - use git-completion-utils [git-lines] +export def "nu-complete git config keys" [] { let set = git-lines config list | parse --regex '^(?[^=]+)(?:=(?.*))?$' | uniq-by value | update description {|row| $row.description | default '' } let known = git-lines help --config-for-completion | where {|key| $key not-in $set.value } | each {|key| {value: $key, description: ''} } {options: {sort: false}, completions: ($set | append $known)} } -def "nu-complete git config sections" [] { - use git-completion-utils [git-lines] +export def "nu-complete git config sections" [] { git-lines config list --name-only | each {|key| $key | str replace -r '\.[^.]+$' '' } | uniq } def "nu-complete git aliases" [] { - use git-completion-utils [git-lines] git-lines config --get-regexp '^alias\.' | parse --regex '^alias\.(?\S+) (?.*)$' } # Commands and aliases for `git `. def "nu-complete git subcommands" [] { - use git-completion-utils [git-lines] # `git help -a` also lists concept guides ("User-facing ...", "Developer-facing ..."); skip them. git-lines help -a | reduce -f {guide: false, rows: []} {|line, acc| @@ -1618,24 +1749,20 @@ def "nu-complete git subcommands" [] { } # Commands, aliases and concept guides for `git help`. -def "nu-complete git help" [] { - use git-completion-utils [git-lines] +export def "nu-complete git help" [] { let guides = git-lines help -g | where $it starts-with " " | parse -r '\s*(?P[^ ]+) \s*(?P\w.*)' nu-complete git subcommands | append $guides } -def "nu-complete git notes refs" [] { - use git-completion-utils [git-lines] +export def "nu-complete git notes refs" [] { git-lines for-each-ref '--format=%(refname)' refs/notes } -def "nu-complete git reflog entries" [] { - use git-completion-utils [git-lines] +export def "nu-complete git reflog entries" [] { git-lines reflog --max-count=200 '--format=%gd%x09%gs' | parse "{value}\t{description}" } -def "nu-complete git authors" [] { - use git-completion-utils [git-lines] +export def "nu-complete git authors" [] { git-lines log --max-count=1000 '--format=%aN <%aE>' | uniq | each {|author| {value: ($author | to nuon), display_override: $author} } @@ -1646,8 +1773,7 @@ def "nu-complete git authors" [] { # Completions for one kind of argument. `place.command` starts with the command (`git pull`) # followed by its arguments; the last one is the word being completed. -def git-complete-kind [kind: string, token: record, place: record]: nothing -> any { - use git-completion-utils [git-lines] +export def git-complete-kind [kind: string, token: record, place: record]: nothing -> any { match $kind { none => [] paths => null @@ -1701,7 +1827,7 @@ def git-complete-kind [kind: string, token: record, place: record]: nothing -> a } # Options recorded in GIT_OPTIONS for `key` (`@rev` and `@diff` are the shared sets). -def git-table-opts [key: string]: nothing -> list { +export def git-table-opts [key: string]: nothing -> list { let src = $key | str trim --left --char '@' $GIT_OPTIONS | lines | where {|line| $line starts-with $"($key)\t" } | split column "\t" key short long value neg ph desc @@ -1715,7 +1841,7 @@ def git-table-opts [key: string]: nothing -> list { } # `-h` output of a builtin, or nothing for anything else. -def git-help-text [...words: string]: nothing -> string { +export def git-help-text [...words: string]: nothing -> string { if $words.0 not-in $GIT_BUILTINS or ($words | str join ' ') in $GIT_NO_HELP { return '' } let result = try { '' | ^git ...$words -h | complete } catch { return '' } $result.stdout + $result.stderr @@ -1723,8 +1849,7 @@ def git-help-text [...words: string]: nothing -> string { # Every option of `git `: its own `-h` (or the hand-written table for scripts and commands # without parse-options help) plus the shared revision and diff options. -def git-options [key: string]: nothing -> list { - use git-completion-utils [parse-help] +export def git-options [key: string]: nothing -> list { let words = $key | split row ' ' let hand = git-table-opts $key let own = if ($hand | is-not-empty) or $key == '' { @@ -1753,7 +1878,7 @@ def git-options [key: string]: nothing -> list { } # What completes the value of an option: a list, a completer kind, `path`, or null. -def git-value-source [key: string, opt: record]: nothing -> any { +export def git-value-source [key: string, opt: record]: nothing -> any { let spec = $GIT_FLAG_VALUES | get -o ($opt.long | default '') if ($spec | describe | str starts-with 'record') { # A null for this command means "no values", so look keys up instead of using `default`. @@ -1766,7 +1891,7 @@ def git-value-source [key: string, opt: record]: nothing -> any { } # Completion rows for a value, each prefixed (`--color=`, `-X`) as typed. -def git-value-rows [source: any, token: record, place: record, prefix: string]: nothing -> any { +export def git-value-rows [source: any, token: record, place: record, prefix: string]: nothing -> any { let rows = if ($source | describe | str starts-with 'list') { $source | each {|v| {value: ($v | into string)} } } else if $source == path { @@ -1788,7 +1913,7 @@ def git-value-rows [source: any, token: record, place: record, prefix: string]: } # Flag names (and `--flag=value` forms) for `git `. -def git-flag-rows [key: string, opts: list, token: record, place: record]: nothing -> any { +export def git-flag-rows [key: string, opts: list, token: record, place: record]: nothing -> any { let text = $token.text let eq = $text | parse --regex '^(?--[^=]+)=' | get -o 0.flag if $eq != null { @@ -1820,20 +1945,20 @@ def git-flag-rows [key: string, opts: list, token: record, place: record } # The option a flag word refers to (`--strategy`, `-s`), if any. -def git-find-option [opts: list, word: string]: nothing -> any { +export def git-find-option [opts: list, word: string]: nothing -> any { if ($word starts-with '--') { return ($opts | where long == ($word | str substring 2..) | get -o 0) } if ($word =~ '^-[A-Za-z0-9]$') { return ($opts | where short == ($word | str substring 1..) | get -o 0) } null } # Does this option take the following word as its value? -def git-takes-value [opt: any]: nothing -> bool { +export def git-takes-value [opt: any]: nothing -> bool { $opt != null and $opt.value == req and $opt.long not-in $GIT_LASTARG_DEFAULT } # Indices of the positional arguments in `args` (options and their values skipped; everything # after `--` counts). `options` is the option list, or the command to read it for when needed. -def git-positional-indices [options: any, args: list]: nothing -> list { +export def git-positional-indices [options: any, args: list]: nothing -> list { let has_options = $args | any {|word| ($word starts-with '-') and $word != '-' } let opts = if not $has_options { [] } else if ($options | describe) == string { git-options $options } else { $options } $args | enumerate | reduce -f {found: [], skip: false, dashes: false} {|it, acc| @@ -1850,19 +1975,18 @@ def git-positional-indices [options: any, args: list]: nothing -> list]: nothing -> list { +export def git-positional-words [options: any, args: list]: nothing -> list { let indices = git-positional-indices $options $args $args | enumerate | where {|it| $it.index in $indices } | get item } # A word from `place.command` with its surrounding quotes removed (`"my dir"`). -def git-unquote []: string -> string { +export def git-unquote []: string -> string { $in | str replace -r `^(["'])(.*)\1$` '$2' } # The words of an alias, with `!` shell aliases reduced to the git command they run (if any). -def git-alias-words [value: string]: nothing -> list { - use git-completion-utils [args-split] +export def git-alias-words [value: string]: nothing -> list { if not ($value starts-with '!') { return ($value | args-split) } let words = $value | str substring 1.. | args-split let start = $words | enumerate | where item == git | get -o 0.index @@ -1873,8 +1997,7 @@ def git-alias-words [value: string]: nothing -> list { # Replace a leading git alias with what it stands for (`co -b x` -> `checkout -b x`). Returns # null for words that are neither a git command nor an alias of one. -def git-expand-alias [words: list]: nothing -> any { - use git-completion-utils [git-lines] +export def git-expand-alias [words: list]: nothing -> any { mut words = $words for _ in 1..8 { if ($words.0 in $GIT_COMMANDS) { return $words } @@ -1888,13 +2011,13 @@ def git-expand-alias [words: list]: nothing -> any { } # Subcommands of `git ` (`stash` -> list, show, ...) with their descriptions. -def git-subcommand-rows [command: string]: nothing -> list> { +export def git-subcommand-rows [command: string]: nothing -> list> { $GIT_SUBCOMMANDS | lines | where {|line| $line starts-with $"($command) " } | each {|line| let cols = $line | split row "\t"; {value: ($cols.0 | split row ' ' | get 1), description: $cols.1} } } # Complete `git ` (command already alias-expanded is fine too). -def git-complete-command [words: list, token: record]: nothing -> any { +export def git-complete-command [words: list, token: record]: nothing -> any { let words = git-expand-alias $words if $words == null { return null } let command = $words.0 @@ -1943,7 +2066,7 @@ def git-complete-command [words: list, token: record]: nothing -> any { } # Completions for everything after `git`. -def "nu-complete git" [token: record, place: record] { +export def "nu-complete git" [token: record, place: record] { let words = $place.command | skip 1 let before = $words | drop 1 # Global options come before the command; `-C`, `--git-dir` and `--work-tree` change which @@ -1993,6 +2116,7492 @@ def "nu-complete git" [token: record, place: record] { } catch { [] } } -export extern "git" [ - ...args: external_arg@"nu-complete git" # a git command or alias, and its arguments +} + +# --- Live providers --------------------------------------------------------------- + +# Subcommands and configured aliases, for `git help` and the root positional. +@non-destructive +export def "nu-complete git subcommands" [] { + try { + # `git help -a` also lists concept guides ("User-facing ...", "Developer-facing ..."); skip them. + let builtin = (git-run help -a + | lines + | reduce -f {guide: false, rows: []} {|line, acc| + if not ($line starts-with ' ') { + $acc | update guide ($line =~ '^(User|Developer)-facing') + } else if $acc.guide or not ($line starts-with ' ') { + $acc + } else { + $acc | update rows ($acc.rows | append $line) + } + } + | get rows + | parse -r '\s*(?P[^ ]+)(?: \s*(?P\S.*))?') + $builtin | append (nu-complete git aliases) | uniq-by value + } catch { + [] + } +} + +# Configured aliases, as `name` and the command they expand to. +@non-destructive +export def "nu-complete git aliases" [] { + try { + git-run config --get-regexp '^alias\.' | lines | parse "alias.{value} {description}" + } catch { + [] + } +} + +# Local and remote branches, local ones first and most recently committed first. +@non-destructive +export def "nu-complete git branches" [] { + try { + let local = (git-run for-each-ref --sort=-committerdate --format '%(refname:lstrip=2)%09%(upstream:short)' refs/heads + | lines + | split column "\t" value upstream + | each {|b| {value: $b.value, description: (if ($b.upstream | is-empty) { 'local branch' } else { $"local branch, tracks ($b.upstream)" })} }) + let remote = (git-run for-each-ref --format '%(refname:lstrip=2)' refs/remotes + | lines + | where {|r| not ($r ends-with '/HEAD') } + | each {|r| {value: $r, description: 'remote branch'} }) + $local ++ $remote + } catch { + [] + } +} + +# Local branches, most recently committed first, described by their tip commit. +@non-destructive +export def "nu-complete git local-branches" [] { + try { + git-run for-each-ref --sort=-committerdate --format '%(refname:lstrip=2)%09%(contents:subject)' refs/heads + | lines + | split column "\t" value description + } catch { + [] + } +} + +# Remote-tracking branches, such as `origin/main`. +@non-destructive +export def "nu-complete git remote-branches" [] { + try { + git-run for-each-ref --format '%(refname:lstrip=2)%09%(contents:subject)' refs/remotes + | lines + | split column "\t" value description + | where {|r| not ($r.value ends-with '/HEAD') } + } catch { + [] + } +} + +# Remotes, described by the URL they fetch from. +@non-destructive +export def "nu-complete git remotes" [] { + try { + git-remotes | rename value description + } catch { + [] + } +} + +# Tags, described by the commit subject they point at. +@non-destructive +export def "nu-complete git tags" [] { + try { + git-run for-each-ref --sort=-creatordate --format '%(refname:lstrip=2)%09%(contents:subject)' refs/tags + | lines + | split column "\t" value description + } catch { + [] + } +} + +# Stash entries, newest first, described by the stash message. +@non-destructive +export def "nu-complete git stashes" [] { + try { + git-run stash list '--format=%gd%x09%gs' | lines | split column "\t" value description + } catch { + [] + } +} + +# Changed files that `git add`, `git clean`, `git mv` and `git restore` act on. +@non-destructive +export def "nu-complete git files" [] { + try { + status-paths --untracked + | where code in [? .M MM MD .D UU] + | each {|entry| $entry.value | path-suggestion ($STATUS_DESCRIPTIONS | get $entry.code) $entry.code } + } catch { + [] + } +} + +# Staged files, for `git restore --staged`. +@non-destructive +export def "nu-complete git staged-files" [] { + try { + status-paths | where code =~ '^[MADRCT].$' | each {|entry| $entry.value | path-suggestion Staged $entry.code } + } catch { + [] + } +} + +# Existing commits in descending chronological order, described by their subject. +@non-destructive +export def "nu-complete git commits" [] { + try { + git-run rev-list --all --remotes --max-count=400 --pretty=oneline + | lines + | parse "{value} {description}" + } catch { + [] + } +} + +# Everything a revision argument accepts: branches, tags and the built-in refs. +@non-destructive +export def "nu-complete git refs" [] { + try { + let builtin = (['HEAD' 'FETCH_HEAD' 'ORIG_HEAD'] | each {|r| {value: $r, description: 'built-in ref'} }) + (nu-complete git branches) ++ (nu-complete git tags) ++ $builtin + } catch { + [] + } +} + +# Revisions and changed paths together, for `git checkout` and `git diff`. +@non-destructive +export def "nu-complete git files-or-refs" [] { + try { + (nu-complete git refs) ++ (nu-complete git files) + } catch { + [] + } +} + +# Checked-out worktrees, described by the branch they hold. +@non-destructive +export def "nu-complete git worktrees" [] { + try { + git-worktrees | each {|w| {value: $w.path, description: (if ($w.branch | is-empty) { 'detached' } else { $w.branch })} } + } catch { + [] + } +} + +# Keys of the effective configuration, deduplicated. +@non-destructive +export def "nu-complete git config-keys" [] { + try { + git-run config --list --name-only | lines | uniq + } catch { + [] + } +} + +# The built-in formats of `git log --format` and `--pretty`. +@non-destructive +export def "nu-complete git log-format" [] { + [ + {value: oneline, description: " , on one line"} + {value: short, description: "Commit, author and title"} + {value: medium, description: "Commit, author, date and message (default)"} + {value: full, description: "Commit, author, committer and message"} + {value: fuller, description: "Commit, author and committer with their dates, and message"} + {value: reference, description: "<short hash> (<title>, <short date>)"} + {value: email, description: "As a patch email"} + {value: mboxrd, description: "As email, with quoted 'From ' lines"} + {value: raw, description: "The commit object as stored"} + {value: "format:", description: "Your own format, as format:'%h %s'"} + {value: "tformat:", description: "Your own format, each commit ended by a newline"} + ] +} + +# The date formats of `git log --date`. +@non-destructive +export def "nu-complete git log-date" [] { + [ + {value: relative, description: "2 hours ago"} + {value: local, description: "In your time zone"} + {value: iso, description: "2026-11-04 20:02:10 -0800"} + {value: iso-strict, description: "2026-11-04T20:02:10-08:00"} + {value: rfc, description: "Wed, 4 Nov 2026 20:02:10 -0800"} + {value: short, description: "2026-11-04"} + {value: raw, description: "Seconds since the epoch and the time zone"} + {value: human, description: "Only what differs from now"} + {value: unix, description: "Seconds since the epoch"} + {value: default, description: "Day, month and year, with the time zone"} + {value: "format:", description: "Your own format, as format:'%Y-%m-%d'"} + {value: "format-local:", description: "Your own format, in your time zone"} + ] +} + +@non-destructive +export def "nu-complete git merge-strategies" [] { + try { + git-run merge --help | ignore + ['ort' 'octopus' 'ours' 'subtree'] + } catch { + ['ort' 'octopus'] + } +} + +@non-destructive +export def "nu-complete git merge-strategy-options" [] { + ['ours' 'theirs' 'ignore-space-change' 'ignore-all-space' 'patience' 'histogram'] +} + +@non-destructive +export def "nu-complete git pull-rebase" [] { + ['false' 'true' 'merges' 'interactive'] +} + +# Untracked files, for `git clean`. +@non-destructive +export def "nu-complete git untracked-files" [] { + try { + status-paths --untracked | where code == '?' | each {|entry| $entry.value | path-suggestion Untracked '?' } + } catch { + [] + } +} + +# Files with merge conflicts, for `git mergetool`. +@non-destructive +export def "nu-complete git conflicted-files" [] { + try { + status-paths | where code =~ '^(?:DD|AU|UD|UA|DU|AA|UU)$' | each {|entry| $entry.value | path-suggestion Unmerged $entry.code } + } catch { + [] + } +} + +# `git checkout` targets: branches, tags and commits, then the changed files it can restore, +# conflicted ones included. +@non-destructive +export def "nu-complete git checkout-targets" [] { + try { + (nu-complete git refs) ++ (restorable-files --unmerged) + } catch { + [] + } +} + +# Submodule paths recorded in `.gitmodules`. +@non-destructive +export def "nu-complete git submodules" [] { + try { + let root = git-run rev-parse --show-toplevel | str trim + git-run config --file ($root | path join .gitmodules) --get-regexp '^submodule\..*\.path$' + | lines + | parse --regex '^\S+ (?<value>.+)$' + | insert description Submodule + } catch { + [] + } +} + +# Sections of the effective configuration, such as `core` or `remote.origin`. +@non-destructive +export def "nu-complete git config-sections" [] { + try { + git-run config list --name-only | lines | each {|key| $key | str replace -r '\.[^.]+$' '' } | uniq + } catch { + [] + } +} + +# Notes refs, such as `refs/notes/commits`. +@non-destructive +export def "nu-complete git notes-refs" [] { + try { + git-run for-each-ref '--format=%(refname)' refs/notes | lines + } catch { + [] + } +} + +# Reflog entries, such as `HEAD@{2}`, described by what they record. +@non-destructive +export def "nu-complete git reflog-entries" [] { + try { + git-run reflog --max-count=200 '--format=%gd%x09%gs' | lines | parse "{value}\t{description}" + } catch { + [] + } +} + +# Fully qualified ref names, for plumbing that wants `refs/heads/main` rather than `main`. +@non-destructive +export def "nu-complete git full-refs" [] { + try { + ['HEAD'] | append (git-run for-each-ref '--format=%(refname)' | lines) + } catch { + [] + } +} + +# Authors of recent commits, as `Name <email>`. +@non-destructive +export def "nu-complete git authors" [] { + try { + git-run log --max-count=1000 '--format=%aN <%aE>' | lines | uniq + } catch { + [] + } +} + +# Keys `git repo info` reports. +@non-destructive +export def "nu-complete git repo-keys" [] { + try { + git-run repo info --keys | lines + } catch { + [] + } +} + +# Hooks git runs, for `git hook`. +@non-destructive +export def "nu-complete git hooks" [] { + [ + applypatch-msg pre-applypatch post-applypatch pre-commit pre-merge-commit prepare-commit-msg + commit-msg post-commit pre-rebase post-checkout post-merge pre-push pre-receive update + proc-receive post-receive post-update reference-transaction push-to-checkout pre-auto-gc + post-rewrite sendemail-validate fsmonitor-watchman p4-changelist p4-prepare-changelist + p4-post-changelist p4-pre-submit post-index-change + ] +} + +# Variables `git var` prints. +@non-destructive +export def "nu-complete git vars" [] { + [ + GIT_AUTHOR_IDENT GIT_COMMITTER_IDENT GIT_EDITOR GIT_SEQUENCE_EDITOR GIT_PAGER + GIT_DEFAULT_BRANCH GIT_SHELL_PATH GIT_ATTR_SYSTEM GIT_ATTR_GLOBAL GIT_CONFIG_SYSTEM + GIT_CONFIG_GLOBAL + ] +} + +# Status entries as upstream's helpers see them, relative to the current directory, as plain paths +# (Nushell quotes them where needed). `filter` picks entries by their XY status. +def status-rows [filter: closure, --untracked]: nothing -> list<record> { + use git-completion-utils [repo-prefix status-entries format-status-files] + let prefix = repo-prefix + status-entries --untracked=$untracked --prefix $prefix + | where $filter + | format-status-files $prefix + | each {|row| {value: $row.display_override, description: $row.description} } +} + +# Files `git add` would stage: unstaged changes and untracked files. +@non-destructive +export def "nu-complete git add-files" [] { + try { status-rows --untracked {|e| ($e.xy | str substring 1..1) != '.' } } catch { [] } +} + +# Files with unstaged changes, which `git restore` brings back. +@non-destructive +export def "nu-complete git unstaged-files" [] { + try { status-rows {|e| ($e.xy | str substring 1..1) != '.' } } catch { [] } +} + +# Files `git restore` brings back: unstaged changes, or staged ones with --staged alone. +@non-destructive +export def "nu-complete git restore-files" [--staged, --worktree] { + let column = if $staged and not $worktree { 0 } else { 1 } + try { status-rows {|e| ($e.xy | str substring $column..$column) != '.' } } catch { [] } +} + +# What `git diff` compares first: changed files (staged ones with --cached), then revisions. +@non-destructive +export def "nu-complete git diff-start" [place?: record] { + let words = $place.command? | default [] + let column = if ($words | any {|w| $w in ['--cached' '--staged'] }) { 0 } else { 1 } + let files = try { status-rows {|e| ($e.xy | str substring $column..$column) != '.' } } catch { [] } + use git-completion-utils [get-refs] + {options: {sort: false}, completions: ($files | append (try { get-refs } catch { [] }))} +} + +# Files with staged or unstaged changes, for `git commit <pathspec>`. +@non-destructive +export def "nu-complete git changed-files" [] { + try { status-rows {|e| true } } catch { [] } +} + +# Branch names of remotes without the remote's name (`main` for `origin/main`), for the refspec +# after a remote in `git pull` and `git fetch`. +@non-destructive +export def "nu-complete git remote-branch-names" [] { + try { + let remotes = git-run remote | lines + git-run for-each-ref '--format=%(refname:lstrip=2)' refs/remotes + | lines + | each {|ref| let remote = $remotes | where {|r| $ref starts-with $"($r)/" } | sort-by { str length } | last; if $remote == null { null } else { $ref | str substring (($remote | str length) + 1).. } } + | compact + | where $it != 'HEAD' + | uniq + } catch { + [] + } +} + +# --- Grammar ---------------------------------------------------------------------- + +# `rev1..rev2` or `rev1...rev2`. A revision segment may not start with `.`, `:` or `@`, so +# the separator dots are never mistaken for part of a revision. +export syntax git.range over chars { + root = from: rev ("..." | "..") to: rev + rev = seg (("/" | ".") seg)* + seg = until ".:@/" +} + +# --- Routes ----------------------------------------------------------------------- + +# The arguments of a git alias (`co` -> `checkout`, `!git switch $1` -> `switch`): what the +# command it stands for offers there, given the words after the alias and the one typed. Shell +# aliases are only read, never run. +@non-destructive +export def "nu-complete git alias-args" [alias?: string, token?: record, place?: record] { + if $alias == null { return [] } + try { + use git-completion-utils * + let expanded = git-expand-alias [$alias] + if $expanded == null { return [] } + let token = $token | default {text: '' span: {start: 0 end: 0}} + let command = $place.command? | default [git $alias $token.text] + let at = $command | skip 1 | enumerate | where item == $alias | get -o 0.index + let args = if $at == null { [$token.text] } else { $command | skip ($at + 2) } + let rows = git-complete-command ($expanded | append $args) $token + let rows = if ($rows | describe | str starts-with 'record') { $rows.completions? | default [] } else { $rows | default [] } + $rows + | each {|row| + if ($row | describe | str starts-with 'record') { + {value: ($row.display_override? | default $row.value), description: ($row.description? | default '')} + } else { + {value: $row, description: ''} + } + } + | where {|row| $row.value starts-with $token.text } + } catch { [] } +} + +export complete [git] [ + command?: by "nu-complete git subcommands" # Subcommand or alias + -C: dir cwd # Run as if git was started in this directory + --git-dir: dir # Set the path to the repository + --work-tree: dir # Set the path to the working tree + -c: text # Pass a configuration parameter + --paginate(-p) # Pipe output into a pager + --no-pager(-P) # Do not pipe output into a pager + --version(-v) # Print the Git suite version + --help(-h) # Print the synopsis and a list of common commands + --html-path # Print the path to the HTML documentation + --man-path # Print the path to the man pages + --info-path # Print the path to the Info files + --no-replace-objects # Do not use replacement refs + --bare # Treat the repository as bare + --config-env: text # Pass a configuration parameter from an environment variable + --exec-path?: path # Path to the core git programs, or print it + --namespace: path # Set the git namespace + --no-lazy-fetch # Do not fetch missing objects from the promisor remote on demand + --no-optional-locks # Do not perform optional operations that require locks + --no-advice # Disable all advice hints from being printed + --literal-pathspecs # Treat pathspecs literally + --glob-pathspecs # Add "glob" magic to all pathspecs + --noglob-pathspecs # Add "literal" magic to all pathspecs + --icase-pathspecs # Add "icase" magic to all pathspecs + --list-cmds: words [main others alias nohelpers config parseopt] # List commands by group + --attr-source: by "nu-complete git refs" # Read gitattributes from <tree-ish> instead of the worktree + ...args: by "nu-complete git alias-args" [alias: command] # Arguments of an alias +] where { + at-most-one [--paginate --no-pager] + terminal [--version --help] +} + +export complete [git add] [ + ...files: by "nu-complete git add-files" # Files to stage + --all(-A) # Stage all changes + --dry-run(-n) # Only show what would be added + --edit(-e) # Edit the diff before staging + --force(-f) # Add otherwise ignored files + --interactive # Stage interactively + --patch(-p) # Choose hunks to stage + --verbose(-v) # Be verbose + --no-dry-run # Negate --dry-run + --no-verbose # Negate --verbose + --no-interactive # Negate --interactive + --no-patch # Negate --patch + --auto-advance # Auto advance to the next file when selecting hunks interactively + --no-auto-advance # Negate --auto-advance + --unified(-U): text # Generate diffs with <n> lines context + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --no-edit # Negate --edit + --no-force # Negate --force + --update(-u) # Update tracked files + --no-update # Negate --update + --renormalize # Renormalize EOL of tracked files (implies -u) + --no-renormalize # Negate --renormalize + --resolved # Add conflict-resolved tracked files + --no-resolved # Negate --resolved + --intent-to-add(-N) # Record only the fact that the path will be added later + --no-intent-to-add # Negate --intent-to-add + --no-all # Negate --all + --ignore-removal # Ignore paths removed in the working tree (same as --no-all) + --no-ignore-removal # Negate --ignore-removal + --refresh # Don't add, only refresh the index + --no-refresh # Negate --refresh + --ignore-errors # Just skip files which cannot be added because of errors + --no-ignore-errors # Negate --ignore-errors + --ignore-missing # Check if - even missing - files are ignored in dry run + --no-ignore-missing # Negate --ignore-missing + --sparse # Allow updating entries outside of the sparse-checkout cone + --no-sparse # Negate --sparse + --chmod: words [+x -x] # Override the executable bit of the listed files + --no-chmod # Negate --chmod + --pathspec-from-file: path # Read pathspec from file + --no-pathspec-from-file # Negate --pathspec-from-file + --pathspec-file-nul # With --pathspec-from-file, pathspec elements are separated with NUL character + --no-pathspec-file-nul # Negate --pathspec-file-nul +] where { + at-most-one [--interactive --patch] +} + +export complete [git bisect] [ + ...args: text + --help(-h) +] + +export complete [git bisect start] [ + bad?: by "nu-complete git commits" # A commit that has the bug + good?: by "nu-complete git commits" # A commit that does not have the bug + --term-new: text + --term-old: text + --no-checkout + --first-parent + --term-bad: text # Term for the bad (new) state + --term-good: text # Term for the good (old) state + --reset-when-found?: text # Reset the bisection when the first bad commit is found +] + +export complete [git bisect bad] [ + revision?: by "nu-complete git commits" # Commit to mark, defaulting to HEAD +] + +export complete [git bisect good] [ + revision?: by "nu-complete git commits" # Commit to mark, defaulting to HEAD +] + +export complete [git bisect skip] [ + revision?: by "nu-complete git commits" # Commit or range to skip +] + +export complete [git bisect reset] [ + commit?: by "nu-complete git commits" # Commit to check out instead +] + +export complete [git bisect log] [] + +export complete [git bisect replay] [ + logfile: path # The bisect log to replay +] + +export complete [git branch] [ + branch?: by "nu-complete git local-branches" # The branch to list, create, move or delete + ...start: by "nu-complete git refs" # The start point of a new branch, or more branches + --abbrev # Use short commit hash prefixes + --edit-description # Edit the branch description + --merged # List branches reachable from a commit + --no-merged # List branches not reachable from a commit + --set-upstream-to: by "nu-complete git remote-branches" # Set the upstream of a branch + --unset-upstream # Remove the upstream of a branch + --all(-a) # List remote and local branches + --remotes(-r) # List remote-tracking branches + --copy(-c) # Copy a branch with its config and reflog + --format: text # Format the listing + --move(-m) # Rename a branch + --points-at: by "nu-complete git refs" # List branches that point at an object + --show-current # Print the current branch name + --verbose(-v) # Show commit and upstream for each branch + --color # Use color in output + --quiet(-q) # Suppress messages except errors + --delete(-d) # Delete a branch + --force(-f) # Force the operation + -D # Force-delete a branch + --list(-l) # List branches + --contains: by "nu-complete git refs" # Only branches that contain a commit + --no-contains: by "nu-complete git refs" # Only branches that do not contain a commit + --track(-t) # Set upstream when creating a branch + --no-verbose # Negate --verbose + --no-quiet # Negate --quiet + --no-track # Negate --track + --no-set-upstream-to # Negate --set-upstream-to + --no-unset-upstream # Negate --unset-upstream + --no-color # Negate --color + --no-abbrev # Negate --abbrev + --no-delete # Negate --delete + --no-move # Negate --move + -M # Move/rename a branch, even if target exists + --omit-empty # Do not output a newline after empty formatted refs + --no-omit-empty # Negate --omit-empty + --no-copy # Negate --copy + -C # Copy a branch, even if target exists + --no-list # Negate --list + --no-show-current # Negate --show-current + --create-reflog # Create the branch's reflog + --no-create-reflog # Negate --create-reflog + --no-edit-description # Negate --edit-description + --delete-merged: text # Delete merged branches whose upstream matches <pattern> (repeatable) + --dry-run # With --delete-merged, only print which branches would be deleted + --no-dry-run # Negate --dry-run + --no-force # Negate --force + --forked: text # Print only branches whose upstream matches <branch> (repeatable) + --column?: words [always never auto column row plain dense nodense] # List branches in columns + --no-column # Negate --column + --sort: words [refname -refname committerdate -committerdate creatordate -creatordate authordate -authordate taggerdate -taggerdate "version:refname" "-version:refname" objectsize -objectsize objecttype upstream HEAD] # Field name to sort on + --no-sort # Negate --sort + --no-points-at # Negate --points-at + --ignore-case(-i) # Sorting and filtering are case insensitive + --no-ignore-case # Negate --ignore-case + --recurse-submodules # Recurse through submodules + --no-recurse-submodules # Negate --recurse-submodules + --no-format # Negate --format +] where { + at-most-one [--delete --move --copy --list --show-current] + at-most-one [--merged --no-merged] + overrides [--force -D] +} + +export complete [git checkout] [ + ...targets: by "nu-complete git checkout-targets" # Branch, commit or files to check out + --conflict: words [merge diff3 zdiff3] # Conflict presentation + --detach(-d) # Detach HEAD at a commit + --force(-f) # Throw away local modifications + --guess # Second-guess a branch name + --no-guess # Do not second-guess a branch name + --ignore-other-worktrees # Ignore refs held by other worktrees + --ignore-skip-worktree-bits # Ignore sparse-checkout patterns + --merge(-m) # Merge local changes with the target + --orphan: by "nu-complete git local-branches" # Create an unparented branch + --ours(-2) # Check out our version of unmerged files + --theirs(-3) # Check out their version of unmerged files + --overlay # Use overlay mode + --overwrite-ignore # Update ignored files + --patch(-p) # Choose hunks interactively + --pathspec-from-file: path # Read pathspecs from a file + --progress # Force progress reporting + --quiet(-q) # Suppress progress reporting + --recurse-submodules # Update submodules recursively + --track(-t) # Set upstream information for a new branch + -b: by "nu-complete git new-branch" # Create and check out a new branch + -B: by "nu-complete git new-branch" # Create or reset and check out a branch + -l # Create a reflog for the new branch + --no-overlay # Negate --overlay + --auto-advance # Auto advance to the next file when selecting hunks interactively + --no-auto-advance # Negate --auto-advance + --no-quiet # Negate --quiet + --no-recurse-submodules # Negate --recurse-submodules + --no-progress # Negate --progress + --no-merge # Negate --merge + --no-conflict # Negate --conflict + --no-detach # Negate --detach + --no-track # Negate --track + --no-force # Negate --force + --no-orphan # Negate --orphan + --no-overwrite-ignore # Negate --overwrite-ignore + --no-ignore-other-worktrees # Negate --ignore-other-worktrees + --no-patch # Negate --patch + --unified(-U): text # Generate diffs with <n> lines context + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --no-ignore-skip-worktree-bits # Negate --ignore-skip-worktree-bits + --no-pathspec-from-file # Negate --pathspec-from-file + --pathspec-file-nul # With --pathspec-from-file, pathspec elements are separated with NUL character + --no-pathspec-file-nul # Negate --pathspec-file-nul +] where { + at-most-one [--ours --theirs] + at-most-one [-b -B --orphan] + overrides [--guess --no-guess] + overrides [--track -t] +} + +# A new branch's name is the user's to choose: no candidates, and the hint line says why. +@non-destructive +export def "nu-complete git new-branch" [] { + try { + {completions: [], message: "the name of the new branch"} + } catch { + [] + } +} + +export complete [git cherry] [ + upstream?: by "nu-complete git branches" # Upstream branch, defaulting to HEAD's upstream + head?: by "nu-complete git branches" # Working branch, defaulting to HEAD + limit?: by "nu-complete git commits" # Do not report commits up to and including this one + --verbose(-v) # Show the commit subjects next to the hashes + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --no-verbose # Negate --verbose +] + +export complete [git cherry-pick] [ + ...commit: by "nu-complete git commits" # Commits to cherry-pick + --edit(-e) # Edit the commit message + --no-commit(-n) # Apply the changes without committing + --signoff(-s) # Add a Signed-off-by trailer + --ff # Fast-forward if possible + --continue # Continue the operation in progress + --skip # Skip the current commit + --abort # Cancel the operation + --quit # Forget the operation in progress + --cleanup: words [strip whitespace verbatim scissors default] # How to strip spaces and #comments from message + --no-cleanup # Negate --cleanup + --commit # Opposite of --no-commit + --no-edit # Negate --edit + --no-signoff # Negate --signoff + --mainline(-m): text # Select mainline parent + --no-mainline # Negate --mainline + --rerere-autoupdate # Update the index with reused conflict resolution if possible + --no-rerere-autoupdate # Negate --rerere-autoupdate + --strategy: words [ort recursive resolve octopus ours subtree] # Merge strategy + --no-strategy # Negate --strategy + --strategy-option(-X): words [ours theirs ignore-space-change ignore-all-space ignore-space-at-eol ignore-cr-at-eol renormalize no-renormalize find-renames find-renames= rename-threshold= subtree= diff-algorithm=patience diff-algorithm=minimal diff-algorithm=histogram diff-algorithm=myers] # Option for merge strategy + --no-strategy-option # Negate --strategy-option + --gpg-sign(-S)?: text # GPG sign commit + --no-gpg-sign # Negate --gpg-sign + -x # Append commit name + --no-ff # Negate --ff + --allow-empty # Preserve initially empty commits + --no-allow-empty # Negate --allow-empty + --allow-empty-message # Allow commits with empty messages + --no-allow-empty-message # Negate --allow-empty-message + --keep-redundant-commits # Deprecated: use --empty=keep instead + --no-keep-redundant-commits # Negate --keep-redundant-commits + --empty: words [drop keep stop] # How to handle commits that become empty +] where { + at-most-one [--continue --skip --abort --quit] +} + +export complete [git clean] [ + ...pathspec: by "nu-complete git untracked-files" # Limit cleaning to these paths + --force(-f) # Remove files even when clean.requireForce is set + --dry-run(-n) # Show what would be removed + --interactive(-i) # Choose the files to remove interactively + --quiet(-q) # Do not print removed file names + --exclude(-e): text # Add an ignore pattern + -d # Remove whole untracked directories + -x # Remove ignored files as well + -X # Remove only ignored files + --no-quiet # Negate --quiet + --no-dry-run # Negate --dry-run + --no-force # Negate --force + --no-interactive # Negate --interactive +] where { + at-most-one [-x -X] + at-most-one [--interactive --dry-run] +} + +export complete [git clone] [ + repository: text # The repository to clone + directory?: path # The directory to clone into + --local(-l) # Clone from a local path + --no-local # Use the transport even for a local path + --no-hardlinks # Copy files instead of hardlinking + --shared(-s) # Share objects with the source repository + --reference: path # Borrow objects from this repository + --reference-if-able: path # Borrow from this repository if it exists + --dissociate # Stop borrowing after the clone + --quiet(-q) # Suppress progress reporting + --verbose(-v) # Be verbose + --progress # Report progress unless quiet + --server-option: text # Pass an option to the server + --no-checkout(-n) # Do not check out HEAD + --reject-shallow # Reject a shallow source + --no-reject-shallow # Accept a shallow source + --bare # Make a bare repository + --sparse # Initialize the sparse-checkout file + --filter: text # Partial clone filter + --mirror # Mirror all refs + --origin(-o): text # Name of the origin remote + --branch(-b): text # Branch to check out + --upload-pack(-u): text # Path to upload-pack on the other end + --template: path # Template directory + --config(-c): text # Set a config variable + --depth: text # Shallow clone this many commits + --shallow-since: text # Shallow clone newer commits + --shallow-exclude: text # Do not clone commits reachable from this revision + --single-branch # Clone the history of one branch + --no-single-branch # Clone the history of every branch + --no-tags # Do not clone tags + --recurse-submodules # Clone submodules + --shallow-submodules # Shallow-clone submodules + --no-shallow-submodules # Do not shallow-clone submodules + --remote-submodules # Update submodules from their remote + --no-remote-submodules # Do not update submodules from their remote + --separate-git-dir: path # Put the git directory elsewhere + --jobs(-j): text # Parallel submodule fetches + --no-verbose # Negate --verbose + --no-quiet # Negate --quiet + --no-progress # Negate --progress + --checkout # Opposite of --no-checkout + --no-bare # Negate --bare + --no-mirror # Negate --mirror + --hardlinks # Opposite of --no-hardlinks + --no-shared # Negate --shared + --no-recurse-submodules # Negate --recurse-submodules + --recursive?: path # Alias of --recurse-submodules + --no-recursive # Negate --recursive + --no-jobs # Negate --jobs + --no-template # Negate --template + --no-reference # Negate --reference + --no-reference-if-able # Negate --reference-if-able + --no-dissociate # Negate --dissociate + --no-origin # Negate --origin + --no-branch # Negate --branch + --revision: text # Clone single revision <rev> and check out + --no-revision # Negate --revision + --no-upload-pack # Negate --upload-pack + --no-depth # Negate --depth + --no-shallow-since # Negate --shallow-since + --no-shallow-exclude # Negate --shallow-exclude + --tags # Clone tags, and make later fetches not to follow them + --no-separate-git-dir # Negate --separate-git-dir + --ref-format: words [files reftable] # Specify the reference format to use + --no-ref-format # Negate --ref-format + --no-config # Negate --config + --no-server-option # Negate --server-option + --ipv4(-4) # Use IPv4 addresses only + --ipv6(-6) # Use IPv6 addresses only + --no-filter # Negate --filter + --also-filter-submodules # Apply partial clone filters to submodules + --no-also-filter-submodules # Negate --also-filter-submodules + --no-sparse # Negate --sparse + --bundle-uri: text # A URI for downloading bundles before fetching from origin remote + --no-bundle-uri # Negate --bundle-uri +] where { + at-most-one [--bare --mirror] + at-most-one [--single-branch --mirror] + overrides [--reject-shallow --no-reject-shallow] + overrides [--shallow-submodules --no-shallow-submodules] + overrides [--remote-submodules --no-remote-submodules] +} + +export complete [git commit] [ + ...pathspec: by "nu-complete git changed-files" # Commit only these paths + --all(-a) # Stage modified and deleted files + --amend # Amend the previous commit + --message(-m): text # The commit message + --reuse-message(-C): by "nu-complete git commits" # Reuse a commit's message + --reedit-message(-c): by "nu-complete git commits" # Reuse and edit a commit's message + --fixup: by "nu-complete git commits" # Create a fixup commit + --squash: by "nu-complete git commits" # Create a squash commit + --reset-author # Reset the author information + --short # Short dry-run output + --branch # Show branch information in short output + --porcelain # Porcelain dry-run output + --long # Long dry-run output + --null(-z) # Use NUL instead of LF in output + --file(-F): path # Read the message from a file + --author: text # Override the commit author + --date: text # Override the author date + --template(-t): path # Use a message template + --signoff(-s) # Add a Signed-off-by trailer + --no-signoff # Do not add a Signed-off-by trailer + --trailer: text # Add a trailer to the message + --no-verify(-n) # Bypass the hooks + --verify # Run the hooks + --allow-empty # Allow a commit with no changes + --allow-empty-message # Allow an empty message + --cleanup: words [strip whitespace verbatim scissors default] # Message cleanup mode + --edit(-e) # Edit the message + --patch(-p) # Choose hunks to commit + --interactive # Choose what to commit interactively + --no-edit # Do not edit the message + --include(-i) # Include the given paths in the commit + --only(-o) # Commit only the given paths + --pathspec-from-file: path # Read pathspecs from a file + --pathspec-file-nul # Separate pathspecs by NUL in the file + --untracked-files(-u): words [no normal all] # Show untracked files + --verbose(-v) # Show the diff in the message template + --quiet(-q) # Suppress the commit summary + --dry-run # Show paths to be committed, commit nothing + --status # Include git-status output in the message + --no-status # Do not include git-status output + --gpg-sign(-S) # GPG-sign the commit + --no-gpg-sign # Do not GPG-sign the commit + --no-quiet # Negate --quiet + --no-verbose # Negate --verbose + --no-file # Negate --file + --no-author # Negate --author + --no-date # Negate --date + --no-message # Negate --message + --no-reedit-message # Negate --reedit-message + --no-reuse-message # Negate --reuse-message + --no-fixup # Negate --fixup + --no-squash # Negate --squash + --no-reset-author # Negate --reset-author + --no-trailer # Negate --trailer + --no-template # Negate --template + --no-cleanup # Negate --cleanup + --no-all # Negate --all + --no-include # Negate --include + --no-interactive # Negate --interactive + --no-patch # Negate --patch + --unified(-U): text # Generate diffs with <n> lines context + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --no-only # Negate --only + --no-dry-run # Negate --dry-run + --no-short # Negate --short + --no-branch # Negate --branch + --ahead-behind # Compute full ahead/behind values + --no-ahead-behind # Negate --ahead-behind + --no-porcelain # Negate --porcelain + --no-long # Negate --long + --no-null # Negate --null + --no-amend # Negate --amend + --no-post-rewrite # Bypass post-rewrite hook + --post-rewrite # Opposite of --no-post-rewrite + --no-untracked-files # Negate --untracked-files + --no-pathspec-from-file # Negate --pathspec-from-file + --no-pathspec-file-nul # Negate --pathspec-file-nul +] where { + at-most-one [--message --file --reuse-message --reedit-message] + at-most-one [--short --porcelain --long] + at-most-one [--patch --interactive] + at-most-one [--include --only] + overrides [--signoff --no-signoff] + overrides [--verify --no-verify] + overrides [--status --no-status] + overrides [--gpg-sign --no-gpg-sign] +} + +export complete [git config] [ + name?: by "nu-complete git config-keys" # A configuration key + value?: text # A configuration value + --global(-g) # Use the global configuration + --local # Use the repository configuration + --system # Use the system configuration + --worktree # Use the worktree configuration + --file(-f): path # Use this file + --no-global # Negate --global + --no-system # Negate --system + --no-local # Negate --local + --no-worktree # Negate --worktree + --no-file # Negate --file + --blob: text # Read config from given blob object + --no-blob # Negate --blob + --get # Get value: name [<value-pattern>] + --get-all # Get all values: key [<value-pattern>] + --get-regexp # Get values for regexp: name-regex [<value-pattern>] + --get-urlmatch # Get value specific for the URL: section[.var] URL + --replace-all # Replace all matching variables: name value [<value-pattern>] + --add # Add a new variable: name value + --unset # Remove a variable: name [<value-pattern>] + --unset-all # Remove all matches: name [<value-pattern>] + --rename-section # Rename section: old-name new-name + --remove-section # Remove a section: name + --list(-l) # List all + --edit(-e) # Open an editor + --get-color # Find the color configured: slot [<default>] + --get-colorbool # Find the color setting: slot [<stdout-is-tty>] + --null(-z) # Terminate values with NUL byte + --no-null # Negate --null + --name-only # Show variable names only + --no-name-only # Negate --name-only + --show-origin # Show origin of config (file, standard input, blob, command line) + --no-show-origin # Negate --show-origin + --show-scope # Show scope of config (worktree, local, global, system, command) + --no-show-scope # Negate --show-scope + --show-names # Show config keys in addition to their values + --no-show-names # Negate --show-names + --type(-t): words [bool int bool-or-int bool-or-str path expiry-date color] # Value is given this type + --no-type # Negate --type + --bool # Value is "true" or "false" + --int # Value is decimal number + --bool-or-int # Value is --bool or --int + --bool-or-str # Value is --bool or string + --path # Value is a path (file or directory name) + --expiry-date # Value is an expiry date + --default: text # With --get, use default value when missing entry + --no-default # Negate --default + --comment: text # Human-readable comment string (# will be prepended as needed) + --no-comment # Negate --comment + --fixed-value # Use string equality when comparing values to value pattern + --no-fixed-value # Negate --fixed-value + --includes # Respect include directives on lookup + --no-includes # Negate --includes +] where { + at-most-one [--global --local --system --worktree --file] +} + +export complete [git config list] [ + --global(-g) # Read the global configuration + --local # Read the repository configuration + --system # Read the system configuration + --worktree # Read the worktree configuration + --file(-f): path # Read this file + --name-only # List keys without their values + --no-global # Negate --global + --no-system # Negate --system + --no-local # Negate --local + --no-worktree # Negate --worktree + --no-file # Negate --file + --blob: text # Read config from given blob object + --no-blob # Negate --blob + --null(-z) # Terminate values with NUL byte + --no-null # Negate --null + --no-name-only # Negate --name-only + --show-origin # Show origin of config (file, standard input, blob, command line) + --no-show-origin # Negate --show-origin + --show-scope # Show scope of config (worktree, local, global, system, command) + --no-show-scope # Negate --show-scope + --show-names # Show config keys in addition to their values + --no-show-names # Negate --show-names + --type(-t): words [bool int bool-or-int bool-or-str path expiry-date color] # Value is given this type + --no-type # Negate --type + --bool # Value is "true" or "false" + --int # Value is decimal number + --bool-or-int # Value is --bool or --int + --bool-or-str # Value is --bool or string + --path # Value is a path (file or directory name) + --expiry-date # Value is an expiry date + --includes # Respect include directives on lookup + --no-includes # Negate --includes +] where { + at-most-one [--global --local --system --worktree --file] +} + +export complete [git config get] [ + name: by "nu-complete git config-keys" # The key, as section.name + --global(-g) # Read the global configuration + --local # Read the repository configuration + --system # Read the system configuration + --worktree # Read the worktree configuration + --file(-f): path # Read this file + --default: text # Print this when the key is unset + --all # Print every value of a multi-valued key + --no-global # Negate --global + --no-system # Negate --system + --no-local # Negate --local + --no-worktree # Negate --worktree + --no-file # Negate --file + --blob: text # Read config from given blob object + --no-blob # Negate --blob + --no-all # Negate --all + --regexp # Interpret the name as a regular expression + --no-regexp # Negate --regexp + --value: text # Show config with values matching the pattern + --no-value # Negate --value + --fixed-value # Use string equality when comparing values to value pattern + --no-fixed-value # Negate --fixed-value + --url: text # Show config matching the given URL + --no-url # Negate --url + --null(-z) # Terminate values with NUL byte + --no-null # Negate --null + --name-only # Show variable names only + --no-name-only # Negate --name-only + --show-origin # Show origin of config (file, standard input, blob, command line) + --no-show-origin # Negate --show-origin + --show-scope # Show scope of config (worktree, local, global, system, command) + --no-show-scope # Negate --show-scope + --show-names # Show config keys in addition to their values + --no-show-names # Negate --show-names + --type(-t): words [bool int bool-or-int bool-or-str path expiry-date color] # Value is given this type + --no-type # Negate --type + --bool # Value is "true" or "false" + --int # Value is decimal number + --bool-or-int # Value is --bool or --int + --bool-or-str # Value is --bool or string + --path # Value is a path (file or directory name) + --expiry-date # Value is an expiry date + --includes # Respect include directives on lookup + --no-includes # Negate --includes + --no-default # Negate --default +] where { + at-most-one [--global --local --system --worktree --file] +} + +export complete [git config set] [ + name: by "nu-complete git config-keys" # The key, as section.name + value: text # The value to store + --global(-g) # Write the global configuration + --local # Write the repository configuration + --system # Write the system configuration + --worktree # Write the worktree configuration + --file(-f): path # Write this file + --type: words [bool int bool-or-int path expiry color] # Canonicalize the value as this type + --all # Replace every value of a multi-valued key + --no-global # Negate --global + --no-system # Negate --system + --no-local # Negate --local + --no-worktree # Negate --worktree + --no-file # Negate --file + --blob: text # Read config from given blob object + --no-blob # Negate --blob + --no-type # Negate --type + --bool # Value is "true" or "false" + --int # Value is decimal number + --bool-or-int # Value is --bool or --int + --bool-or-str # Value is --bool or string + --path # Value is a path (file or directory name) + --expiry-date # Value is an expiry date + --no-all # Negate --all + --value: text # Show config with values matching the pattern + --no-value # Negate --value + --fixed-value # Use string equality when comparing values to value pattern + --no-fixed-value # Negate --fixed-value + --comment: text # Human-readable comment string (# will be prepended as needed) + --no-comment # Negate --comment + --append # Add a new line without altering any existing values + --no-append # Negate --append +] where { + at-most-one [--global --local --system --worktree --file] +} + +export complete [git config unset] [ + name: by "nu-complete git config-keys" # The key, as section.name + --global(-g) # Write the global configuration + --local # Write the repository configuration + --system # Write the system configuration + --worktree # Write the worktree configuration + --file(-f): path # Write this file + --all # Unset every value of a multi-valued key + --no-global # Negate --global + --no-system # Negate --system + --no-local # Negate --local + --no-worktree # Negate --worktree + --no-file # Negate --file + --blob: text # Read config from given blob object + --no-blob # Negate --blob + --no-all # Negate --all + --value: text # Unset multi-valued config options with matching values + --no-value # Negate --value + --fixed-value # Use string equality when comparing values to value pattern + --no-fixed-value # Negate --fixed-value +] where { + at-most-one [--global --local --system --worktree --file] +} + +export complete [git config rename-section] [ + old_name: by "nu-complete git config-keys" # The section to rename + new_name: text # Its new name + --global(-g) # Write the global configuration + --local # Write the repository configuration + --system # Write the system configuration + --file(-f): path # Write this file + --no-global # Negate --global + --no-system # Negate --system + --no-local # Negate --local + --worktree # Use per-worktree config file + --no-worktree # Negate --worktree + --no-file # Negate --file + --blob: text # Read config from given blob object + --no-blob # Negate --blob +] where { + at-most-one [--global --local --system --file] +} + +export complete [git config remove-section] [ + section: by "nu-complete git config-keys" # The section to remove + --global(-g) # Write the global configuration + --local # Write the repository configuration + --system # Write the system configuration + --file(-f): path # Write this file + --no-global # Negate --global + --no-system # Negate --system + --no-local # Negate --local + --worktree # Use per-worktree config file + --no-worktree # Negate --worktree + --no-file # Negate --file + --blob: text # Read config from given blob object + --no-blob # Negate --blob +] where { + at-most-one [--global --local --system --file] +} + +export complete [git config edit] [ + --global(-g) # Edit the global configuration + --local # Edit the repository configuration + --system # Edit the system configuration + --worktree # Edit the worktree configuration + --file(-f): path # Edit this file + --no-global # Negate --global + --no-system # Negate --system + --no-local # Negate --local + --no-worktree # Negate --worktree + --no-file # Negate --file + --blob: text # Read config from given blob object + --no-blob # Negate --blob +] where { + at-most-one [--global --local --system --worktree --file] +} + +export complete [git diff] [ + rev1?: git.range with { root.from: by "nu-complete git diff-start" root.to: by "nu-complete git refs" } # First revision, or a path + rev2?: by "nu-complete git refs" # Second revision + ...paths: path # Limit the diff to these paths + --cached # Show staged changes + --staged # Alias for --cached + --stat # Show a diffstat + --numstat # Show added and removed lines per file + --shortstat # Show only the summary line + --name-only # Show only the names of changed files + --name-status # Show the names and kinds of change + --no-color # Disable color output + --patch(-p) # Show the patch + --quiet(-q) # Disable the patch + --src-prefix: text # Source prefix + --dst-prefix: text # Destination prefix + --find-renames: text # Rename detection threshold + --merge-base # Use the merge base of <commit> and HEAD instead of <commit> + --no-index # Compare two paths on the filesystem + --base(-1) # Compare the working tree with the base version + --ours(-2) # Compare the working tree with our branch + --theirs(-3) # Compare the working tree with their branch + -0 # Omit diff output for unmerged entries and just show "Unmerged" + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file +] where { + at-most-one [--stat --numstat --shortstat --name-only --name-status] + overrides [--cached --staged] + overrides [--patch --quiet] +} + +export complete [git fetch] [ + repository?: by "nu-complete git remotes" # The remote to fetch + ...refspec: by "nu-complete git remote-branch-names" # Refs to fetch + --all # Fetch all remotes + --append(-a) # Append to FETCH_HEAD + --atomic # Use an atomic transaction + --depth: text # Limit fetching to this many commits + --deepen: text # Deepen the shallow boundary + --shallow-since: text # Deepen or shorten by date + --shallow-exclude: text # Deepen or shorten by branch or tag + --unshallow # Fetch all available history + --update-shallow # Update .git/shallow + --negotiation-tip: text # Commits to report while fetching + --negotiate-only # Only print common ancestors + --dry-run # Show what would be done + --write-fetch-head # Write FETCH_HEAD + --no-write-fetch-head # Do not write FETCH_HEAD + --force(-f) # Always update the local branch + --keep(-k) # Keep the downloaded pack + --multiple # Allow several arguments + --prefetch # Place refs in refs/prefetch/ + --prune(-p) # Remove obsolete remote-tracking refs + --prune-tags(-P) # Remove local tags missing on the remote + --no-tags(-n) # Disable automatic tag following + --refmap: text # Refspec used to map refs + --tags(-t) # Fetch all tags + --recurse-submodules: words [yes on-demand no] # Fetch new submodule commits + --no-recurse-submodules # Do not fetch submodule commits + --jobs(-j): text # Parallel children + --set-upstream # Add an upstream reference + --submodule-prefix: text # Prefix for submodule paths + --upload-pack: text # Path to upload-pack on the remote + --quiet(-q) # Silence internal git commands + --verbose(-v) # Be verbose + --progress # Report progress on stderr + --server-option(-o): text # Pass an option to the server + --show-forced-updates # Check for forced updates + --no-show-forced-updates # Do not check for forced updates + -4 # Use IPv4 only + -6 # Use IPv6 only + --no-verbose # Negate --verbose + --no-quiet # Negate --quiet + --no-all # Negate --all + --no-set-upstream # Negate --set-upstream + --no-append # Negate --append + --no-atomic # Negate --atomic + --no-upload-pack # Negate --upload-pack + --no-force # Negate --force + --no-multiple # Negate --multiple + --no-jobs # Negate --jobs + --no-prefetch # Negate --prefetch + --no-prune # Negate --prune + --no-prune-tags # Negate --prune-tags + --no-dry-run # Negate --dry-run + --porcelain # Machine-readable output + --no-porcelain # Negate --porcelain + --no-keep # Negate --keep + --update-head-ok(-u) # Allow updating of HEAD ref + --no-update-head-ok # Negate --update-head-ok + --no-progress # Negate --progress + --no-depth # Negate --depth + --no-shallow-since # Negate --shallow-since + --no-shallow-exclude # Negate --shallow-exclude + --no-deepen # Negate --deepen + --refetch # Re-fetch without negotiating common commits + --no-update-shallow # Negate --update-shallow + --no-server-option # Negate --server-option + --ipv4 # Use IPv4 addresses only + --ipv6 # Use IPv6 addresses only + --negotiation-restrict: text # Report that we have only objects reachable from this object + --no-negotiation-restrict # Negate --negotiation-restrict + --no-negotiation-tip # Negate --negotiation-tip + --negotiation-include: text # Ensure this ref is always sent as a negotiation have + --no-negotiation-include # Negate --negotiation-include + --no-negotiate-only # Negate --negotiate-only + --filter: words ["blob:none" "blob:limit=" "tree:0" "tree:1" "sparse:oid=" "object:type=blob" "object:type=tree" "combine:"] # Object filtering + --no-filter # Negate --filter + --auto-maintenance # Run 'maintenance --auto' after fetching + --no-auto-maintenance # Negate --auto-maintenance + --auto-gc # Run 'maintenance --auto' after fetching + --no-auto-gc # Negate --auto-gc + --write-commit-graph # Write the commit-graph after fetching + --no-write-commit-graph # Negate --write-commit-graph + --stdin # Accept refspecs from stdin + --no-stdin # Negate --stdin +] where { + at-most-one [--all --multiple] + at-most-one [-4 -6] + at-most-one [--prune --prune-tags] + overrides [--write-fetch-head --no-write-fetch-head] + overrides [--show-forced-updates --no-show-forced-updates] + overrides [--recurse-submodules --no-recurse-submodules] +} + +export complete [git grep] [ + ...pathspecs: by "nu-complete git files" # Limit the search to these paths + -e: text # The pattern, repeatable + -f: path # Read patterns from a file + --cached # Search the index instead of the working tree + --untracked # Include untracked files + --no-index # Search files outside the index + --no-exclude-standard # Include ignored files + --exclude-standard # Respect the ignore rules + --recurse-submodules # Search active submodules + --text(-a) # Treat binary files as text + --textconv # Honor textconv filters + --no-textconv # Ignore textconv filters + --ignore-case(-i) # Ignore case + -I # Do not match in binary files + --max-depth: text # Maximum directory depth + --recursive(-r) # Same as --max-depth=-1 + --no-recursive # Same as --max-depth=0 + --word-regexp(-w) # Match at word boundaries + --invert-match(-v) # Select non-matching lines + -H # Suppress filenames + --full-name # Print paths from the top directory + --extended-regexp(-E) # POSIX extended regular expressions + --basic-regexp(-G) # POSIX basic regular expressions + --perl-regexp(-P) # Perl-compatible regular expressions + --line-number(-n) # Prefix line numbers + --column # Prefix the byte offset of the match + --files-with-matches(-l) # Print only the matching file names + --name-only # Same as --files-with-matches + --files-without-match(-L) # Print only the non-matching file names + --null(-z) # Terminate pathnames with NUL + --only-matching(-o) # Print only the matches + --count(-c) # Print a count per file + --no-color # Disable color output + --break # Print an empty line between files + --heading # Print the file name above its matches + --show-function(-p) # Show the enclosing function + --context(-C): text # Leading and trailing context lines + --after-context(-A): text # Trailing context lines + --before-context(-B): text # Leading context lines + --function-context(-W) # Show the whole enclosing function + --max-count(-m): text # Matches per file + --threads: text # Grep worker threads + --and # Conjunction of patterns + --or # Disjunction of patterns + --not # Negation of a pattern + --all-match # Require all patterns on the same line + --quiet(-q) # Do not print matches; use the exit status + --no-cached # Negate --cached + --index # Opposite of --no-index + --no-untracked # Negate --untracked + --no-recurse-submodules # Negate --recurse-submodules + --no-invert-match # Negate --invert-match + --no-ignore-case # Negate --ignore-case + --no-word-regexp # Negate --word-regexp + --no-text # Negate --text + --no-extended-regexp # Negate --extended-regexp + --no-basic-regexp # Negate --basic-regexp + --fixed-strings(-F) # Interpret patterns as fixed strings + --no-fixed-strings # Negate --fixed-strings + --no-perl-regexp # Negate --perl-regexp + --no-line-number # Negate --line-number + --no-column # Negate --column + --no-full-name # Negate --full-name + --no-files-with-matches # Negate --files-with-matches + --no-name-only # Negate --name-only + --no-files-without-match # Negate --files-without-match + --no-null # Negate --null + --no-only-matching # Negate --only-matching + --no-count # Negate --count + --color?: words [always never auto] # Highlight matches + --no-break # Negate --break + --no-heading # Negate --heading + --no-context # Negate --context + --no-threads # Negate --threads + --no-show-function # Negate --show-function + --no-function-context # Negate --function-context + --no-quiet # Negate --quiet + --no-all-match # Negate --all-match + --open-files-in-pager(-O)?: text # Show matching files in the pager + --no-open-files-in-pager # Negate --open-files-in-pager + --ext-grep # Allow calling of grep(1) (ignored by this build) + --no-ext-grep # Negate --ext-grep + --no-max-count # Negate --max-count +] where { + at-most-one [--cached --untracked --no-index] + at-most-one [--extended-regexp --basic-regexp --perl-regexp] + at-most-one [-e -f] + overrides [--textconv --no-textconv] + overrides [--recursive --no-recursive] +} + +export complete [git init] [ + directory?: path # The directory to initialize + --initial-branch(-b): text # The initial branch name + --bare # Create a bare repository + --template: path # The template directory + --separate-git-dir: path # Put the git directory elsewhere + --shared: text # Share the repository + --quiet(-q) # Be quiet + --object-format: words [sha1 sha256] # The object format + --no-template # Negate --template + --no-bare # Negate --bare + --no-quiet # Negate --quiet + --no-separate-git-dir # Negate --separate-git-dir + --no-initial-branch # Negate --initial-branch + --no-object-format # Negate --object-format + --ref-format: words [files reftable] # Specify the reference format to use + --no-ref-format # Negate --ref-format +] + +export complete [git log] [ + rev?: by "nu-complete git refs" # The revision to start from + ...paths: path # Limit the history to these paths + --follow # Follow the history beyond renames + --grep: text # Show commits matching a regular expression + --format: by "nu-complete git log-format" # Print each commit in this format + --pretty: by "nu-complete git log-format" # Print each commit in this format + --date: by "nu-complete git log-date" # Show dates in this format + --oneline # One line per commit + --graph # Draw the history as a graph + --all # Show the history of every ref + --decorate # Show the refs that point at each commit + --author: text # Show only the commits of an author + --since: text # Show only commits newer than a date + --until: text # Show only commits older than a date + -S: text # Show commits that change the number of occurrences of a string + --stat # Show a diffstat for each commit + --patch(-p) # Show the patch of each commit + --no-color # Disable color output + --reverse # Show the oldest commits first + --max-count(-n): text # Show at most this many commits + --abbrev-commit # Show abbreviated commit hashes + --first-parent # Follow only the first parent + --quiet(-q) # Suppress diff output + --no-quiet # Negate --quiet + --source # Show source + --no-source # Negate --source + --use-mailmap # Use mail map file + --no-use-mailmap # Negate --use-mailmap + --mailmap # Alias of --use-mailmap + --no-mailmap # Negate --mailmap + --clear-decorations # Clear all previously-defined decoration filters + --decorate-refs: text # Only decorate refs that match <pattern> + --no-decorate-refs # Negate --decorate-refs + --decorate-refs-exclude: text # Do not decorate refs that match <pattern> + --no-decorate-refs-exclude # Negate --decorate-refs-exclude + --no-decorate # Negate --decorate + -L: path # Trace the evolution of line range <start>,<end> or function :<funcname> in <file> + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file + --skip: text # Skip number commits before starting to show the output + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --committer: by "nu-complete git authors" # Limit to commits whose committer matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --no-abbrev-commit # Show the full commit object name + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + -c # Show combined diff format for merge commits + --cc # Show dense combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + -t # Show the tree objects in the diff output + --log-size # Include a line with the log message length in bytes + --count # Print a number stating how many commits would have been listed +] where { + overrides [--format --pretty] + overrides [--patch --stat] +} + +export complete [git merge] [ + branch?: by "nu-complete git branches" # The branch to merge + --edit(-e) # Edit the commit message + --no-edit # Do not edit the commit message + --no-ff # Always create a merge commit + --no-commit(-n) # Apply the changes without committing + --signoff # Add a Signed-off-by trailer + --ff # Fast-forward if possible + --continue # Continue after resolving a conflict + --abort # Abort and restore the original state + --quit # Forget the merge in progress + --strategy(-s): by "nu-complete git merge-strategies" # Merge strategy + -X: by "nu-complete git merge-strategy-options" # Strategy-specific option + --ff-only # Refuse to merge unless a fast-forward + --stat # Show a diffstat at the end + --no-stat # Do not show a diffstat + --verify # Run the merge hooks + --no-verify # Do not run the merge hooks + --verbose(-v) # Be verbose + --summary # (synonym to --stat) + --no-summary # Negate --summary + --compact-summary # Show a compact-summary at the end of the merge + --no-compact-summary # Negate --compact-summary + --log?: text # Add (at most <n>) entries from shortlog to merge commit message + --no-log # Negate --log + --squash # Create a single commit instead of doing a merge + --no-squash # Negate --squash + --commit # Perform a commit if the merge succeeds (default) + --cleanup: words [strip whitespace verbatim scissors default] # How to strip spaces and #comments from message + --no-cleanup # Negate --cleanup + --rerere-autoupdate # Update the index with reused conflict resolution if possible + --no-rerere-autoupdate # Negate --rerere-autoupdate + --verify-signatures # Verify that the named commit has a valid GPG signature + --no-verify-signatures # Negate --verify-signatures + --no-strategy # Negate --strategy + --strategy-option: words [ours theirs ignore-space-change ignore-all-space ignore-space-at-eol ignore-cr-at-eol renormalize no-renormalize find-renames find-renames= rename-threshold= subtree= diff-algorithm=patience diff-algorithm=minimal diff-algorithm=histogram diff-algorithm=myers] # Option for selected merge strategy + --no-strategy-option # Negate --strategy-option + --message(-m): text # Merge commit message (for a non-fast-forward merge) + --no-message # Negate --message + --file(-F): path # Read message from file + --into-name: text # Use <name> instead of the real target + --no-into-name # Negate --into-name + --no-verbose # Negate --verbose + --quiet(-q) # Be more quiet + --no-quiet # Negate --quiet + --no-abort # Negate --abort + --no-quit # Negate --quit + --no-continue # Negate --continue + --allow-unrelated-histories # Allow merging unrelated histories + --no-allow-unrelated-histories # Negate --allow-unrelated-histories + --progress # Force progress reporting + --no-progress # Negate --progress + --gpg-sign(-S)?: text # GPG sign commit + --no-gpg-sign # Negate --gpg-sign + --autostash # Automatically stash/stash pop before and after + --no-autostash # Negate --autostash + --overwrite-ignore # Update ignored files (default) + --no-overwrite-ignore # Negate --overwrite-ignore + --no-signoff # Negate --signoff +] where { + at-most-one [--ff-only --no-ff] + at-most-one [--abort --continue --quit] + at-most-one [--ff --no-ff --ff-only] + overrides [--edit --no-edit] + overrides [--stat --no-stat] + overrides [--verify --no-verify] +} + +export complete [git mv] [ + ...paths: by "nu-complete git files" # The sources, then the destination + --force(-f) # Move even if the destination exists + --dry-run(-n) # Show what would be moved + --verbose(-v) # Report each move + -k # Skip moves that would error + --sparse # Allow updating the index outside the sparse cone + --no-verbose # Negate --verbose + --no-dry-run # Negate --dry-run + --no-force # Negate --force + --no-sparse # Negate --sparse +] + +export complete [git pull] [ + remote?: by "nu-complete git remotes" # The remote to pull from + ...refspec: by "nu-complete git remote-branch-names" # The branch or refspec to pull + --rebase(-r): by "nu-complete git pull-rebase" # Rebase on top of the upstream + --no-rebase # Do not rebase + --ff-only # Refuse to merge unless a fast-forward + --quiet(-q) # Suppress output + --verbose(-v) # Be verbose + --commit # Commit the merge + --no-commit # Do not commit the merge + --edit(-e) # Edit the merge commit message + --no-edit # Use the generated merge message + --cleanup: words [strip whitespace verbatim scissors default] # Message cleanup mode + --ff # Fast-forward if possible + --no-ff # Create a merge commit in all cases + --gpg-sign(-S) # GPG-sign the merge commit + --no-gpg-sign # Do not GPG-sign the merge commit + --log: text # Include messages from merged commits + --no-log # Do not include merged commit messages + --signoff # Add a Signed-off-by trailer + --no-signoff # Do not add a Signed-off-by trailer + --stat(-n) # Show a diffstat at the end + --no-stat # Do not show a diffstat + --squash # Produce the state as if a merge happened, without committing + --no-squash # Perform and commit the merge + --verify # Run the merge hooks + --no-verify # Do not run the merge hooks + --strategy(-s): by "nu-complete git merge-strategies" # Merge strategy + --strategy-option(-X): by "nu-complete git merge-strategy-options" # Strategy-specific option + --autostash # Stash around the operation + --no-autostash # Do not stash around the operation + --allow-unrelated-histories # Merge histories without a common ancestor + --all # Fetch all remotes + --tags(-t) # Fetch all tags + --depth: text # Limit fetching to this many commits + --deepen: text # Deepen the shallow boundary + --jobs(-j): text # Parallel fetching children + --set-upstream # Add an upstream reference + --progress # Force progress reporting + --no-verbose # Negate --verbose + --no-quiet # Negate --quiet + --no-progress # Negate --progress + --recurse-submodules?: words [yes on-demand no] # Control for recursive fetching of submodules + --no-recurse-submodules # Negate --recurse-submodules + --compact-summary # Show a compact-summary at the end of the merge + --no-compact-summary # Negate --compact-summary + --no-cleanup # Negate --cleanup + --verify-signatures # Verify that the named commit has a valid GPG signature + --no-verify-signatures # Negate --verify-signatures + --no-strategy # Negate --strategy + --no-strategy-option # Negate --strategy-option + --no-allow-unrelated-histories # Negate --allow-unrelated-histories + --no-all # Negate --all + --append(-a) # Append to .git/FETCH_HEAD instead of overwriting + --no-append # Negate --append + --upload-pack: path # Path to upload pack on remote end + --no-upload-pack # Negate --upload-pack + --force(-f) # Force overwrite of local branch + --no-force # Negate --force + --no-tags # Negate --tags + --prune(-p) # Prune remote-tracking branches no longer on remote + --no-prune # Negate --prune + --no-jobs # Negate --jobs + --dry-run # Dry run + --no-dry-run # Negate --dry-run + --keep(-k) # Keep downloaded pack + --no-keep # Negate --keep + --no-depth # Negate --depth + --shallow-since: text # Deepen history of shallow repository based on time + --no-shallow-since # Negate --shallow-since + --shallow-exclude: by "nu-complete git refs" # Deepen history of shallow clone, excluding ref + --no-shallow-exclude # Negate --shallow-exclude + --no-deepen # Negate --deepen + --unshallow # Convert to a complete repository + --update-shallow # Accept refs that update .git/shallow + --no-update-shallow # Negate --update-shallow + --refmap: text # Specify fetch refmap + --server-option(-o): text # Option to transmit + --no-server-option # Negate --server-option + --ipv4(-4) # Use IPv4 addresses only + --no-ipv4 # Negate --ipv4 + --ipv6(-6) # Use IPv6 addresses only + --no-ipv6 # Negate --ipv6 + --negotiation-restrict: text # Report that we have only objects reachable from this object + --no-negotiation-restrict # Negate --negotiation-restrict + --negotiation-tip: by "nu-complete git refs" # Alias of --negotiation-restrict + --no-negotiation-tip # Negate --negotiation-tip + --negotiation-include: text # Ensure this ref is always sent as a negotiation have + --no-negotiation-include # Negate --negotiation-include + --show-forced-updates # Check for forced-updates on all updated branches + --no-show-forced-updates # Negate --show-forced-updates + --no-set-upstream # Negate --set-upstream +] where { + at-most-one [--rebase --no-rebase] + at-most-one [--ff-only --no-ff] + at-most-one [--commit --no-commit] + at-most-one [--ff --no-ff --ff-only] + overrides [--edit --no-edit] + overrides [--gpg-sign --no-gpg-sign] + overrides [--log --no-log] + overrides [--signoff --no-signoff] + overrides [--stat --no-stat] + overrides [--squash --no-squash] + overrides [--verify --no-verify] + overrides [--autostash --no-autostash] +} + +export complete [git push] [ + remote?: by "nu-complete git remotes" # The remote to push to + ...refs: by "nu-complete git local-branches" # The refspecs to push + --all # Push all refs + --atomic # Request an atomic transaction + --delete(-d) # Delete refs + --no-delete # Do not delete refs + --dry-run(-n) # Show what would be pushed + --exec: text # The receive-pack program + --follow-tags # Push missing but relevant tags + --force-with-lease # Require the old value of the ref + --force(-f) # Force updates + --ipv4(-4) # Use IPv4 only + --ipv6(-6) # Use IPv6 only + --mirror # Mirror all refs + --no-verify # Bypass the pre-push hook + --porcelain # Machine-readable output + --progress # Force progress reporting + --prune # Prune locally removed refs + --push-option(-o): text # An option to transmit + --quiet(-q) # Be quiet + --receive-pack: text # The receive-pack program + --recurse-submodules: words [check no on-demand only] # Control recursive pushing + --repo: text # The repository + --set-upstream(-u) # Set the upstream for git pull/status + --signed: words [true false if-asked] # GPG-sign the push + --tags # Push tags + --thin # Use a thin pack + --verbose(-v) # Be verbose + --no-verbose # Negate --verbose + --no-quiet # Negate --quiet + --no-repo # Negate --repo + --no-all # Negate --all + --branches # Alias of --all + --no-branches # Negate --branches + --no-mirror # Negate --mirror + --no-tags # Negate --tags + --no-dry-run # Negate --dry-run + --no-porcelain # Negate --porcelain + --no-force # Negate --force + --no-force-with-lease # Negate --force-with-lease + --force-if-includes # Require remote updates to be integrated locally + --no-force-if-includes # Negate --force-if-includes + --no-recurse-submodules # Negate --recurse-submodules + --no-thin # Negate --thin + --no-receive-pack # Negate --receive-pack + --no-exec # Negate --exec + --no-set-upstream # Negate --set-upstream + --no-progress # Negate --progress + --no-prune # Negate --prune + --verify # Opposite of --no-verify + --no-follow-tags # Negate --follow-tags + --no-signed # Negate --signed + --no-atomic # Negate --atomic + --no-push-option # Negate --push-option +] where { + at-most-one [--force --force-with-lease] + at-most-one [--all --mirror --tags] + at-most-one [--ipv4 --ipv6] + overrides [--delete --no-delete] +} + +export complete [git rebase] [ + branch?: by "nu-complete git refs" # The branch to rebase onto + upstream?: by "nu-complete git refs" # The upstream to compare against + --continue # Continue the rebase + --abort # Abort and reset HEAD to the original branch + --quit # Abort but do not reset HEAD + --interactive(-i) # Rebase interactively + --onto: by "nu-complete git refs" # The new base + --autosquash # Move fixup and squash commits into place + --skip # Skip the current commit + --root # Rebase from the root commit + --exec(-x): text # Run a command after each commit + --empty: words [drop keep stop] # How to handle commits that become empty + --keep-base # Use the merge base as the new base + --show-current-patch # Show the current patch + --fork-point # Use the fork point + --no-fork-point # Do not use the fork point + --stat # Show a diffstat + --no-stat # Do not show a diffstat + --no-onto # Negate --onto + --no-keep-base # Negate --keep-base + --no-verify # Allow pre-rebase hook to run + --verify # Opposite of --no-verify + --quiet(-q) # Be quiet. implies --no-stat + --no-quiet # Negate --quiet + --verbose(-v) # Display a diffstat of what changed upstream + --no-verbose # Negate --verbose + --trailer: text # Add custom trailer(s) + --no-trailer # Negate --trailer + --signoff # Add a Signed-off-by trailer to each commit + --no-signoff # Negate --signoff + --committer-date-is-author-date # Make committer date match author date + --no-committer-date-is-author-date # Negate --committer-date-is-author-date + --reset-author-date # Ignore author date and use current date + --no-reset-author-date # Negate --reset-author-date + -C: text # Passed to 'git apply' + --ignore-whitespace # Ignore changes in whitespace + --no-ignore-whitespace # Negate --ignore-whitespace + --whitespace: words [nowarn warn fix error error-all] # Passed to 'git apply' + --no-whitespace # Negate --whitespace + --force-rebase(-f) # Cherry-pick all commits, even if unchanged + --no-force-rebase # Negate --force-rebase + --no-ff # Cherry-pick all commits, even if unchanged + --ff # Opposite of --no-ff + --edit-todo # Edit the todo list during an interactive rebase + --apply # Use apply strategies to rebase + --merge(-m) # Use merging strategies to rebase + --rerere-autoupdate # Update the index with reused conflict resolution if possible + --no-rerere-autoupdate # Negate --rerere-autoupdate + --no-autosquash # Negate --autosquash + --update-refs # Update branches that point to commits that are being rebased + --no-update-refs # Negate --update-refs + --gpg-sign(-S)?: text # GPG-sign commits + --no-gpg-sign # Negate --gpg-sign + --autostash # Automatically stash/stash pop before and after + --no-autostash # Negate --autostash + --no-exec # Negate --exec + --rebase-merges(-r)?: words [rebase-cousins no-rebase-cousins] # Try to rebase merges instead of skipping them + --no-rebase-merges # Negate --rebase-merges + --strategy(-s): words [ort recursive resolve octopus ours subtree] # Use the given merge strategy + --no-strategy # Negate --strategy + --strategy-option(-X): words [ours theirs ignore-space-change ignore-all-space ignore-space-at-eol ignore-cr-at-eol renormalize no-renormalize find-renames find-renames= rename-threshold= subtree= diff-algorithm=patience diff-algorithm=minimal diff-algorithm=histogram diff-algorithm=myers] # Pass the argument through to the merge strategy + --no-strategy-option # Negate --strategy-option + --no-root # Negate --root + --reschedule-failed-exec # Automatically re-schedule any `exec` that fails + --no-reschedule-failed-exec # Negate --reschedule-failed-exec + --reapply-cherry-picks # Apply all changes, even those already present upstream + --no-reapply-cherry-picks # Negate --reapply-cherry-picks +] where { + at-most-one [--continue --skip --abort --quit] + at-most-one [--keep-base --root] + overrides [--fork-point --no-fork-point] + overrides [--stat --no-stat] +} + +export complete [git remote] [ + --verbose(-v) # Show the URLs of the remotes + --no-verbose # Negate --verbose +] + +export complete [git remote add] [ + name: text # The name of the new remote + url: text # The URL the remote fetches from + --fetch(-f) # Fetch after adding + --tags # Import every tag + --mirror: words [fetch push] # Set up mirror refspecs +] + +export complete [git remote rename] [ + remote: by "nu-complete git remotes" # The remote to rename + new_name: text # The new name for the remote +] + +export complete [git remote remove] [ + remote: by "nu-complete git remotes" # The remote to remove +] + +export complete [git remote get-url] [ + remote: by "nu-complete git remotes" # The remote to inspect + --push # Show the push URL + --all # Show every URL +] + +export complete [git remote set-url] [ + remote: by "nu-complete git remotes" # The remote to set the URL for + url: text # The new URL + --push # Set the push URL + --add # Add a URL instead of replacing one + --delete # Delete a URL +] where { + at-most-one [--add --delete] +} + +export complete [git reflog] [ + ...ref: by "nu-complete git refs" # The reflog to show, such as HEAD or a branch + --date: by "nu-complete git log-date" # Show times in this format + --all # Show every ref, not just HEAD + --no-color # Disable color output + --max-count(-n): text # Show at most this many entries + --patch(-p) # Generate patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --quiet # Disable all output of the program + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file + --skip: text # Skip number commits before starting to show the output + --since: text # Show commits more recent than a specific date + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --until: text # Show commits older than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --author: by "nu-complete git authors" # Limit to commits whose author matches the pattern + --committer: by "nu-complete git authors" # Limit to commits whose committer matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --grep: text # Limit to commits whose log message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --first-parent # Follow only the first parent commit upon seeing a merge commit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --reverse # Output the selected commits in reverse order + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --pretty?: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --format: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --abbrev-commit # Show a prefix of the commit object name + --no-abbrev-commit # Show the full commit object name + --oneline # Shorthand for --pretty=oneline --abbrev-commit + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --graph # Draw a text-based graphical representation of the commit history + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + -c # Show combined diff format for merge commits + --cc # Show dense combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + -t # Show the tree objects in the diff output + --log-size # Include a line with the log message length in bytes + --count # Print a number stating how many commits would have been listed +] + +export complete [git reset] [ + ...targets: by "nu-complete git files-or-refs" # A commit, branch or files to reset + --hard # Reset HEAD, index and working tree + --keep # Reset HEAD but keep local changes + --merge # Reset HEAD, index and working tree + --mixed # Reset HEAD and index + --soft # Reset only HEAD + --patch(-p) # Choose hunks interactively + --quiet(-q) # Report only errors + --pathspec-from-file: path # Read pathspecs from a file + --pathspec-file-nul # Separate pathspecs by NUL in the file + --no-refresh # Skip refreshing the index + --recurse-submodules: words [checkout reset] # Control recursive updates of submodules + --no-recurse-submodules # Do not recurse into submodules + --no-quiet # Negate --quiet + --refresh # Opposite of --no-refresh + --no-patch # Negate --patch + --auto-advance # Auto advance to the next file when selecting hunks interactively + --no-auto-advance # Negate --auto-advance + --unified(-U): text # Generate diffs with <n> lines context + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --intent-to-add(-N) # Record only the fact that removed paths will be added later + --no-intent-to-add # Negate --intent-to-add + --no-pathspec-from-file # Negate --pathspec-from-file + --no-pathspec-file-nul # Negate --pathspec-file-nul +] where { + at-most-one [--soft --mixed --hard --merge --keep] + overrides [--recurse-submodules --no-recurse-submodules] +} + +export complete [git restore] [ + ...pathspecs: by "nu-complete git restore-files" [staged: --staged, worktree: --worktree] # The paths to restore + --source(-s): by "nu-complete git refs" # Restore from this tree + --staged(-S) # Restore the index + --worktree(-W) # Restore the working tree + --patch(-p) # Choose hunks interactively + --quiet(-q) # Suppress feedback messages + --progress # Force progress reporting + --no-progress # Suppress progress reporting + --ours # Use our version for unmerged files + --theirs # Use their version for unmerged files + --merge(-m) # Recreate the conflicted merge + --conflict: words [merge diff3 zdiff3] # Conflict presentation + --ignore-unmerged # Leave unmerged files as they are + --ignore-skip-worktree-bits # Ignore sparse-checkout patterns + --recurse-submodules # Restore submodule contents + --no-recurse-submodules # Do not restore submodule contents + --overlay # Do not remove files missing from the source + --no-overlay # Remove files missing from the source + --pathspec-from-file: path # Read pathspecs from a file + --pathspec-file-nul # Separate pathspecs by NUL in the file + --no-source # Negate --source + --no-staged # Negate --staged + --no-worktree # Negate --worktree + --no-ignore-unmerged # Negate --ignore-unmerged + --no-quiet # Negate --quiet + --no-merge # Negate --merge + --no-conflict # Negate --conflict + --no-patch # Negate --patch + --unified(-U): text # Generate diffs with <n> lines context + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --no-ignore-skip-worktree-bits # Negate --ignore-skip-worktree-bits + --no-pathspec-from-file # Negate --pathspec-from-file + --no-pathspec-file-nul # Negate --pathspec-file-nul +] where { + at-most-one [--ours --theirs --merge] + at-most-one [--staged --worktree] + overrides [--progress --no-progress] + overrides [--recurse-submodules --no-recurse-submodules] + overrides [--overlay --no-overlay] +} + +export complete [git revert] [ + ...commit: by "nu-complete git commits" # The commits to revert + --no-commit(-n) # Apply the inverse without committing + --edit(-e) # Edit the commit message + --no-edit # Do not edit the commit message + --mainline(-m): text # The parent number of the merge commit + --signoff # Add a Signed-off-by trailer + --strategy(-s): by "nu-complete git merge-strategies" # Merge strategy + -X: by "nu-complete git merge-strategy-options" # Strategy-specific option + --continue # Continue after resolving a conflict + --skip # Skip the current commit + --abort # Abort and restore the original state + --quit # Forget the revert in progress + --cleanup: words [strip whitespace verbatim scissors default] # How to strip spaces and #comments from message + --no-cleanup # Negate --cleanup + --commit # Opposite of --no-commit + --no-signoff # Negate --signoff + --no-mainline # Negate --mainline + --rerere-autoupdate # Update the index with reused conflict resolution if possible + --no-rerere-autoupdate # Negate --rerere-autoupdate + --no-strategy # Negate --strategy + --strategy-option: words [ours theirs ignore-space-change ignore-all-space ignore-space-at-eol ignore-cr-at-eol renormalize no-renormalize find-renames find-renames= rename-threshold= subtree= diff-algorithm=patience diff-algorithm=minimal diff-algorithm=histogram diff-algorithm=myers] # Option for merge strategy + --no-strategy-option # Negate --strategy-option + --gpg-sign(-S)?: text # GPG sign commit + --no-gpg-sign # Negate --gpg-sign + --reference # Use the 'reference' format to refer to commits + --no-reference # Negate --reference +] where { + at-most-one [--continue --skip --abort --quit] + overrides [--edit --no-edit] +} + +export complete [git rm] [ + ...paths: by "nu-complete git files" # The files to remove + -r # Remove directories recursively + --force(-f) # Override the up-to-date check + --dry-run(-n) # Remove nothing, only show + --cached # Remove from the index only + --quiet(-q) # Be quiet + --ignore-unmatch # Exit successfully even without matches + --no-dry-run # Negate --dry-run + --no-quiet # Negate --quiet + --no-cached # Negate --cached + --no-force # Negate --force + --no-ignore-unmatch # Negate --ignore-unmatch + --sparse # Allow updating entries outside of the sparse-checkout cone + --no-sparse # Negate --sparse + --pathspec-from-file: path # Read pathspec from file + --no-pathspec-from-file # Negate --pathspec-from-file + --pathspec-file-nul # With --pathspec-from-file, pathspec elements are separated with NUL character + --no-pathspec-file-nul # Negate --pathspec-file-nul +] where { + at-most-one [--cached --force] +} + +export complete [git show] [ + object?: by "nu-complete git refs" # The object to show, defaulting to HEAD + --stat # Show a diffstat instead of the patch + --name-only # Show only the names of changed files + --name-status # Show names and kinds of change + --format: by "nu-complete git log-format" # Print the commit in this format + --no-color # Disable color output + --patch(-p) # Show the patch + --quiet(-q) # Suppress the diff + --no-quiet # Negate --quiet + --source # Show source + --no-source # Negate --source + --use-mailmap # Use mail map file + --no-use-mailmap # Negate --use-mailmap + --mailmap # Alias of --use-mailmap + --no-mailmap # Negate --mailmap + --clear-decorations # Clear all previously-defined decoration filters + --decorate-refs: text # Only decorate refs that match <pattern> + --no-decorate-refs # Negate --decorate-refs + --decorate-refs-exclude: text # Do not decorate refs that match <pattern> + --no-decorate-refs-exclude # Negate --decorate-refs-exclude + --decorate?: words [short full auto no] # Decorate options + --no-decorate # Negate --decorate + -L: path # Trace the evolution of line range <start>,<end> or function :<funcname> in <file> + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file + --max-count(-n): text # Limit the number of commits to output + --skip: text # Skip number commits before starting to show the output + --since: text # Show commits more recent than a specific date + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --until: text # Show commits older than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --author: by "nu-complete git authors" # Limit to commits whose author matches the pattern + --committer: by "nu-complete git authors" # Limit to commits whose committer matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --grep: text # Limit to commits whose log message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --first-parent # Follow only the first parent commit upon seeing a merge commit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --all # Pretend all refs in refs/ and HEAD are listed on the command line + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --reverse # Output the selected commits in reverse order + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --pretty?: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --abbrev-commit # Show a prefix of the commit object name + --no-abbrev-commit # Show the full commit object name + --oneline # Shorthand for --pretty=oneline --abbrev-commit + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --date: words [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] # Format for dates shown in human-readable form + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --graph # Draw a text-based graphical representation of the commit history + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + -c # Show combined diff format for merge commits + --cc # Show dense combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + -t # Show the tree objects in the diff output + --log-size # Include a line with the log message length in bytes + --count # Print a number stating how many commits would have been listed +] where { + at-most-one [--stat --name-only --name-status] +} + +export complete [git stash] [ + ...args: text + --help(-h) +] + +export complete [git stash push] [ + ...paths: by "nu-complete git files" # Stash only these paths + --patch(-p) # Choose hunks to stash + --message(-m): text # Describe the stash + --include-untracked(-u) # Stash untracked files as well + --all(-a) # Stash ignored files as well + --keep-index # Leave the index as it is + --staged # Stash only the staged changes +] where { + at-most-one [--include-untracked --all] + at-most-one [--keep-index --staged] +} + +export complete [git stash pop] [ + stash?: by "nu-complete git stashes" # The stash to pop + --index(-i) # Restore the index as well +] + +export complete [git stash list] [ + --format: text # Format each entry + --max-count(-n): text # Show at most this many entries +] + +export complete [git stash show] [ + stash?: by "nu-complete git stashes" # The stash to show + -U # Show the diff + --patch(-p) # Show the changes as a patch + --stat # Show a diffstat instead of the patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --quiet # Disable all output of the program + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file +] where { + at-most-one [--patch --stat] +} + +export complete [git stash drop] [ + stash?: by "nu-complete git stashes" # The stash to drop +] + +export complete [git status] [ + --verbose(-v) # Be verbose + --short(-s) # Show the status concisely + --porcelain?: words [v1 v2] # Machine-readable output + --branch(-b) # Show branch information + --show-stash # Show stash information + --untracked-files(-u): words [no normal all] # Show untracked files + --ignored: words [traditional no matching] # Show ignored files + --null(-z) # Terminate entries with NUL + --renames # Detect renames + --no-renames # Do not detect renames + --find-renames: text # Rename detection threshold + --ahead-behind # Show ahead and behind counts + --no-ahead-behind # Do not show ahead and behind counts + --no-verbose # Negate --verbose + --no-short # Negate --short + --no-branch # Negate --branch + --no-show-stash # Negate --show-stash + --no-porcelain # Negate --porcelain + --long # Show status in long format (default) + --no-long # Negate --long + --no-null # Negate --null + --no-untracked-files # Negate --untracked-files + --no-ignored # Negate --ignored + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules, optional when: all, dirty, untracked. (Default: all) + --no-ignore-submodules # Negate --ignore-submodules + --column?: words [always never auto column row plain dense nodense] # List untracked files in columns + --no-column # Negate --column +] where { + at-most-one [--short --porcelain] + overrides [--renames --no-renames] + overrides [--ahead-behind --no-ahead-behind] +} + +export complete [git switch] [ + branch?: by "nu-complete git branches" # The branch or commit to switch to + start_point?: by "nu-complete git refs" # The start point for a new branch + --create(-c): by "nu-complete git new-branch" # Create a new branch + --force-create(-C): by "nu-complete git new-branch" # Create or reset a branch + --detach(-d) # Detach HEAD at a commit + --force(-f) # Alias for --discard-changes + --discard-changes # Throw away local modifications + --guess # Match a remote branch + --no-guess # Do not match a remote branch + --ignore-other-worktrees # Switch even if another worktree holds the ref + --merge(-m) # Merge local changes when switching + --no-progress # Do not report progress + --no-recurse-submodules # Do not update submodules + --no-track # Do not set upstream configuration + --orphan: text # Create a new orphaned branch + --progress # Report progress + --quiet(-q) # Suppress feedback messages + --recurse-submodules # Update submodules + --track(-t) # Set upstream configuration + --no-create # Negate --create + --no-force-create # Negate --force-create + --no-discard-changes # Negate --discard-changes + --no-quiet # Negate --quiet + --no-merge # Negate --merge + --conflict: words [merge diff3 zdiff3] # Conflict style (merge, diff3, or zdiff3) + --no-conflict # Negate --conflict + --no-detach # Negate --detach + --no-force # Negate --force + --no-orphan # Negate --orphan + --overwrite-ignore # Update ignored files (default) + --no-overwrite-ignore # Negate --overwrite-ignore + --no-ignore-other-worktrees # Negate --ignore-other-worktrees +] where { + at-most-one [--create --force-create --detach] + at-most-one [--track --no-track] + overrides [--guess --no-guess] + overrides [--force --discard-changes] + overrides [--progress --no-progress] +} + +export complete [git tag] [ + tag?: by "nu-complete git tags" # The tag to create, inspect or delete + commit?: by "nu-complete git refs" # The commit to tag + --delete(-d): by "nu-complete git tags" # Delete a tag + --annotate(-a) # Make an annotated tag + --message(-m): text # The message of an annotated tag + --list(-l) # List the tags + --force(-f) # Replace an existing tag + --contains: by "nu-complete git refs" # List tags that contain a commit + --no-contains: by "nu-complete git refs" # List tags that do not contain a commit + --points-at: by "nu-complete git refs" # List tags that point at an object + --merged: by "nu-complete git local-branches" # List tags merged into a branch + --no-merged: by "nu-complete git local-branches" # List tags not merged into a branch + --sort: text # Sort the listed tags + --format: text # Format the listed tags + -n?: text # Print <n> lines of each tag message + --verify(-v) # Verify tags + --no-annotate # Negate --annotate + --file(-F): path # Read message from file + --no-file # Negate --file + --trailer: text # Add custom trailer(s) + --no-trailer # Negate --trailer + --edit(-e) # Force edit of tag message + --no-edit # Negate --edit + --sign(-s) # Annotated and GPG-signed tag + --no-sign # Negate --sign + --cleanup: words [strip whitespace verbatim scissors default] # How to strip spaces and #comments from message + --no-cleanup # Negate --cleanup + --local-user(-u): text # Use another key to sign the tag + --no-local-user # Negate --local-user + --no-force # Negate --force + --create-reflog # Create a reflog + --no-create-reflog # Negate --create-reflog + --column?: words [always never auto column row plain dense nodense] # Show tag list in columns + --no-column # Negate --column + --omit-empty # Do not output a newline after empty formatted refs + --no-omit-empty # Negate --omit-empty + --no-sort # Negate --sort + --no-points-at # Negate --points-at + --no-format # Negate --format + --color?: words [always never auto] # Respect format colors + --no-color # Negate --color + --ignore-case(-i) # Sorting and filtering are case insensitive + --no-ignore-case # Negate --ignore-case +] where { + at-most-one [--list --delete --contains --no-contains --points-at] + at-most-one [--merged --no-merged] +} + +export complete [git worktree] [ + ...args: text + --help(-h) +] + +export complete [git worktree add] [ + path: path # The directory for the new worktree + branch?: by "nu-complete git branches" # The branch or commit to check out + --force(-f) # Check out a branch already checked out elsewhere + -b: by "nu-complete git new-branch" # Create a new branch + -B: by "nu-complete git new-branch" # Create or reset a branch + --detach(-d) # Detach HEAD at a commit + --checkout # Populate the new worktree + --lock # Lock the new worktree + --reason: text # The reason for locking + --quiet(-q) # Suppress progress reporting + --track # Set up tracking + --guess-remote # Match the branch name with a remote-tracking branch + --no-checkout # Do not populate the new worktree +] where { + at-most-one [-b -B --detach] + overrides [--checkout --no-checkout] +} + +export complete [git worktree list] [ + --porcelain # Machine-readable output + --verbose(-v) # Show extended annotations + --expire: text # Mark worktrees older than this as prunable + -z # Terminate records with NUL +] + +export complete [git worktree lock] [ + worktree: by "nu-complete git worktrees" # The worktree to lock + --reason: text # The reason for locking +] + +export complete [git worktree move] [ + source: by "nu-complete git worktrees" # The worktree to move + destination: path # The new location + --force(-f) # Move even when dirty or locked + --dry-run(-n) # Show what would be moved +] + +export complete [git worktree prune] [ + --dry-run(-n) # Do not remove, only show + --verbose(-v) # Report pruned worktrees + --expire: text # Expire worktrees older than this +] + +export complete [git worktree remove] [ + worktree: by "nu-complete git worktrees" # The worktree to remove + --force(-f) # Remove even when dirty or locked +] + +export complete [git worktree unlock] [ + worktree: by "nu-complete git worktrees" # The worktree to unlock +] + +export complete [git help] [ + command?: by "nu-complete git subcommands" # The subcommand to show help for + --all(-a) # Show every available command + --web(-w) # Show the help in a browser + --man(-m) # Show the manual page + --info(-i) # Show the Info page + --external-commands # Show external commands in --all + --no-external-commands # Negate --external-commands + --aliases # Show aliases in --all + --no-aliases # Negate --aliases + --no-man # Negate --man + --no-web # Negate --web + --no-info # Negate --info + --verbose(-v) # Print command description + --no-verbose # Negate --verbose + --guides(-g) # Print list of useful guides + --user-interfaces # Print list of user-facing repository, command and file interfaces + --developer-interfaces # Print list of file formats, protocols and other developer interfaces + --config(-c) # Print all configuration variable names +] + +export complete [git prune] [ + --dry-run(-n) # Show what would be pruned + --expire: text # Expire objects older than this + --progress # Show progress + --verbose(-v) # Report every removed object + --no-dry-run # Negate --dry-run + --no-verbose # Negate --verbose + --no-progress # Negate --progress + --no-expire # Negate --expire + --exclude-promisor-objects # Limit traversal to objects outside promisor packfiles + --no-exclude-promisor-objects # Negate --exclude-promisor-objects +] + +# --- Routes carried over from upstream's tables and `git <command> -h` --------------------- + +export complete [git am] [ + ...mbox: path + --interactive(-i) # Run interactively + --no-interactive # Negate --interactive + --no-verify(-n) # Bypass pre-applypatch and applypatch-msg hooks + --verify # Opposite of --no-verify + --3way(-3) # Allow fall back on 3way merging if needed + --no-3way # Negate --3way + --quiet(-q) # Be quiet + --no-quiet # Negate --quiet + --signoff(-s) # Add a Signed-off-by trailer to the commit message + --no-signoff # Negate --signoff + --utf8(-u) # Recode into utf8 (default) + --no-utf8 # Negate --utf8 + --keep(-k) # Pass -k flag to git-mailinfo + --no-keep # Negate --keep + --keep-non-patch # Pass -b flag to git-mailinfo + --no-keep-non-patch # Negate --keep-non-patch + --message-id(-m) # Pass -m flag to git-mailinfo + --no-message-id # Negate --message-id + --keep-cr # Pass --keep-cr flag to git-mailsplit for mbox format + --no-keep-cr # Negate --keep-cr + --scissors(-c) # Strip everything before a scissors line + --no-scissors # Negate --scissors + --quoted-cr: words [nowarn warn strip] # Pass it through git-mailinfo + --whitespace: words [nowarn warn fix error error-all] # Pass it through git-apply + --no-whitespace # Negate --whitespace + --ignore-space-change # Pass it through git-apply + --no-ignore-space-change # Negate --ignore-space-change + --ignore-whitespace # Pass it through git-apply + --no-ignore-whitespace # Negate --ignore-whitespace + --directory: text # Pass it through git-apply + --no-directory # Negate --directory + --exclude: path # Pass it through git-apply + --no-exclude # Negate --exclude + --include: path # Pass it through git-apply + --no-include # Negate --include + -C: text # Pass it through git-apply + -p: text # Pass it through git-apply + --patch-format: words [mbox mboxrd stgit stgit-series hg] # Format the patch(es) are in + --no-patch-format # Negate --patch-format + --reject # Pass it through git-apply + --no-reject # Negate --reject + --resolvemsg: text # Override error message when patch failure occurs + --no-resolvemsg # Negate --resolvemsg + --continue # Continue applying patches after resolving a conflict + --resolved(-r) # Synonyms for --continue + --skip # Skip the current patch + --abort # Restore the original branch and abort the patching operation + --quit # Abort the patching operation but keep HEAD where it is + --show-current-patch?: words [diff raw] # Show the patch being applied + --retry # Try to apply current patch again + --allow-empty # Record the empty patch as an empty commit + --committer-date-is-author-date # Lie about committer date + --no-committer-date-is-author-date # Negate --committer-date-is-author-date + --ignore-date # Use current timestamp for author date + --no-ignore-date # Negate --ignore-date + --rerere-autoupdate # Update the index with reused conflict resolution if possible + --no-rerere-autoupdate # Negate --rerere-autoupdate + --gpg-sign(-S)?: text # GPG-sign commits + --no-gpg-sign # Negate --gpg-sign + --empty: text # How to handle empty patches +] + +export complete [git annotate] [ + ...args: path + --incremental # Show blame entries as we find them, incrementally + --no-incremental # Negate --incremental + -b # Do not show object names of boundary commits (Default: off) + --root # Do not treat root commits as boundaries (Default: off) + --no-root # Negate --root + --show-stats # Show work cost statistics + --no-show-stats # Negate --show-stats + --progress # Force progress reporting + --no-progress # Negate --progress + --score-debug # Show output score for blame entries + --no-score-debug # Negate --score-debug + --show-name(-f) # Show original filename (Default: auto) + --no-show-name # Negate --show-name + --show-number(-n) # Show original linenumber (Default: off) + --no-show-number # Negate --show-number + --porcelain(-p) # Show in a format designed for machine consumption + --no-porcelain # Negate --porcelain + --line-porcelain # Show porcelain format with per-line commit information + --no-line-porcelain # Negate --line-porcelain + -c # Use the same output mode as git-annotate (Default: off) + -t # Show raw timestamp (Default: off) + -l # Show long commit SHA1 (Default: off) + -s # Suppress author name and timestamp (Default: off) + --show-email(-e) # Show author email instead of name (Default: off) + --no-show-email # Negate --show-email + -w # Ignore whitespace differences + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --ignore-rev: text # Ignore <rev> when blaming + --no-ignore-rev # Negate --ignore-rev + --ignore-revs-file: path # Ignore revisions from <file> + --no-ignore-revs-file # Negate --ignore-revs-file + --color-lines # Color redundant metadata from previous line differently + --no-color-lines # Negate --color-lines + --color-by-age # Color lines by age + --no-color-by-age # Negate --color-by-age + -S: path # Use revisions from <file> instead of calling git-rev-list + --contents: path # Use <file>'s contents as the final image + --no-contents # Negate --contents + -C?: text # Find line copies within and across files + -M?: text # Find line movements within and across files + -L: text # Process only line range <start>,<end> or function :<funcname> + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev +] + +export complete [git apply] [ + ...patch: path + --exclude: path # Don't apply changes matching the given path + --include: path # Apply changes matching the given path + -p: text # Remove <num> leading slashes from traditional diff paths + --no-add # Ignore additions made by the patch + --add # Opposite of --no-add + --stat # Instead of applying the patch, output diffstat for the input + --no-stat # Negate --stat + --numstat # Show number of added and deleted lines in decimal notation + --no-numstat # Negate --numstat + --summary # Instead of applying the patch, output a summary for the input + --no-summary # Negate --summary + --check # Instead of applying the patch, see if the patch is applicable + --no-check # Negate --check + --index # Make sure the patch is applicable to the current index + --no-index # Negate --index + --intent-to-add(-N) # Mark new files with `git add --intent-to-add` + --no-intent-to-add # Negate --intent-to-add + --cached # Apply a patch without touching the working tree + --no-cached # Negate --cached + --unsafe-paths # Accept a patch that touches outside the working area + --no-unsafe-paths # Negate --unsafe-paths + --apply # Also apply the patch (use with --stat/--summary/--check) + --no-apply # Negate --apply + --3way(-3) # Attempt three-way merge, fall back on normal patch if that fails + --no-3way # Negate --3way + --ours # For conflicts, use our version + --theirs # For conflicts, use their version + --union # For conflicts, use a union version + --build-fake-ancestor: path # Build a temporary index based on embedded index information + --no-build-fake-ancestor # Negate --build-fake-ancestor + -z # Paths are separated with NUL character + -C: text # Ensure at least <n> lines of context match + --whitespace: words [nowarn warn fix error error-all] # Detect new or modified lines that have whitespace errors + --no-whitespace # Negate --whitespace + --ignore-space-change # Ignore changes in whitespace when finding context + --no-ignore-space-change # Negate --ignore-space-change + --ignore-whitespace # Ignore changes in whitespace when finding context + --no-ignore-whitespace # Negate --ignore-whitespace + --reverse(-R) # Apply the patch in reverse + --no-reverse # Negate --reverse + --unidiff-zero # Don't expect at least one line of context + --no-unidiff-zero # Negate --unidiff-zero + --reject # Leave the rejected hunks in corresponding *.rej files + --no-reject # Negate --reject + --allow-overlap # Allow overlapping hunks + --no-allow-overlap # Negate --allow-overlap + --verbose(-v) # Be more verbose + --no-verbose # Negate --verbose + --quiet(-q) # Be more quiet + --no-quiet # Negate --quiet + --inaccurate-eof # Tolerate incorrectly detected missing new-line at the end of file + --no-inaccurate-eof # Negate --inaccurate-eof + --recount # Do not trust the line counts in the hunk headers + --no-recount # Negate --recount + --directory: text # Prepend <root> to all filenames + --no-directory # Negate --directory + --allow-empty # Don't return error for empty patches + --no-allow-empty # Negate --allow-empty +] + +export complete [git archive] [ + tree_ish?: by "nu-complete git refs" + ...path: path + --format: words [tar tgz tar.gz zip] # Archive format + --no-format # Negate --format + --prefix: text # Prepend prefix to each pathname in the archive + --no-prefix # Negate --prefix + --add-file: path # Add untracked file to archive + --no-add-file # Negate --add-file + --add-virtual-file: path # Add untracked file to archive + --no-add-virtual-file # Negate --add-virtual-file + --output(-o): path # Write the archive to this file + --no-output # Negate --output + --worktree-attributes # Read .gitattributes in working directory + --no-worktree-attributes # Negate --worktree-attributes + --verbose(-v) # Report archived files on stderr + --no-verbose # Negate --verbose + --mtime: text # Set modification time of archive entries + --list(-l) # List supported archive formats + --no-list # Negate --list + --remote: by "nu-complete git remotes" # Retrieve the archive from remote repository <repo> + --no-remote # Negate --remote + --exec: text # Path to the remote git-upload-archive command + --no-exec # Negate --exec +] + +export complete [git backfill] [ + ...args: path + --min-batch-size: text # Minimum number of objects to request at a time + --sparse # Restrict the missing objects to the current sparse-checkout + --no-sparse # Negate --sparse + --include-edges # Include blobs from boundary commits in the backfill + --no-include-edges # Negate --include-edges +] + +export complete [git blame] [ + ...args: path + --incremental # Show blame entries as we find them, incrementally + --no-incremental # Negate --incremental + -b # Do not show object names of boundary commits (Default: off) + --root # Do not treat root commits as boundaries (Default: off) + --no-root # Negate --root + --show-stats # Show work cost statistics + --no-show-stats # Negate --show-stats + --progress # Force progress reporting + --no-progress # Negate --progress + --score-debug # Show output score for blame entries + --no-score-debug # Negate --score-debug + --show-name(-f) # Show original filename (Default: auto) + --no-show-name # Negate --show-name + --show-number(-n) # Show original linenumber (Default: off) + --no-show-number # Negate --show-number + --porcelain(-p) # Show in a format designed for machine consumption + --no-porcelain # Negate --porcelain + --line-porcelain # Show porcelain format with per-line commit information + --no-line-porcelain # Negate --line-porcelain + -c # Use the same output mode as git-annotate (Default: off) + -t # Show raw timestamp (Default: off) + -l # Show long commit SHA1 (Default: off) + -s # Suppress author name and timestamp (Default: off) + --show-email(-e) # Show author email instead of name (Default: off) + --no-show-email # Negate --show-email + -w # Ignore whitespace differences + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --ignore-rev: text # Ignore <rev> when blaming + --no-ignore-rev # Negate --ignore-rev + --ignore-revs-file: path # Ignore revisions from <file> + --no-ignore-revs-file # Negate --ignore-revs-file + --color-lines # Color redundant metadata from previous line differently + --no-color-lines # Negate --color-lines + --color-by-age # Color lines by age + --no-color-by-age # Negate --color-by-age + -S: path # Use revisions from <file> instead of calling git-rev-list + --contents: path # Use <file>'s contents as the final image + --no-contents # Negate --contents + -C?: text # Find line copies within and across files + -M?: text # Find line movements within and across files + -L: text # Process only line range <start>,<end> or function :<funcname> + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev +] + +export complete [git bugreport] [ + ...args: path + --diagnose?: text # Create an additional zip archive of detailed diagnostics (default 'stats') + --no-diagnose # Negate --diagnose + --output-directory(-o): path # Specify a destination for the bugreport file(s) + --no-output-directory # Negate --output-directory + --suffix(-s): text # Specify a strftime format suffix for the filename(s) + --no-suffix # Negate --suffix +] + +export complete [git bundle] [ + ...args: path +] + +export complete [git cat-file] [ + ...object: by "nu-complete git refs" + -e # Check if <object> exists + -p # Pretty-print <object> content + -t # Show object type (one of 'blob', 'tree', 'commit', 'tag', ...) + -s # Show object size + --use-mailmap # Use mail map file + --no-use-mailmap # Negate --use-mailmap + --mailmap # Alias of --use-mailmap + --no-mailmap # Negate --mailmap + --batch?: text # Show full <object> or <rev> contents + --batch-check?: text # Like --batch, but don't emit <contents> + -Z # Stdin and stdout is NUL-terminated + --batch-command?: text # Read commands from stdin + --batch-all-objects # With --batch[-check]: ignores stdin, batches all known objects + --buffer # Buffer --batch output + --no-buffer # Negate --buffer + --follow-symlinks # Follow in-tree symlinks + --no-follow-symlinks # Negate --follow-symlinks + --unordered # Do not order objects before emitting them + --no-unordered # Negate --unordered + --textconv # Run textconv on object's content + --filters # Run filters on object's content + --path: text # Use a <path> for (--textconv | --filters); Not with 'batch' + --no-path # Negate --path + --filter: words ["blob:none" "blob:limit=" "tree:0" "tree:1" "sparse:oid=" "object:type=blob" "object:type=tree" "combine:"] # Object filtering + --no-filter # Negate --filter +] + +export complete [git check-attr] [ + ...pathname: path + --all(-a) # Report all attributes set on file + --no-all # Negate --all + --cached # Use .gitattributes only from the index + --no-cached # Negate --cached + --stdin # Read file names from stdin + --no-stdin # Negate --stdin + -z # Terminate input and output records by a NUL character + --source: by "nu-complete git refs" # Which tree-ish to check attributes at + --no-source # Negate --source +] + +export complete [git check-ignore] [ + ...pathname: path + --quiet(-q) # Suppress progress reporting + --no-quiet # Negate --quiet + --verbose(-v) # Be verbose + --no-verbose # Negate --verbose + --stdin # Read file names from stdin + --no-stdin # Negate --stdin + -z # Terminate input and output records by a NUL character + --non-matching(-n) # Show non-matching input paths + --no-non-matching # Negate --non-matching + --no-index # Ignore index when checking + --index # Opposite of --no-index +] + +export complete [git check-mailmap] [ + ...args: path + --stdin # Also read contacts from stdin + --no-stdin # Negate --stdin + --mailmap-file: path # Read additional mailmap entries from file + --no-mailmap-file # Negate --mailmap-file + --mailmap-blob: text # Read additional mailmap entries from blob + --no-mailmap-blob # Negate --mailmap-blob +] + +export complete [git check-ref-format] [ + ...args: path +] + +export complete [git checkout-index] [ + ...args: path + --all(-a) # Check out all files in the index + --no-all # Negate --all + --ignore-skip-worktree-bits # Do not skip files with skip-worktree set + --no-ignore-skip-worktree-bits # Negate --ignore-skip-worktree-bits + --force(-f) # Force overwrite of existing files + --no-force # Negate --force + --quiet(-q) # No warning for existing files and files not in index + --no-quiet # Negate --quiet + --no-create(-n) # Don't checkout new files + --create # Opposite of --no-create + --index(-u) # Update stat information in the index file + --no-index # Negate --index + -z # Paths are separated with NUL character + --stdin # Read list of paths from the standard input + --no-stdin # Negate --stdin + --temp # Write the content to temporary files + --no-temp # Negate --temp + --prefix: text # When creating files, prepend <string> + --no-prefix # Negate --prefix + --stage: text # Copy out the files from named stage +] + +export complete [git column] [ + ...args: path + --command: text # Lookup config vars + --no-command # Negate --command + --mode?: words [always never auto column row plain dense nodense] # Layout to use + --no-mode # Negate --mode + --raw-mode: text # Layout to use + --width: text # Maximum width + --no-width # Negate --width + --indent: text # Padding space on left border + --no-indent # Negate --indent + --nl: text # Padding space on right border + --no-nl # Negate --nl + --padding: text # Padding space between columns + --no-padding # Negate --padding +] + +export complete [git commit-graph] [ + ...args: path + --object-dir: path # The object directory to store the graph + --no-object-dir # Negate --object-dir +] + +export complete [git commit-tree] [ + tree: by "nu-complete git refs" + -p: text # Id of a parent commit object + -m: text # Commit message + -F: path # Read commit log message from file + --gpg-sign(-S)?: text # GPG sign commit + --no-gpg-sign # Negate --gpg-sign +] + +export complete [git count-objects] [ + ...args: path + --verbose(-v) # Be verbose + --no-verbose # Negate --verbose + --human-readable(-H) # Print sizes in human readable format + --no-human-readable # Negate --human-readable +] + +export complete [git describe] [ + ...commit_ish: by "nu-complete git refs" + --contains # Find the tag that comes after the commit + --no-contains # Negate --contains + --debug # Debug search strategy on stderr + --no-debug # Negate --debug + --all # Use any ref + --no-all # Negate --all + --tags # Use any tag, even unannotated + --no-tags # Negate --tags + --long # Always use long format + --no-long # Negate --long + --first-parent # Only follow first parent + --no-first-parent # Negate --first-parent + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --exact-match # Only output exact matches + --no-exact-match # Negate --exact-match + --candidates: text # Consider <n> most recent tags (default: 10) + --no-candidates # Negate --candidates + --match: text # Only consider tags matching <pattern> + --no-match # Negate --match + --exclude: text # Do not consider tags matching <pattern> + --no-exclude # Negate --exclude + --always # Show abbreviated commit object as fallback + --no-always # Negate --always + --dirty?: text # Append <mark> on dirty working tree (default: "-dirty") + --no-dirty # Negate --dirty + --broken?: text # Append <mark> on broken working tree (default: "-broken") + --no-broken # Negate --broken +] + +export complete [git diagnose] [ + ...args: path + --output-directory(-o): path # Specify a destination for the diagnostics archive + --no-output-directory # Negate --output-directory + --suffix(-s): text # Specify a strftime format suffix for the filename + --no-suffix # Negate --suffix + --mode: text # Specify the content of the diagnostic archive +] + +export complete [git diff-files] [ + ...path: path + --patch(-p) # Generate patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --quiet # Disable all output of the program + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file +] + +export complete [git diff-index] [ + tree_ish?: by "nu-complete git refs" + ...path: path + --patch(-p) # Generate patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --quiet # Disable all output of the program + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file +] + +export complete [git diff-pairs] [ + ...args: path + --patch(-p) # Generate patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Generate diffs with <n> lines context + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --quiet # Disable all output of the program + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file +] + +export complete [git diff-tree] [ + tree_ish?: by "nu-complete git refs" + ...args: by "nu-complete git refs" + --patch(-p) # Generate patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --quiet # Disable all output of the program + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file + -r # Diff recursively + -c # Show combined diff for merge commits + --cc # Show combined diff for merge commits removing uninteresting hunks + --combined-all-paths # Show the name of the file from all parents in combined diffs + --root # Include the initial commit as diff against /dev/null +] + +export complete [git difftool] [ + ...args: by "nu-complete git files-or-refs" + --gui(-g) # Use `diff.guitool` instead of `diff.tool` + --no-gui # Negate --gui + --dir-diff(-d) # Perform a full-directory diff + --no-dir-diff # Negate --dir-diff + --no-prompt(-y) # Do not prompt before launching a diff tool + --symlinks # Use symlinks in dir-diff mode + --no-symlinks # Negate --symlinks + --tool(-t): words [araxis bc bc3 bc4 codecompare deltawalker diffmerge diffuse ecmerge emerge examdiff guiffy gvimdiff kdiff3 kompare meld nvimdiff opendiff p4merge smerge tkdiff tortoisemerge vimdiff vscode winmerge xxdiff] # Use the specified diff tool + --no-tool # Negate --tool + --tool-help # Print a list of diff tools that may be used with `--tool` + --no-tool-help # Negate --tool-help + --trust-exit-code # Make 'git-difftool' exit when an invoked diff tool returns a non-zero exit code + --no-trust-exit-code # Negate --trust-exit-code + --extcmd(-x): text # Specify a custom command for viewing diffs + --no-extcmd # Negate --extcmd + --no-index # Passed to `diff` + --index # Opposite of --no-index + --patch(-p) # Generate patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --quiet # Disable all output of the program + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file +] + +export complete [git fast-export] [ + ...rev: by "nu-complete git refs" + --progress: text # Show progress after <n> objects + --no-progress # Negate --progress + --signed-tags: text # Select handling of signed tags + --no-signed-tags # Negate --signed-tags + --signed-commits: text # Select handling of signed commits + --no-signed-commits # Negate --signed-commits + --tag-of-filtered-object: text # Select handling of tags that tag filtered objects + --no-tag-of-filtered-object # Negate --tag-of-filtered-object + --reencode: text # Select handling of commit messages in an alternate encoding + --no-reencode # Negate --reencode + --export-marks: path # Dump marks to this file + --no-export-marks # Negate --export-marks + --import-marks: path # Import marks from this file + --no-import-marks # Negate --import-marks + --import-marks-if-exists: path # Import marks from this file if it exists + --no-import-marks-if-exists # Negate --import-marks-if-exists + --fake-missing-tagger # Fake a tagger when tags lack one + --no-fake-missing-tagger # Negate --fake-missing-tagger + --full-tree # Output full tree for each commit + --no-full-tree # Negate --full-tree + --use-done-feature # Use the done feature to terminate the stream + --no-use-done-feature # Negate --use-done-feature + --no-data # Skip output of blob data + --data # Opposite of --no-data + --refspec: text # Apply refspec to exported refs + --no-refspec # Negate --refspec + --anonymize # Anonymize output + --no-anonymize # Negate --anonymize + --anonymize-map: text # Convert <from> to <to> in anonymized output + --reference-excluded-parents # Reference parents which are not in fast-export stream by object id + --no-reference-excluded-parents # Negate --reference-excluded-parents + --show-original-ids # Show original object ids of blobs/commits + --no-show-original-ids # Negate --show-original-ids + --mark-tags # Label tags with mark ids + --no-mark-tags # Negate --mark-tags + --max-count(-n): text # Limit the number of commits to output + --skip: text # Skip number commits before starting to show the output + --since: text # Show commits more recent than a specific date + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --until: text # Show commits older than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --author: by "nu-complete git authors" # Limit to commits whose author matches the pattern + --committer: by "nu-complete git authors" # Limit to commits whose committer matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --grep: text # Limit to commits whose log message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --first-parent # Follow only the first parent commit upon seeing a merge commit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --all # Pretend all refs in refs/ and HEAD are listed on the command line + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --reverse # Output the selected commits in reverse order + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --pretty?: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --format: text # Pretty-print the commit logs in the given format + --abbrev?: text # Show object names with at least <n> hexdigits + --no-abbrev # Show full object names + --abbrev-commit # Show a prefix of the commit object name + --no-abbrev-commit # Show the full commit object name + --oneline # Shorthand for --pretty=oneline --abbrev-commit + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --date: words [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] # Format for dates shown in human-readable form + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --graph # Draw a text-based graphical representation of the commit history + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + -c # Show combined diff format for merge commits + --cc # Show dense combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + -t # Show the tree objects in the diff output + --log-size # Include a line with the log message length in bytes + --follow # Continue listing the history of a file beyond renames + --count # Print a number stating how many commits would have been listed +] + +export complete [git fast-import] [ + ...args: path + --date-format: text # Format of the commit/tag dates + --stats # Display some basic statistics (objects, packfiles and memory) + --quiet # Disable the output shown by --stats + --force # Force updating modified existing branches + --done # Require a terminating 'done' command + --max-pack-size: text # Maximum size of each output pack file + --big-file-threshold: text # Maximum size of a blob that will be deltified + --depth: text # Maximum delta depth + --active-branches: text # Maximum number of branches to maintain active + --import-marks: path # Import marks from <file> + --import-marks-if-exists: path # Import marks from <file> if it exists + --export-marks: path # Dump marks to <file> + --relative-marks # Are --(import|export)-marks= paths relative to '.git/info/fast-import'? + --no-relative-marks # Negate --relative-marks + --rewrite-submodules-from: path # Rewrite object IDs for submodule <name> from <filename> + --rewrite-submodules-to: path # Rewrite object IDs for submodule <name> to <filename> + --signed-commits: text # How to handle signed commits + --signed-tags: text # How to handle signed tags +] + +export complete [git fmt-merge-msg] [ + ...args: path + --log?: text # Populate log with at most <n> entries from shortlog + --no-log # Negate --log + --message(-m): text # Use <text> as start of message + --no-message # Negate --message + --into-name: text # Use <name> instead of the real target branch + --no-into-name # Negate --into-name + --file(-F): path # File to read from + --no-file # Negate --file +] + +export complete [git for-each-ref] [ + ...pattern: by "nu-complete git full-refs" + --shell(-s) # Quote placeholders suitably for shells + --no-shell # Negate --shell + --perl(-p) # Quote placeholders suitably for perl + --no-perl # Negate --perl + --python # Quote placeholders suitably for python + --no-python # Negate --python + --tcl # Quote placeholders suitably for Tcl + --no-tcl # Negate --tcl + --omit-empty # Do not output a newline after empty formatted refs + --no-omit-empty # Negate --omit-empty + --count: text # Show only <n> matched refs + --no-count # Negate --count + --format: text # Format to use for the output + --no-format # Negate --format + --start-after: text # Start iteration after the provided marker + --no-start-after # Negate --start-after + --color?: words [always never auto] # Respect format colors + --no-color # Negate --color + --exclude: text # Exclude refs which match pattern + --no-exclude # Negate --exclude + --sort: words [refname -refname committerdate -committerdate creatordate -creatordate authordate -authordate taggerdate -taggerdate "version:refname" "-version:refname" objectsize -objectsize objecttype upstream HEAD] # Field name to sort on + --no-sort # Negate --sort + --points-at: by "nu-complete git refs" # Print only refs which points at the given object + --no-points-at # Negate --points-at + --merged: by "nu-complete git refs" # Print only refs that are merged + --no-merged: by "nu-complete git refs" # Print only refs that are not merged + --contains: by "nu-complete git commits" # Print only refs which contain the commit + --no-contains: by "nu-complete git commits" # Print only refs which don't contain the commit + --ignore-case # Sorting and filtering are case insensitive + --no-ignore-case # Negate --ignore-case + --stdin # Read reference patterns from stdin + --no-stdin # Negate --stdin + --include-root-refs # Also include HEAD ref and pseudorefs + --no-include-root-refs # Negate --include-root-refs +] + +export complete [git for-each-repo] [ + ...args: path + --config: text # Config key storing a list of repository paths + --no-config # Negate --config + --keep-going # Keep going even if command fails in a repository + --no-keep-going # Negate --keep-going +] + +export complete [git format-patch] [ + ...revision: by "nu-complete git refs" + --numbered(-n) # Use [PATCH n/m] even with a single patch + --no-numbered # Negate --numbered + --signoff(-s) # Add a Signed-off-by trailer + --no-signoff # Negate --signoff + --stdout # Print patches to standard out + --no-stdout # Negate --stdout + --cover-letter # Generate a cover letter + --no-cover-letter # Negate --cover-letter + --commit-list-format: text # Format spec used for the commit list in the cover letter + --no-commit-list-format # Negate --commit-list-format + --numbered-files # Use simple number sequence for output file names + --no-numbered-files # Negate --numbered-files + --suffix: text # Use <sfx> instead of '.patch' + --no-suffix # Negate --suffix + --start-number: text # Start numbering patches at <n> instead of 1 + --no-start-number # Negate --start-number + --reroll-count(-v): text # Mark the series as Nth re-roll + --no-reroll-count # Negate --reroll-count + --filename-max-length: text # Max length of output filename + --no-filename-max-length # Negate --filename-max-length + --rfc?: text # Add <rfc> (default 'RFC') before 'PATCH' + --no-rfc # Negate --rfc + --cover-from-description: text # Generate parts of a cover letter based on a branch's description + --no-cover-from-description # Negate --cover-from-description + --description-file: path # Use branch description from file + --no-description-file # Negate --description-file + --subject-prefix: text # Use [<prefix>] instead of [PATCH] + --output-directory(-o): path # Store resulting files in <dir> + --keep-subject(-k) # Don't strip/add [PATCH] + --no-binary # Don't output binary diffs + --binary # Opposite of --no-binary + --zero-commit # Output all-zero hash in From header + --no-zero-commit # Negate --zero-commit + --ignore-if-in-upstream # Don't include a patch matching a commit upstream + --no-ignore-if-in-upstream # Negate --ignore-if-in-upstream + --no-stat(-p) # Show patch format instead of default (patch + stat) + --add-header: text # Add email header + --no-add-header # Negate --add-header + --to: text # Add To: header + --no-to # Negate --to + --cc: text # Add Cc: header + --no-cc # Negate --cc + --from?: text # Set From address to <ident> (or committer ident if absent) + --no-from # Negate --from + --in-reply-to: text # Make first mail a reply to <message-id> + --no-in-reply-to # Negate --in-reply-to + --attach?: text # Attach the patch + --no-attach # Negate --attach + --inline?: text # Inline the patch + --thread?: words [shallow deep] # Enable message threading, styles: shallow, deep + --no-thread # Negate --thread + --signature: text # Add a signature + --no-signature # Negate --signature + --base: by "nu-complete git refs" # Add prerequisite tree info to the patch series + --no-base # Negate --base + --signature-file: path # Add a signature from a file + --no-signature-file # Negate --signature-file + --quiet(-q) # Don't print the patch filenames + --no-quiet # Negate --quiet + --progress # Show progress while generating patches + --no-progress # Negate --progress + --interdiff: by "nu-complete git refs" # Show changes against <rev> in cover letter or single patch + --no-interdiff # Negate --interdiff + --range-diff: by "nu-complete git refs" # Show changes against <refspec> in cover letter or single patch + --no-range-diff # Negate --range-diff + --creation-factor: text # Percentage by which creation is weighted + --no-creation-factor # Negate --creation-factor + --force-in-body-from # Show in-body From: even if identical to the e-mail header + --no-force-in-body-from # Negate --force-in-body-from + --patch # Generate patch + --no-patch # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file + --max-count: text # Limit the number of commits to output + --skip: text # Skip number commits before starting to show the output + --since: text # Show commits more recent than a specific date + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --until: text # Show commits older than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --author: by "nu-complete git authors" # Limit to commits whose author matches the pattern + --committer: by "nu-complete git authors" # Limit to commits whose committer matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --grep: text # Limit to commits whose log message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --first-parent # Follow only the first parent commit upon seeing a merge commit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --all # Pretend all refs in refs/ and HEAD are listed on the command line + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --reverse # Output the selected commits in reverse order + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --pretty?: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --format: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --abbrev-commit # Show a prefix of the commit object name + --no-abbrev-commit # Show the full commit object name + --oneline # Shorthand for --pretty=oneline --abbrev-commit + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --date: words [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] # Format for dates shown in human-readable form + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --graph # Draw a text-based graphical representation of the commit history + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + -c # Show combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + -t # Show the tree objects in the diff output + --log-size # Include a line with the log message length in bytes + --count # Print a number stating how many commits would have been listed +] + +export complete [git format-rev] [ + ...args: path + --format: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty format to use + --no-format # Negate --format + --stdin-mode: words [revs objects] # How revs are processed + --no-stdin-mode # Negate --stdin-mode + --notes: by "nu-complete git notes-refs" # Display notes for pretty format + --no-notes # Negate --notes + --null(-z) # Use NUL for input and output termination + --null-input # Use NUL for input termination + --no-null-input # Negate --null-input + --null-output # Use NUL for output termination + --no-null-output # Negate --null-output +] + +export complete [git fsck] [ + ...object: by "nu-complete git refs" + --verbose(-v) # Be verbose + --no-verbose # Negate --verbose + --unreachable # Show unreachable objects + --no-unreachable # Negate --unreachable + --dangling # Show dangling objects + --no-dangling # Negate --dangling + --tags # Report tags + --no-tags # Negate --tags + --root # Report root nodes + --no-root # Negate --root + --cache # Make index objects head nodes + --no-cache # Negate --cache + --reflogs # Make reflogs head nodes (default) + --no-reflogs # Negate --reflogs + --full # Also consider packs and alternate objects + --no-full # Negate --full + --connectivity-only # Check only connectivity + --no-connectivity-only # Negate --connectivity-only + --strict # Enable more strict checking + --no-strict # Negate --strict + --lost-found # Write dangling objects in .git/lost-found + --no-lost-found # Negate --lost-found + --progress # Show progress + --no-progress # Negate --progress + --name-objects # Show verbose names for reachable objects + --no-name-objects # Negate --name-objects + --references # Check reference database consistency + --no-references # Negate --references +] + +export complete [git fsck-objects] [ + ...args: path + --verbose(-v) # Be verbose + --no-verbose # Negate --verbose + --unreachable # Show unreachable objects + --no-unreachable # Negate --unreachable + --dangling # Show dangling objects + --no-dangling # Negate --dangling + --tags # Report tags + --no-tags # Negate --tags + --root # Report root nodes + --no-root # Negate --root + --cache # Make index objects head nodes + --no-cache # Negate --cache + --reflogs # Make reflogs head nodes (default) + --no-reflogs # Negate --reflogs + --full # Also consider packs and alternate objects + --no-full # Negate --full + --connectivity-only # Check only connectivity + --no-connectivity-only # Negate --connectivity-only + --strict # Enable more strict checking + --no-strict # Negate --strict + --lost-found # Write dangling objects in .git/lost-found + --no-lost-found # Negate --lost-found + --progress # Show progress + --no-progress # Negate --progress + --name-objects # Show verbose names for reachable objects + --no-name-objects # Negate --name-objects + --references # Check reference database consistency + --no-references # Negate --references +] + +export complete [git gc] [ + ...args: path + --quiet(-q) # Suppress progress reporting + --no-quiet # Negate --quiet + --prune?: text # Prune unreferenced objects + --no-prune # Negate --prune + --cruft # Pack unreferenced objects separately + --no-cruft # Negate --cruft + --max-cruft-size: text # With --cruft, limit the size of new cruft packs + --aggressive # Be more thorough (increased runtime) + --no-aggressive # Negate --aggressive + --auto # Enable auto-gc mode + --no-auto # Negate --auto + --detach # Perform garbage collection in the background + --no-detach # Negate --detach + --force # Force running gc even if there may be another gc running + --no-force # Negate --force + --keep-largest-pack # Repack all other packs except the largest pack + --no-keep-largest-pack # Negate --keep-largest-pack + --expire-to: path # Pack prefix to store a pack containing pruned objects + --no-expire-to # Negate --expire-to +] + +export complete [git hash-object] [ + ...file: path + -t: text # Object type + -w # Write the object into the object database + --stdin # Read the object from stdin + --no-stdin # Negate --stdin + --stdin-paths # Read file names from stdin + --no-stdin-paths # Negate --stdin-paths + --no-filters # Store file as is without filters + --filters # Opposite of --no-filters + --literally # Just hash any random garbage to create corrupt objects for debugging Git + --no-literally # Negate --literally + --path: path # Process file as it were from this path + --no-path # Negate --path +] + +export complete [git history] [ + ...args: path +] + +export complete [git hook] [ + ...args: path +] + +export complete [git init-db] [ + ...args: path + --template: text # Directory from which templates will be used + --no-template # Negate --template + --bare # Create a bare repository + --no-bare # Negate --bare + --shared?: words [False True umask group all world everybody] # Specify that the git repository is to be shared amongst several users + --quiet(-q) # Be quiet + --no-quiet # Negate --quiet + --separate-git-dir: path # Separate git dir from working tree + --no-separate-git-dir # Negate --separate-git-dir + --initial-branch(-b): text # Override the name of the initial branch + --no-initial-branch # Negate --initial-branch + --object-format: words [sha1 sha256] # Specify the hash algorithm to use + --no-object-format # Negate --object-format + --ref-format: words [files reftable] # Specify the reference format to use + --no-ref-format # Negate --ref-format +] + +export complete [git interpret-trailers] [ + ...file: path + --in-place # Edit files in place + --no-in-place # Negate --in-place + --trim-empty # Trim empty trailers + --no-trim-empty # Negate --trim-empty + --where: text # Where to place the new trailer + --no-where # Negate --where + --if-exists: text # Action if trailer already exists + --no-if-exists # Negate --if-exists + --if-missing: text # Action if trailer is missing + --no-if-missing # Negate --if-missing + --only-trailers # Output only the trailers + --no-only-trailers # Negate --only-trailers + --only-input # Do not apply trailer.<key-alias> configuration variables + --no-only-input # Negate --only-input + --unfold # Reformat multiline trailer values as single-line values + --no-unfold # Negate --unfold + --parse # Alias for --only-trailers --only-input --unfold + --no-divider # Do not treat "---" as the end of input + --divider # Opposite of --no-divider + --trailer: text # Trailer(s) to add + --no-trailer # Negate --trailer +] + +export complete [git last-modified] [ + ...args: by "nu-complete git refs" + --recursive(-r) # Recurse into subtrees + --no-recursive # Negate --recursive + --show-trees(-t) # Show tree entries when recursing into subtrees + --no-show-trees # Negate --show-trees + --max-depth: text # Maximum tree depth to recurse + -z # Lines are separated with NUL character + --max-count(-n): text # Limit the number of commits to output + --skip: text # Skip number commits before starting to show the output + --since: text # Show commits more recent than a specific date + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --until: text # Show commits older than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --author: by "nu-complete git authors" # Limit to commits whose author matches the pattern + --committer: by "nu-complete git authors" # Limit to commits whose committer matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --grep: text # Limit to commits whose log message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --first-parent # Follow only the first parent commit upon seeing a merge commit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --all # Pretend all refs in refs/ and HEAD are listed on the command line + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --reverse # Output the selected commits in reverse order + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --pretty?: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --format: text # Pretty-print the commit logs in the given format + --abbrev?: text # Show object names with at least <n> hexdigits + --no-abbrev # Show full object names + --abbrev-commit # Show a prefix of the commit object name + --no-abbrev-commit # Show the full commit object name + --oneline # Shorthand for --pretty=oneline --abbrev-commit + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --date: words [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] # Format for dates shown in human-readable form + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --graph # Draw a text-based graphical representation of the commit history + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + -c # Show combined diff format for merge commits + --cc # Show dense combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + --log-size # Include a line with the log message length in bytes + --follow # Continue listing the history of a file beyond renames + --count # Print a number stating how many commits would have been listed +] + +export complete [git ls-files] [ + ...file: path + -z # Separate paths with the NUL character + -t # Identify the file status with tags + -v # Use lowercase letters for 'assume unchanged' files + -f # Use lowercase letters for 'fsmonitor clean' files + --cached(-c) # Show cached files in the output (default) + --no-cached # Negate --cached + --deleted(-d) # Show deleted files in the output + --no-deleted # Negate --deleted + --modified(-m) # Show modified files in the output + --no-modified # Negate --modified + --others(-o) # Show other files in the output + --no-others # Negate --others + --ignored(-i) # Show ignored files in the output + --no-ignored # Negate --ignored + --stage(-s) # Show staged contents' object name in the output + --no-stage # Negate --stage + --killed(-k) # Show files on the filesystem that need to be removed + --no-killed # Negate --killed + --directory # Show 'other' directories' names only + --no-directory # Negate --directory + --eol # Show line endings of files + --no-eol # Negate --eol + --empty-directory # Don't show empty directories + --no-empty-directory # Negate --empty-directory + --unmerged(-u) # Show unmerged files in the output + --no-unmerged # Negate --unmerged + --resolve-undo # Show resolve-undo information + --no-resolve-undo # Negate --resolve-undo + --exclude(-x): text # Skip files matching pattern + --exclude-from(-X): path # Read exclude patterns from <file> + --exclude-per-directory: path # Read additional per-directory exclude patterns in <file> + --no-exclude-per-directory # Negate --exclude-per-directory + --exclude-standard # Add the standard git exclusions + --full-name # Make the output relative to the project top directory + --recurse-submodules # Recurse through submodules + --no-recurse-submodules # Negate --recurse-submodules + --error-unmatch # If any <file> is not in the index, treat this as an error + --no-error-unmatch # Negate --error-unmatch + --with-tree: text # Pretend that paths removed since <tree-ish> are still present + --no-with-tree # Negate --with-tree + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --debug # Show debugging data + --no-debug # Negate --debug + --deduplicate # Suppress duplicate entries + --no-deduplicate # Negate --deduplicate + --sparse # Show sparse directories in the presence of a sparse index + --no-sparse # Negate --sparse + --format: text # Format to use for the output +] + +export complete [git ls-remote] [ + repository?: by "nu-complete git remotes" + ...patterns: text + --quiet(-q) # Do not print remote URL + --no-quiet # Negate --quiet + --upload-pack: text # Path of git-upload-pack on the remote host + --no-upload-pack # Negate --upload-pack + --tags(-t) # Limit to tags + --no-tags # Negate --tags + --branches(-b) # Limit to branches + --no-branches # Negate --branches + --refs # Do not show peeled tags + --no-refs # Negate --refs + --get-url # Take url.<base>.insteadOf into account + --no-get-url # Negate --get-url + --sort: words [refname -refname committerdate -committerdate creatordate -creatordate authordate -authordate taggerdate -taggerdate "version:refname" "-version:refname" objectsize -objectsize objecttype upstream HEAD] # Field name to sort on + --no-sort # Negate --sort + --exit-code # Exit with exit code 2 if no matching refs are found + --no-exit-code # Negate --exit-code + --symref # Show underlying ref in addition to the object pointed by it + --no-symref # Negate --symref + --server-option(-o): text # Option to transmit + --no-server-option # Negate --server-option +] + +export complete [git ls-tree] [ + tree_ish: by "nu-complete git refs" + ...path: path + -d # Only show trees + -r # Recurse into subtrees + -t # Show trees when recursing + -z # Terminate entries with NUL byte + --long(-l) # Include object size + --name-only # List only filenames + --name-status # List only filenames + --object-only # List only objects + --full-name # Use full path names + --no-full-name # Negate --full-name + --full-tree # List entire tree; not just current directory (implies --full-name) + --no-full-tree # Negate --full-tree + --format: text # Format to use for the output + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev +] + +export complete [git maintenance] [ + ...args: path +] + +export complete [git merge-base] [ + ...commit: by "nu-complete git refs" + --all(-a) # Output all common ancestors + --no-all # Negate --all + --octopus # Find ancestors for a single n-way merge + --independent # List revs not reachable from others + --is-ancestor # Is the first one ancestor of the other? + --fork-point # Find where <commit> forked from reflog of <ref> +] + +export complete [git merge-file] [ + current: path + base: path + other: path + --stdout(-p) # Send results to standard output + --no-stdout # Negate --stdout + --object-id # Use object IDs instead of filenames + --no-object-id # Negate --object-id + --diff3 # Use a diff3 based merge + --no-diff3 # Negate --diff3 + --zdiff3 # Use a zealous diff3 based merge + --no-zdiff3 # Negate --zdiff3 + --ours # For conflicts, use our version + --no-ours # Negate --ours + --theirs # For conflicts, use their version + --no-theirs # Negate --theirs + --union # For conflicts, use a union version + --no-union # Negate --union + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --marker-size: text # For conflicts, use this marker size + --no-marker-size # Negate --marker-size + --quiet(-q) # Do not warn about conflicts + --no-quiet # Negate --quiet + -L: text # Set labels for file1/orig-file/file2 +] + +export complete [git merge-index] [ + ...args: path +] + +export complete [git merge-tree] [ + ...commit: by "nu-complete git refs" + --write-tree # Do a real merge instead of a trivial merge + --trivial-merge # Do a trivial merge only + --messages # Also show informational/conflict messages + --no-messages # Negate --messages + --quiet # Suppress all output; only exit status wanted + -z # Separate paths with the NUL character + --name-only # List filenames without modes/oids/stages + --allow-unrelated-histories # Allow merging unrelated histories + --stdin # Perform multiple merges, one per line of input + --merge-base: by "nu-complete git refs" # Specify a merge-base for the merge + --no-merge-base # Negate --merge-base + --strategy-option(-X): words [ours theirs ignore-space-change ignore-all-space ignore-space-at-eol ignore-cr-at-eol renormalize no-renormalize find-renames find-renames= rename-threshold= subtree= diff-algorithm=patience diff-algorithm=minimal diff-algorithm=histogram diff-algorithm=myers] # Option for selected merge strategy + --no-strategy-option # Negate --strategy-option +] + +export complete [git mktag] [ + ...args: path + --strict # Enable more strict checking + --no-strict # Negate --strict +] + +export complete [git mktree] [ + ...args: path + -z # Input is NUL terminated + --missing # Allow missing objects + --no-missing # Negate --missing + --batch # Allow creation of more than one tree + --no-batch # Negate --batch +] + +export complete [git multi-pack-index] [ + ...args: path + --object-dir: path # Object directory containing set of packfile and pack-index pairs + --no-object-dir # Negate --object-dir + --progress # Force progress reporting + --no-progress # Negate --progress +] + +export complete [git name-rev] [ + ...commit: by "nu-complete git refs" + --name-only # Print only ref-based names (no object names) + --no-name-only # Negate --name-only + --tags # Only use tags to name the commits + --no-tags # Negate --tags + --refs: text # Only use refs matching <pattern> + --no-refs # Negate --refs + --exclude: text # Ignore refs matching <pattern> + --no-exclude # Negate --exclude + --all # List all commits reachable from all refs + --no-all # Negate --all + --annotate-stdin # Annotate text from stdin + --no-annotate-stdin # Negate --annotate-stdin + --undefined # Allow to print `undefined` names (default) + --no-undefined # Negate --undefined + --always # Show abbreviated commit object as fallback + --no-always # Negate --always +] + +export complete [git notes] [ + ...args: text + --ref: by "nu-complete git notes-refs" # Use notes from <notes-ref> + --no-ref # Negate --ref +] + +export complete [git pack-redundant] [ + ...args: path +] + +export complete [git pack-refs] [ + ...args: path + --all # Pack everything + --no-all # Negate --all + --prune # Prune loose refs (default) + --no-prune # Negate --prune + --auto # Auto-pack refs as needed + --no-auto # Negate --auto + --include: text # References to include + --no-include # Negate --include + --exclude: text # References to exclude + --no-exclude # Negate --exclude +] + +export complete [git patch-id] [ + ...args: path + --unstable # Use the unstable patch ID algorithm + --stable # Use the stable patch ID algorithm + --verbatim # Don't strip whitespace from the patch +] + +export complete [git pickaxe] [ + ...args: path + --incremental # Show blame entries as we find them, incrementally + --no-incremental # Negate --incremental + -b # Do not show object names of boundary commits (Default: off) + --root # Do not treat root commits as boundaries (Default: off) + --no-root # Negate --root + --show-stats # Show work cost statistics + --no-show-stats # Negate --show-stats + --progress # Force progress reporting + --no-progress # Negate --progress + --score-debug # Show output score for blame entries + --no-score-debug # Negate --score-debug + --show-name(-f) # Show original filename (Default: auto) + --no-show-name # Negate --show-name + --show-number(-n) # Show original linenumber (Default: off) + --no-show-number # Negate --show-number + --porcelain(-p) # Show in a format designed for machine consumption + --no-porcelain # Negate --porcelain + --line-porcelain # Show porcelain format with per-line commit information + --no-line-porcelain # Negate --line-porcelain + -c # Use the same output mode as git-annotate (Default: off) + -t # Show raw timestamp (Default: off) + -l # Show long commit SHA1 (Default: off) + -s # Suppress author name and timestamp (Default: off) + --show-email(-e) # Show author email instead of name (Default: off) + --no-show-email # Negate --show-email + -w # Ignore whitespace differences + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --ignore-rev: text # Ignore <rev> when blaming + --no-ignore-rev # Negate --ignore-rev + --ignore-revs-file: path # Ignore revisions from <file> + --no-ignore-revs-file # Negate --ignore-revs-file + --color-lines # Color redundant metadata from previous line differently + --no-color-lines # Negate --color-lines + --color-by-age # Color lines by age + --no-color-by-age # Negate --color-by-age + -S: path # Use revisions from <file> instead of calling git-rev-list + --contents: path # Use <file>'s contents as the final image + --no-contents # Negate --contents + -C?: text # Find line copies within and across files + -M?: text # Find line movements within and across files + -L: text # Process only line range <start>,<end> or function :<funcname> + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev +] + +export complete [git prune-packed] [ + ...args: path + --dry-run(-n) # Dry run + --no-dry-run # Negate --dry-run + --quiet(-q) # Be quiet + --no-quiet # Negate --quiet +] + +export complete [git range-diff] [ + ...range: by "nu-complete git refs" + --creation-factor: text # Percentage by which creation is weighted + --no-creation-factor # Negate --creation-factor + --no-dual-color # Use simple diff colors + --dual-color # Opposite of --no-dual-color + --notes?: by "nu-complete git notes-refs" # Passed to 'git log' + --no-notes # Negate --notes + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Passed to 'git log' + --no-diff-merges # Negate --diff-merges + --max-memory: text # Maximum memory for cost matrix (default 4G) + --no-max-memory # Negate --max-memory + --remerge-diff # Passed to 'git log' + --no-remerge-diff # Negate --remerge-diff + --left-only # Only emit output related to the first range + --no-left-only # Negate --left-only + --right-only # Only emit output related to the second range + --no-right-only # Negate --right-only + --patch(-p) # Generate patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Generate diffs with <n> lines context + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --quiet # Disable all output of the program + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file +] + +export complete [git read-tree] [ + ...tree_ish: by "nu-complete git refs" + --index-output: path # Write resulting index to <file> + --empty # Only empty the index + --no-empty # Negate --empty + --verbose(-v) # Be verbose + --no-verbose # Negate --verbose + -m # Perform a merge in addition to a read + --trivial # 3-way merge if no file level merging required + --no-trivial # Negate --trivial + --aggressive # 3-way merge in presence of adds and removes + --no-aggressive # Negate --aggressive + --reset # Same as -m, but discard unmerged entries + --no-reset # Negate --reset + --prefix: path # Read the tree into the index under <subdirectory>/ + -u # Update working tree with merge result + --exclude-per-directory: text # Allow explicitly ignored files to be overwritten + -i # Don't check the working tree after merging + --dry-run(-n) # Don't update the index or the work tree + --no-dry-run # Negate --dry-run + --no-sparse-checkout # Skip applying sparse checkout filter + --sparse-checkout # Opposite of --no-sparse-checkout + --debug-unpack # Debug unpack-trees + --no-debug-unpack # Negate --debug-unpack + --recurse-submodules?: text # Control recursive updating of submodules + --no-recurse-submodules # Negate --recurse-submodules + --quiet(-q) # Suppress feedback messages + --no-quiet # Negate --quiet +] + +export complete [git refs] [ + ...args: path +] + +export complete [git repack] [ + ...args: path + -a # Pack everything in a single pack + -A # Same as -a, and turn unreachable objects loose + --cruft # Same as -a, pack unreachable cruft objects separately + --no-cruft # Negate --cruft + --cruft-expiration: text # With --cruft, expire objects older than this + --no-cruft-expiration # Negate --cruft-expiration + --combine-cruft-below-size: text # With --cruft, only repack cruft packs smaller than this + --max-cruft-size: text # With --cruft, limit the size of new cruft packs + -d # Remove redundant packs, and run git-prune-packed + -f # Pass --no-reuse-delta to git-pack-objects + -F # Pass --no-reuse-object to git-pack-objects + --name-hash-version: text # Specify the name hash version to use for grouping similar objects by path + --no-name-hash-version # Negate --name-hash-version + --path-walk # Pass --path-walk to git-pack-objects + --no-path-walk # Negate --path-walk + -n # Do not run git-update-server-info + --quiet(-q) # Be quiet + --no-quiet # Negate --quiet + --local(-l) # Pass --local to git-pack-objects + --no-local # Negate --local + --write-bitmap-index(-b) # Write bitmap index + --no-write-bitmap-index # Negate --write-bitmap-index + --delta-islands(-i) # Pass --delta-islands to git-pack-objects + --no-delta-islands # Negate --delta-islands + --unpack-unreachable: text # With -A, do not loosen objects older than this + --no-unpack-unreachable # Negate --unpack-unreachable + --keep-unreachable(-k) # With -a, repack unreachable objects + --no-keep-unreachable # Negate --keep-unreachable + --window: text # Size of the window used for delta compression + --no-window # Negate --window + --window-memory: text # Same as the above, but limit memory size instead of entries count + --no-window-memory # Negate --window-memory + --depth: text # Limits the maximum delta depth + --no-depth # Negate --depth + --threads: text # Limits the maximum number of threads + --no-threads # Negate --threads + --max-pack-size: text # Maximum size of each packfile + --filter: words ["blob:none" "blob:limit=" "tree:0" "tree:1" "sparse:oid=" "object:type=blob" "object:type=tree" "combine:"] # Object filtering + --no-filter # Negate --filter + --pack-kept-objects # Repack objects in packs marked with .keep + --no-pack-kept-objects # Negate --pack-kept-objects + --keep-pack: text # Do not repack this pack + --no-keep-pack # Negate --keep-pack + --geometric(-g): text # Find a geometric progression with factor <N> + --no-geometric # Negate --geometric + --write-midx?: text # Write a multi-pack index of the resulting packs + --no-write-midx # Negate --write-midx + --expire-to: path # Pack prefix to store a pack containing pruned objects + --no-expire-to # Negate --expire-to + --filter-to: path # Pack prefix to store a pack containing filtered out objects + --no-filter-to # Negate --filter-to + --drop-filtered # Delete filtered out objects (requires --filter) + --no-drop-filtered # Negate --drop-filtered + --dry-run # Only show which objects would be dropped + --no-dry-run # Negate --dry-run +] + +export complete [git replace] [ + object?: by "nu-complete git refs" + replacement?: by "nu-complete git refs" + --list(-l) # List replace refs + --delete(-d) # Delete replace refs + --edit(-e) # Edit existing object + --graft(-g) # Change a commit's parents + --convert-graft-file # Convert existing graft file + --force(-f) # Replace the ref if it exists + --no-force # Negate --force + --raw # Do not pretty-print contents for --edit + --no-raw # Negate --raw + --format: text # Use this format + --no-format # Negate --format +] + +export complete [git replay] [ + ...revision_range: by "nu-complete git refs" + --contained # Update all branches that point at commits in <revision-range> + --no-contained # Negate --contained + --onto: by "nu-complete git refs" # Replay onto given commit + --advance: text # Make replay advance given branch + --revert: text # Revert commits onto given branch + --ref: text # Reference to update with result + --ref-action: text # Control ref update behavior (update|print) + --linearize # Drop merge commits, replaying only non-merge commits + --no-linearize # Negate --linearize +] + +export complete [git repo] [ + ...args: path +] + +export complete [git rev-list] [ + ...commit: by "nu-complete git refs" + --max-count(-n): text # Limit the number of commits to output + --skip: text # Skip number commits before starting to show the output + --since: text # Show commits more recent than a specific date + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --until: text # Show commits older than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --author: by "nu-complete git authors" # Limit to commits whose author matches the pattern + --committer: by "nu-complete git authors" # Limit to commits whose committer matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --grep: text # Limit to commits whose log message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --first-parent # Follow only the first parent commit upon seeing a merge commit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --all # Pretend all refs in refs/ and HEAD are listed on the command line + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --reverse # Output the selected commits in reverse order + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --pretty?: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --format: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --abbrev?: text # Show object names with at least <n> hexdigits + --no-abbrev # Show full object names + --abbrev-commit # Show a prefix of the commit object name + --no-abbrev-commit # Show the full commit object name + --oneline # Shorthand for --pretty=oneline --abbrev-commit + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --date: words [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] # Format for dates shown in human-readable form + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --graph # Draw a text-based graphical representation of the commit history + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + -c # Show combined diff format for merge commits + --cc # Show dense combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + -t # Show the tree objects in the diff output + --log-size # Include a line with the log message length in bytes + --follow # Continue listing the history of a file beyond renames + --count # Print a number stating how many commits would have been listed + --quiet # Do not print anything to standard output + --objects # Also print the IDs of objects referenced by the listed commits + --objects-edge # Like --objects, but also print the IDs of excluded commits + --disk-usage?: words [human] + --unpacked # Only print objects that are not in packs + --header # Print the contents of the commit in raw format + --object-names # Print the names of objects found by --objects + --no-object-names # Negate --object-names + -z # Separate commits and objects with NUL characters + --bisect-vars # Print variables ready to be eval'ed by the shell for bisection + --bisect-all # Output all commits between included and excluded commits, ordered by distance +] + +export complete [git rev-parse] [ + ...args: by "nu-complete git refs" + --parseopt # Use git rev-parse in option parsing mode + --sq-quote # Use git rev-parse in shell quoting mode + --keep-dashdash # Only meaningful in --parseopt mode + --stop-at-non-option # Only meaningful in --parseopt mode + --stuck-long # Only meaningful in --parseopt mode + --revs-only # Do not output flags and parameters not meant for rev-list + --no-revs # Do not output flags and parameters meant for rev-list + --flags # Do not output non-flag parameters + --no-flags # Do not output flag parameters + --default: text # Use <arg> if there is no parameter given + --prefix: text # Behave as if invoked from the <arg> subdirectory + --verify # Verify that exactly one parameter is given and it can be turned into a raw SHA-1 + --quiet(-q) # Only meaningful in --verify mode; do not output an error message + --sq # Output a single line properly quoted for shell consumption + --short?: text # Shorten the object name to a unique prefix + --not # Prefix object names with ^ + --abbrev-ref?: words [strict loose] # A non-ambiguous short name of the object's name + --symbolic # Output names in a form as close to the original input as possible + --symbolic-full-name # Like --symbolic, but omit input that are not refs + --output-object-format: words [sha1 sha256] # Output object names in this hash format + --all # Show all refs found in refs/ + --branches?: text # Show all branches + --tags?: text # Show all tags + --remotes?: text # Show all remote-tracking branches + --glob: text # Show all refs matching the shell glob pattern + --exclude: text # Do not include refs matching the pattern + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given section + --disambiguate: text # Show every object whose name begins with the given prefix + --local-env-vars # List the GIT_* environment variables that are local to the repository + --path-format: words [absolute relative] # Control whether paths are absolute or relative + --git-dir # Show $GIT_DIR if defined, otherwise the path to the .git directory + --git-common-dir # Show $GIT_COMMON_DIR if defined, else $GIT_DIR + --resolve-git-dir: path # Check if <path> is a valid repository or a gitfile + --git-path: path # Resolve $GIT_DIR/<path> taking relocation variables into account + --show-toplevel # Show the absolute path of the top-level directory of the working tree + --show-superproject-working-tree # Show the root of the superproject's working tree + --shared-index-path # Show the path to the shared index file in split index mode + --absolute-git-dir # Like --git-dir, but the output is always canonicalized + --is-inside-git-dir # Print true if the cwd is below the repository directory + --is-inside-work-tree # Print true if the cwd is inside the work tree + --is-bare-repository # Print true if the repository is bare + --is-shallow-repository # Print true if the repository is shallow + --show-cdup # Show the path of the top-level directory relative to the cwd + --show-prefix # Show the path of the cwd relative to the top-level directory + --show-object-format?: words [storage input output] # Show the object format (hash algorithm) used for the repository + --show-ref-format # Show the reference storage format used for the repository + --since: text # Parse the date and output the corresponding --max-age= parameter + --after: text # Parse the date and output the corresponding --max-age= parameter + --until: text # Parse the date and output the corresponding --min-age= parameter + --before: text # Parse the date and output the corresponding --min-age= parameter +] + +export complete [git shortlog] [ + ...revision_range: by "nu-complete git refs" + --committer(-c) # Group by committer rather than author + --no-committer # Negate --committer + --numbered(-n) # Sort output according to the number of commits per author + --no-numbered # Negate --numbered + --summary(-s) # Suppress commit descriptions, only provides commit count + --no-summary # Negate --summary + --email(-e) # Show the email address of each author + --no-email # Negate --email + -w?: text # Linewrap output + --group: text # Group by field + --no-group # Negate --group + --max-count: text # Limit the number of commits to output + --skip: text # Skip number commits before starting to show the output + --since: text # Show commits more recent than a specific date + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --until: text # Show commits older than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --author: by "nu-complete git authors" # Limit to commits whose author matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --grep: text # Limit to commits whose log message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --first-parent # Follow only the first parent commit upon seeing a merge commit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --all # Pretend all refs in refs/ and HEAD are listed on the command line + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --reverse # Output the selected commits in reverse order + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --pretty?: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --format: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --abbrev?: text # Show object names with at least <n> hexdigits + --no-abbrev # Show full object names + --abbrev-commit # Show a prefix of the commit object name + --no-abbrev-commit # Show the full commit object name + --oneline # Shorthand for --pretty=oneline --abbrev-commit + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --date: words [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] # Format for dates shown in human-readable form + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --graph # Draw a text-based graphical representation of the commit history + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + --cc # Show dense combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + -t # Show the tree objects in the diff output + --log-size # Include a line with the log message length in bytes + --follow # Continue listing the history of a file beyond renames + --count # Print a number stating how many commits would have been listed +] + +export complete [git show-branch] [ + ...rev: by "nu-complete git refs" + --all(-a) # Show remote-tracking and local branches + --no-all # Negate --all + --remotes(-r) # Show remote-tracking branches + --no-remotes # Negate --remotes + --color?: words [always never auto] # Color '*!+-' corresponding to the branch + --no-color # Negate --color + --more?: text # Show <n> more commits after the common ancestor + --no-more # Negate --more + --list # Synonym to more=-1 + --no-list # Negate --list + --no-name # Suppress naming strings + --name # Opposite of --no-name + --current # Include the current branch + --no-current # Negate --current + --sha1-name # Name commits with their object names + --no-sha1-name # Negate --sha1-name + --merge-base # Show possible merge bases + --no-merge-base # Negate --merge-base + --independent # Show refs unreachable from any other ref + --no-independent # Negate --independent + --topo-order # Show commits in topological order + --topics # Show only commits not on the first branch + --no-topics # Negate --topics + --sparse # Show merges reachable from only one tip + --no-sparse # Negate --sparse + --date-order # Topologically sort, maintaining date order where possible + --reflog(-g)?: text # Show <n> most recent ref-log entries starting at base +] + +export complete [git show-ref] [ + ...pattern: by "nu-complete git refs" + --tags # Only show tags (can be combined with --branches) + --no-tags # Negate --tags + --branches # Only show branches (can be combined with --tags) + --no-branches # Negate --branches + --exists # Check for reference existence without resolving + --no-exists # Negate --exists + --verify # Stricter reference checking, requires exact ref path + --no-verify # Negate --verify + --head # Show the HEAD reference, even if it would be filtered out + --no-head # Negate --head + --dereference(-d) # Dereference tags into object IDs + --no-dereference # Negate --dereference + --hash(-s)?: text # Only show SHA1 hash using <n> digits + --no-hash # Negate --hash + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --quiet(-q) # Do not print results to stdout (useful with --verify) + --no-quiet # Negate --quiet + --exclude-existing?: text # Show refs from stdin that aren't in local repository +] + +export complete [git sparse-checkout] [ + ...args: path +] + +export complete [git stage] [ + ...pathspec: by "nu-complete git files" + --dry-run(-n) # Dry run + --no-dry-run # Negate --dry-run + --verbose(-v) # Be verbose + --no-verbose # Negate --verbose + --interactive(-i) # Interactive picking + --no-interactive # Negate --interactive + --patch(-p) # Select hunks interactively + --no-patch # Negate --patch + --auto-advance # Auto advance to the next file when selecting hunks interactively + --no-auto-advance # Negate --auto-advance + --unified(-U): text # Generate diffs with <n> lines context + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --edit(-e) # Edit current diff and apply + --no-edit # Negate --edit + --force(-f) # Allow adding otherwise ignored files + --no-force # Negate --force + --update(-u) # Update tracked files + --no-update # Negate --update + --renormalize # Renormalize EOL of tracked files (implies -u) + --no-renormalize # Negate --renormalize + --resolved # Add conflict-resolved tracked files + --no-resolved # Negate --resolved + --intent-to-add(-N) # Record only the fact that the path will be added later + --no-intent-to-add # Negate --intent-to-add + --all(-A) # Add changes from all tracked and untracked files + --no-all # Negate --all + --ignore-removal # Ignore paths removed in the working tree (same as --no-all) + --no-ignore-removal # Negate --ignore-removal + --refresh # Don't add, only refresh the index + --no-refresh # Negate --refresh + --ignore-errors # Just skip files which cannot be added because of errors + --no-ignore-errors # Negate --ignore-errors + --ignore-missing # Check if - even missing - files are ignored in dry run + --no-ignore-missing # Negate --ignore-missing + --sparse # Allow updating entries outside of the sparse-checkout cone + --no-sparse # Negate --sparse + --chmod: words [+x -x] # Override the executable bit of the listed files + --no-chmod # Negate --chmod + --pathspec-from-file: path # Read pathspec from file + --no-pathspec-from-file # Negate --pathspec-from-file + --pathspec-file-nul # With --pathspec-from-file, pathspec elements are separated with NUL character + --no-pathspec-file-nul # Negate --pathspec-file-nul +] + +export complete [git stripspace] [ + ...args: path + --strip-comments(-s) # Skip and remove all lines starting with comment character + --comment-lines(-c) # Prepend comment character and space to each line +] + +export complete [git symbolic-ref] [ + name: by "nu-complete git full-refs" + ref?: by "nu-complete git full-refs" + --quiet(-q) # Suppress error message for non-symbolic (detached) refs + --no-quiet # Negate --quiet + --delete(-d) # Delete symbolic ref + --no-delete # Negate --delete + --short # Shorten ref output + --no-short # Negate --short + --recurse # Recursively dereference (default) + --no-recurse # Negate --recurse + -m: text # Reason of the update +] + +export complete [git update-index] [ + ...file: path + -q # Continue refresh even when index needs update + --ignore-submodules # Refresh: ignore submodules + --no-ignore-submodules # Negate --ignore-submodules + --add # Do not ignore new files + --no-add # Negate --add + --replace # Let files replace directories and vice-versa + --no-replace # Negate --replace + --remove # Notice files missing from worktree + --no-remove # Negate --remove + --unmerged # Refresh even if index contains unmerged entries + --no-unmerged # Negate --unmerged + --refresh # Refresh stat information + --really-refresh # Like --refresh, but ignore assume-unchanged setting + --cacheinfo: path # Add the specified entry to the index + --chmod: words [+x -x] # Override the executable bit of the listed files + --assume-unchanged # Mark files as "not changing" + --no-assume-unchanged # Clear assumed-unchanged bit + --skip-worktree # Mark files as "index-only" + --no-skip-worktree # Clear skip-worktree bit + --ignore-skip-worktree-entries # Do not touch index-only entries + --no-ignore-skip-worktree-entries # Negate --ignore-skip-worktree-entries + --info-only # Add to index only; do not add content to object database + --no-info-only # Negate --info-only + --force-remove # Remove named paths even if present in worktree + --no-force-remove # Negate --force-remove + -z # With --stdin: input lines are terminated by null bytes + --stdin # Read list of paths to be updated from standard input + --index-info # Add entries from standard input to the index + --unresolve # Repopulate stages #2 and #3 for the listed paths + --again(-g) # Only update entries that differ from HEAD + --ignore-missing # Ignore files missing from worktree + --no-ignore-missing # Negate --ignore-missing + --verbose # Report actions to standard output + --no-verbose # Negate --verbose + --clear-resolve-undo # (for porcelains) forget saved unresolved conflicts + --index-version: text # Write index in this format + --no-index-version # Negate --index-version + --show-index-version # Report on-disk index format version + --no-show-index-version # Negate --show-index-version + --split-index # Enable or disable split index + --no-split-index # Negate --split-index + --untracked-cache # Enable/disable untracked cache + --no-untracked-cache # Negate --untracked-cache + --test-untracked-cache # Test if the filesystem supports untracked cache + --no-test-untracked-cache # Negate --test-untracked-cache + --force-untracked-cache # Enable untracked cache without testing the filesystem + --no-force-untracked-cache # Negate --force-untracked-cache + --force-write-index # Write out the index even if is not flagged as changed + --no-force-write-index # Negate --force-write-index + --fsmonitor # Enable or disable file system monitor + --no-fsmonitor # Negate --fsmonitor + --fsmonitor-valid # Mark files as fsmonitor valid + --no-fsmonitor-valid # Clear fsmonitor valid bit +] + +export complete [git update-ref] [ + ref: by "nu-complete git full-refs" + new_value?: by "nu-complete git refs" + old_value?: by "nu-complete git refs" + -m: text # Reason of the update + -d # Delete the reference + --no-deref # Update <refname> not the one it points to + --deref # Opposite of --no-deref + -z # Stdin has NUL-terminated arguments + --stdin # Read updates from stdin + --no-stdin # Negate --stdin + --create-reflog # Create a reflog + --no-create-reflog # Negate --create-reflog + --batch-updates(-0) # Batch reference updates + --no-batch-updates # Negate --batch-updates +] + +export complete [git update-server-info] [ + ...args: path + --force(-f) # Update the info files from scratch + --no-force # Negate --force +] + +export complete [git url-parse] [ + ...args: path + --component(-c): words [protocol user password host port path] # Which URL component to extract + --no-component # Negate --component +] + +export complete [git var] [ + variable?: by "nu-complete git vars" +] + +export complete [git verify-commit] [ + ...commit: by "nu-complete git commits" + --verbose(-v) # Print commit contents + --no-verbose # Negate --verbose + --raw # Print raw gpg status output + --no-raw # Negate --raw +] + +export complete [git verify-pack] [ + ...args: path + --verbose(-v) # Verbose + --no-verbose # Negate --verbose + --stat-only(-s) # Show statistics only + --no-stat-only # Negate --stat-only + --object-format: words [sha1 sha256] # Specify the hash algorithm to use + --no-object-format # Negate --object-format +] + +export complete [git verify-tag] [ + ...tag: by "nu-complete git tags" + --verbose(-v) # Print tag contents + --no-verbose # Negate --verbose + --raw # Print raw gpg status output + --no-raw # Negate --raw + --format: text # Format to use for the output + --no-format # Negate --format +] + +export complete [git version] [ + ...args: path + --build-options # Also print build options + --no-build-options # Negate --build-options +] + +export complete [git whatchanged] [ + ...args: by "nu-complete git refs" + --quiet(-q) # Suppress diff output + --no-quiet # Negate --quiet + --source # Show source + --no-source # Negate --source + --use-mailmap # Use mail map file + --no-use-mailmap # Negate --use-mailmap + --mailmap # Alias of --use-mailmap + --no-mailmap # Negate --mailmap + --clear-decorations # Clear all previously-defined decoration filters + --decorate-refs: text # Only decorate refs that match <pattern> + --no-decorate-refs # Negate --decorate-refs + --decorate-refs-exclude: text # Do not decorate refs that match <pattern> + --no-decorate-refs-exclude # Negate --decorate-refs-exclude + --decorate?: words [short full auto no] # Decorate options + --no-decorate # Negate --decorate + -L: path # Trace the evolution of line range <start>,<end> or function :<funcname> in <file> + --patch(-p) # Generate patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file + --max-count(-n): text # Limit the number of commits to output + --skip: text # Skip number commits before starting to show the output + --since: text # Show commits more recent than a specific date + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --until: text # Show commits older than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --author: by "nu-complete git authors" # Limit to commits whose author matches the pattern + --committer: by "nu-complete git authors" # Limit to commits whose committer matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --grep: text # Limit to commits whose log message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --first-parent # Follow only the first parent commit upon seeing a merge commit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --all # Pretend all refs in refs/ and HEAD are listed on the command line + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --reverse # Output the selected commits in reverse order + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --pretty?: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --format: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --abbrev-commit # Show a prefix of the commit object name + --no-abbrev-commit # Show the full commit object name + --oneline # Shorthand for --pretty=oneline --abbrev-commit + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --date: words [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] # Format for dates shown in human-readable form + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --graph # Draw a text-based graphical representation of the commit history + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + -c # Show combined diff format for merge commits + --cc # Show dense combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + -t # Show the tree objects in the diff output + --log-size # Include a line with the log message length in bytes + --count # Print a number stating how many commits would have been listed +] + +export complete [git write-tree] [ + ...args: path + --missing-ok # Allow missing objects + --no-missing-ok # Negate --missing-ok + --prefix: text # Write tree object for a subdirectory <prefix> + --no-prefix # Negate --prefix +] + +# Like pop, but do not remove the state from the stash list +export complete [git stash apply] [ + stash?: by "nu-complete git stashes" +] + +# Create and check out a new branch starting from a stash entry +export complete [git stash branch] [ + branchname: text + stash?: by "nu-complete git stashes" +] + +# Save local modifications to a new stash entry (deprecated, use push) +export complete [git stash save] [ + message?: text +] + +# Remove all the stash entries +export complete [git stash clear] [ + ...args: text +] + +# Store a stash entry created via git stash create +export complete [git stash store] [ + commit: by "nu-complete git refs" +] + +# Export the stash entries as a chain of commits +export complete [git stash export] [ + ...stash: by "nu-complete git stashes" +] + +# Import stash entries from a chain of commits +export complete [git stash import] [ + commit: by "nu-complete git refs" +] + +# Remove the remote named <name> +export complete [git remote rm] [ + name: by "nu-complete git remotes" +] + +# Set or delete the default branch for the named remote +export complete [git remote set-head] [ + name: by "nu-complete git remotes" + branch?: by "nu-complete git remote-branches" +] + +# Give some information about the remote <name> +export complete [git remote show] [ + ...name: by "nu-complete git remotes" +] + +# Delete stale references associated with <name> +export complete [git remote prune] [ + ...name: by "nu-complete git remotes" +] + +# Fetch updates for remotes or remote groups +export complete [git remote update] [ + ...group_or_remote: by "nu-complete git remotes" +] + +# Change the list of branches tracked by the named remote +export complete [git remote set-branches] [ + name: by "nu-complete git remotes" + ...branch: by "nu-complete git remote-branches" +] + +# Repair worktree administrative files +export complete [git worktree repair] [ + ...path: path +] + +# List the notes object for a given object, or all notes +export complete [git notes list] [ + object?: by "nu-complete git refs" +] + +# Add notes for a given object +export complete [git notes add] [ + object?: by "nu-complete git refs" +] + +# Copy the notes for the first object onto the second object +export complete [git notes copy] [ + from_object: by "nu-complete git refs" + to_object: by "nu-complete git refs" +] + +# Append new message(s) to an existing note +export complete [git notes append] [ + object?: by "nu-complete git refs" +] + +# Edit the notes for a given object +export complete [git notes edit] [ + object?: by "nu-complete git refs" +] + +# Show the notes for a given object +export complete [git notes show] [ + object?: by "nu-complete git refs" +] + +# Merge the given notes ref into the current notes ref +export complete [git notes merge] [ + notes_ref?: by "nu-complete git notes-refs" +] + +# Remove the notes for given objects +export complete [git notes remove] [ + ...object: by "nu-complete git refs" +] + +# Remove all notes for non-existing/unreachable objects +export complete [git notes prune] [ + ...args: text +] + +# Print the current notes ref +export complete [git notes get-ref] [ + ...args: text +] + +# Show the log of a reference +export complete [git reflog show] [ + ref?: by "nu-complete git refs" + ...args: by "nu-complete git refs" + --patch(-p) # Generate patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --quiet # Disable all output of the program + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file + --max-count(-n): text # Limit the number of commits to output + --skip: text # Skip number commits before starting to show the output + --since: text # Show commits more recent than a specific date + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --until: text # Show commits older than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --author: by "nu-complete git authors" # Limit to commits whose author matches the pattern + --committer: by "nu-complete git authors" # Limit to commits whose committer matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --grep: text # Limit to commits whose log message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --first-parent # Follow only the first parent commit upon seeing a merge commit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --all # Pretend all refs in refs/ and HEAD are listed on the command line + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --reverse # Output the selected commits in reverse order + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --pretty?: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --format: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --abbrev-commit # Show a prefix of the commit object name + --no-abbrev-commit # Show the full commit object name + --oneline # Shorthand for --pretty=oneline --abbrev-commit + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --date: words [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] # Format for dates shown in human-readable form + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --graph # Draw a text-based graphical representation of the commit history + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + -c # Show combined diff format for merge commits + --cc # Show dense combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + -t # Show the tree objects in the diff output + --log-size # Include a line with the log message length in bytes + --count # Print a number stating how many commits would have been listed +] + +# List all references which have a reflog +export complete [git reflog list] [ + ...args: text +] + +# Check whether a ref has a reflog +export complete [git reflog exists] [ + ref: by "nu-complete git full-refs" +] + +# Write a new entry to the reflog of a reference +export complete [git reflog write] [ + ref: by "nu-complete git full-refs" + old_oid: by "nu-complete git refs" + new_oid: by "nu-complete git refs" + message: text +] + +# Delete single entries from the reflog +export complete [git reflog delete] [ + ...entry: by "nu-complete git reflog-entries" +] + +# Remove the reflog of the given references completely +export complete [git reflog drop] [ + ...ref: by "nu-complete git full-refs" +] + +# Prune older reflog entries +export complete [git reflog expire] [ + ...ref: by "nu-complete git full-refs" +] + +# Create a bundle file +export complete [git bundle create] [ + file: path + ...rev: by "nu-complete git refs" + --quiet(-q) # Do not show progress meter + --no-quiet # Negate --quiet + --progress # Show progress meter + --no-progress # Negate --progress + --version: text # Specify bundle format version + --no-version # Negate --version +] + +# Check that a bundle file is valid and will apply cleanly +export complete [git bundle verify] [ + file: path + --quiet(-q) # Do not show bundle details + --no-quiet # Negate --quiet +] + +# List the references defined in the bundle +export complete [git bundle list-heads] [ + file: path + ...refname: by "nu-complete git full-refs" +] + +# Store the objects in the bundle in the repository +export complete [git bundle unbundle] [ + file: path + ...refname: by "nu-complete git full-refs" + --progress # Show progress meter + --no-progress # Negate --progress +] + +# Read the commit-graph file and verify its contents +export complete [git commit-graph verify] [ + ...args: text +] + +# Write a commit-graph file +export complete [git commit-graph write] [ + ...args: text +] + +# Write a new multi-pack-index file +export complete [git multi-pack-index write] [ + ...args: text +] + +# Compact a range of incremental multi-pack-index layers +export complete [git multi-pack-index compact] [ + ...args: text +] + +# Verify the contents of the multi-pack-index file +export complete [git multi-pack-index verify] [ + ...args: text +] + +# Delete pack-files that are tracked by the multi-pack-index but unused +export complete [git multi-pack-index expire] [ + ...args: text +] + +# Create a new pack-file containing objects in small pack-files +export complete [git multi-pack-index repack] [ + ...args: text +] + +# Run one or more maintenance tasks +export complete [git maintenance run] [ + ...args: text +] + +# Start running maintenance on the current repository +export complete [git maintenance start] [ + ...args: text +] + +# Halt the background maintenance schedule +export complete [git maintenance stop] [ + ...args: text +] + +# Add the current repository to the maintenance.repo config +export complete [git maintenance register] [ + ...args: text +] + +# Remove the current repository from background maintenance +export complete [git maintenance unregister] [ + ...args: text +] + +# Check whether maintenance needs to be run +export complete [git maintenance is-needed] [ + ...args: text +] + +# Enable the sparse-checkout setting (deprecated) +export complete [git sparse-checkout init] [ + ...args: text +] + +# Describe the directories or patterns in the sparse-checkout file +export complete [git sparse-checkout list] [ + ...args: text +] + +# Enable sparse-checkout and write a set of patterns +export complete [git sparse-checkout set] [ + ...dir: path +] + +# Add directories or patterns to the sparse-checkout +export complete [git sparse-checkout add] [ + ...dir: path +] + +# Reapply the sparsity pattern rules to paths in the working tree +export complete [git sparse-checkout reapply] [ + ...args: text +] + +# Disable sparse-checkout and restore the full working tree +export complete [git sparse-checkout disable] [ + ...args: text +] + +# Check whether sparsity rules match one or more paths +export complete [git sparse-checkout check-rules] [ + ...args: text +] + +# Remove files outside the sparse-checkout definition +export complete [git sparse-checkout clean] [ + ...args: text +] + +# Run the hook with the given name +export complete [git hook run] [ + hook_name: by "nu-complete git hooks" + ...args: text + --allow-unknown-hook-name # Allow running a hook with a non-native hook name + --no-allow-unknown-hook-name # Negate --allow-unknown-hook-name + --ignore-missing # Silently ignore missing requested <hook-name> + --no-ignore-missing # Negate --ignore-missing + --to-stdin: path # File to read into hooks' stdin + --no-to-stdin # Negate --to-stdin + --jobs(-j): text # Run up to <n> hooks simultaneously (-1 for CPU count) + --no-jobs # Negate --jobs +] + +# List the commands configured for the given hook +export complete [git hook list] [ + hook_name: by "nu-complete git hooks" + -z # Use NUL as line terminator + --show-scope # Show the config scope that defined each hook + --no-show-scope # Negate --show-scope + --allow-unknown-hook-name # Allow running a hook with a non-native hook name + --no-allow-unknown-hook-name # Negate --allow-unknown-hook-name +] + +# Migrate ref store between different formats +export complete [git refs migrate] [ + ...args: text +] + +# Verify reference database consistency +export complete [git refs verify] [ + ...args: text +] + +# List references in the repository +export complete [git refs list] [ + ...pattern: by "nu-complete git full-refs" +] + +# Check whether the given reference exists +export complete [git refs exists] [ + ref: by "nu-complete git full-refs" +] + +# Optimize references to improve repository performance +export complete [git refs optimize] [ + ...args: text +] + +# Create a reference +export complete [git refs create] [ + ref: by "nu-complete git full-refs" + new_value: by "nu-complete git refs" +] + +# Delete a reference +export complete [git refs delete] [ + ref: by "nu-complete git full-refs" + old_value?: by "nu-complete git refs" +] + +# Update a reference +export complete [git refs update] [ + ref: by "nu-complete git full-refs" + new_value: by "nu-complete git refs" + old_value?: by "nu-complete git refs" +] + +# Retrieve metadata-related information about the repository +export complete [git repo info] [ + ...key: by "nu-complete git repo-keys" +] + +# Retrieve statistics about the repository structure +export complete [git repo structure] [ + ...args: text +] + +# Drop a commit from the history +export complete [git history drop] [ + commit: by "nu-complete git commits" +] + +# Fix up a commit with the staged changes +export complete [git history fixup] [ + commit: by "nu-complete git commits" +] + +# Rewrite the commit message of a commit +export complete [git history reword] [ + commit: by "nu-complete git commits" +] + +# Split a commit into two +export complete [git history split] [ + commit: by "nu-complete git commits" + ...pathspec: path +] + +# Mark a revision as new (containing the change) +export complete [git bisect new] [ + rev?: by "nu-complete git commits" +] + +# Mark revisions as old (before the change) +export complete [git bisect old] [ + ...rev: by "nu-complete git commits" +] + +# Show the terms used for the current bisect session +export complete [git bisect terms] [ + ...args: text + --term-good # Show the term for the old state + --term-old # Show the term for the old state + --term-bad # Show the term for the new state + --term-new # Show the term for the new state +] + +# Find the next bisection commit to test +export complete [git bisect next] [ + ...args: text +] + +# Show the remaining suspects in a viewer +export complete [git bisect visualize] [ + ...args: by "nu-complete git refs" + --patch(-p) # Generate patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --quiet # Disable all output of the program + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file + --max-count(-n): text # Limit the number of commits to output + --skip: text # Skip number commits before starting to show the output + --since: text # Show commits more recent than a specific date + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --until: text # Show commits older than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --author: by "nu-complete git authors" # Limit to commits whose author matches the pattern + --committer: by "nu-complete git authors" # Limit to commits whose committer matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --grep: text # Limit to commits whose log message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --first-parent # Follow only the first parent commit upon seeing a merge commit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --all # Pretend all refs in refs/ and HEAD are listed on the command line + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --reverse # Output the selected commits in reverse order + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --pretty?: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --format: text # Pretty-print the commit logs in the given format + --abbrev-commit # Show a prefix of the commit object name + --no-abbrev-commit # Show the full commit object name + --oneline # Shorthand for --pretty=oneline --abbrev-commit + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --date: words [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] # Format for dates shown in human-readable form + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --graph # Draw a text-based graphical representation of the commit history + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + -c # Show combined diff format for merge commits + --cc # Show dense combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + -t # Show the tree objects in the diff output + --log-size # Include a line with the log message length in bytes + --count # Print a number stating how many commits would have been listed +] + +# Show the remaining suspects in a viewer +export complete [git bisect view] [ + ...args: by "nu-complete git refs" + --patch(-p) # Generate patch + --no-patch(-s) # Suppress diff output + -u # Generate patch + --unified(-U)?: text # Generate diffs with <n> lines context + --function-context(-W) # Show the whole function as context lines + --no-function-context # Negate --function-context + --raw # Generate the diff in raw format + --patch-with-raw # Synonym for '-p --raw' + --patch-with-stat # Synonym for '-p --stat' + --numstat # Machine friendly --stat + --shortstat # Output only the last line of --stat + --dirstat(-X)?: text # Output the distribution of relative amount of changes for each sub-directory + --cumulative # Synonym for --dirstat=cumulative + --dirstat-by-file?: text # Synonym for --dirstat=files,<param1>,<param2>... + --check # Warn if changes introduce conflict markers or whitespace errors + --summary # Condensed summary such as creations, renames and mode changes + --name-only # Show only names of changed files + --name-status # Show only names and status of changed files + --stat?: text # Generate diffstat + --stat-width: text # Generate diffstat with a given width + --stat-name-width: text # Generate diffstat with a given name width + --stat-graph-width: text # Generate diffstat with a given graph width + --stat-count: text # Generate diffstat with limited lines + --compact-summary # Generate compact summary in diffstat + --no-compact-summary # Negate --compact-summary + --binary # Output a binary diff that can be applied + --full-index # Show full pre- and post-image object names on the "index" lines + --no-full-index # Negate --full-index + --color?: words [always never auto] # Show colored diff + --no-color # Negate --color + --ws-error-highlight: words [context old new all default none] # Highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff + -z # Do not munge pathnames and use NULs as output field terminators in --raw or --numstat + --abbrev?: text # Use <n> digits to display object names + --no-abbrev # Negate --abbrev + --src-prefix: text # Show the given source prefix instead of "a/" + --dst-prefix: text # Show the given destination prefix instead of "b/" + --line-prefix: text # Prepend an additional prefix to every line of output + --no-prefix # Do not show any source or destination prefix + --default-prefix # Use default prefixes a/ and b/ + --inter-hunk-context: text # Show context between diff hunks up to the specified number of lines + --output-indicator-new: text # Specify the character to indicate a new line instead of '+' + --output-indicator-old: text # Specify the character to indicate an old line instead of '-' + --output-indicator-context: text # Specify the character to indicate a context instead of ' ' + --break-rewrites(-B)?: text # Break complete rewrite changes into pairs of delete and create + --find-renames(-M)?: text # Detect renames + --irreversible-delete(-D) # Omit the preimage for deletes + --find-copies(-C)?: text # Detect copies + --find-copies-harder # Use unmodified files as source to find copies + --no-find-copies-harder # Negate --find-copies-harder + --no-renames # Disable rename detection + --rename-empty # Use empty blobs as rename source + --no-rename-empty # Negate --rename-empty + --follow # Continue listing the history of a file beyond renames + --no-follow # Negate --follow + -l: text # Limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value + --minimal # Produce the smallest possible diff + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace + --ignore-space-at-eol # Ignore changes in whitespace at EOL + --ignore-cr-at-eol # Ignore carrier-return at the end of line + --ignore-blank-lines # Ignore changes whose lines are all blank + --ignore-matching-lines(-I): text # Ignore changes whose all lines match <regex> + --no-ignore-matching-lines # Negate --ignore-matching-lines + --indent-heuristic # Heuristic to shift diff hunk boundaries for easy reading + --no-indent-heuristic # Negate --indent-heuristic + --patience # Generate diff using the "patience diff" algorithm + --histogram # Generate diff using the "histogram diff" algorithm + --diff-algorithm: words [default myers minimal patience histogram] # Choose a diff algorithm + --anchored: text # Generate diff using the "anchored diff" algorithm + --word-diff?: words [color plain porcelain none] # Show word diff, using <mode> to delimit changed words + --word-diff-regex: text # Use <regex> to decide what a word is + --color-words?: text # Equivalent to --word-diff=color --word-diff-regex=<regex> + --color-moved?: words [no default plain blocks zebra dimmed-zebra] # Moved lines of code are colored differently + --no-color-moved # Negate --color-moved + --color-moved-ws: words [no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change] # How white spaces are ignored in --color-moved + --no-color-moved-ws # Negate --color-moved-ws + --relative?: text # When run from subdir, exclude changes outside and show relative paths + --no-relative # Negate --relative + --text(-a) # Treat all files as text + --no-text # Negate --text + -R # Swap two inputs, reverse the diff + --exit-code # Exit with 1 if there were differences, 0 otherwise + --no-exit-code # Negate --exit-code + --quiet # Disable all output of the program + --no-quiet # Negate --quiet + --ext-diff # Allow an external diff helper to be executed + --no-ext-diff # Negate --ext-diff + --textconv # Run external text conversion filters when comparing binary files + --no-textconv # Negate --textconv + --ignore-submodules?: words [none untracked dirty all] # Ignore changes to submodules in the diff generation + --submodule?: words [short log diff] # Specify how differences in submodules are shown + --ita-invisible-in-index # Hide 'git add -N' entries from the index + --ita-visible-in-index # Treat 'git add -N' entries as real in the index + -S: text # Look for differences that change the number of occurrences of the specified string + -G: text # Look for differences that change the number of occurrences of the specified regex + --pickaxe-all # Show all changes in the changeset with -S or -G + --pickaxe-regex # Treat <string> in -S as extended POSIX regular expression + -O: path # Control the order in which files appear in the output + --rotate-to: path # Show the change in the specified path first + --skip-to: path # Skip the output to the specified path + --find-object: by "nu-complete git refs" # Look for differences that change the number of occurrences of the specified object + --diff-filter: text # Select files by diff type + --max-depth: text # Maximum tree depth to recurse + --output: path # Output to a specific file + --max-count(-n): text # Limit the number of commits to output + --skip: text # Skip number commits before starting to show the output + --since: text # Show commits more recent than a specific date + --after: text # Show commits more recent than a specific date + --since-as-filter: text # Show all commits more recent than a specific date + --until: text # Show commits older than a specific date + --before: text # Show commits older than a specific date + --max-age: text # Limit output to commits newer than a timestamp + --min-age: text # Limit output to commits older than a timestamp + --author: by "nu-complete git authors" # Limit to commits whose author matches the pattern + --committer: by "nu-complete git authors" # Limit to commits whose committer matches the pattern + --grep-reflog: text # Limit to commits whose reflog message matches the pattern + --grep: text # Limit to commits whose log message matches the pattern + --all-match # Limit to commits that match all given --grep patterns + --invert-grep # Limit to commits whose log message does not match --grep + --regexp-ignore-case(-i) # Match the limiting patterns without regard to case + --basic-regexp # Treat the limiting patterns as basic regular expressions + --extended-regexp(-E) # Treat the limiting patterns as extended regular expressions + --fixed-strings(-F) # Treat the limiting patterns as fixed strings + --perl-regexp(-P) # Treat the limiting patterns as Perl-compatible regular expressions + --remove-empty # Stop when a given path disappears from the tree + --merges # Print only merge commits + --no-merges # Do not print commits with more than one parent + --min-parents: text # Show only commits with at least that many parents + --max-parents: text # Show only commits with at most that many parents + --no-min-parents # Reset the --min-parents limit + --no-max-parents # Reset the --max-parents limit + --first-parent # Follow only the first parent commit upon seeing a merge commit + --exclude-first-parent-only # Follow only the first parent when excluding commits + --not # Reverse the meaning of the ^ prefix for following revisions + --all # Pretend all refs in refs/ and HEAD are listed on the command line + --branches?: text # Pretend all refs in refs/heads are listed + --tags?: text # Pretend all refs in refs/tags are listed + --remotes?: text # Pretend all refs in refs/remotes are listed + --glob: text # Pretend all refs matching the shell glob are listed + --exclude: text # Do not include refs matching the glob in the next --all/--branches/--tags/--remotes/--glob + --exclude-hidden: words [fetch receive uploadpack] # Do not include refs hidden by the given transfer section + --reflog # Pretend all objects mentioned by reflogs are listed + --alternate-refs # Pretend the tips of alternate repositories are listed + --single-worktree # Examine only the current worktree's HEAD, index and reflogs + --ignore-missing # Ignore invalid object names in the input + --bisect # Pretend the bad bisection ref and good refs are listed + --stdin # Read commits and pathspecs from standard input + --cherry-mark # Like --cherry-pick but mark equivalent commits with = instead of omitting them + --cherry-pick # Omit commits that introduce the same change as a commit on the other side + --left-only # List only commits on the left side of a symmetric difference + --right-only # List only commits on the right side of a symmetric difference + --cherry # Synonym for --right-only --cherry-mark --no-merges + --walk-reflogs(-g) # Walk reflog entries instead of the commit ancestry chain + --merge # Show commits touching conflicted paths in the range HEAD...<other> + --boundary # Output excluded boundary commits + --simplify-by-decoration # Show only commits referred to by some branch or tag + --show-pulls # Include merges that are not TREESAME to the first parent + --full-history # Do not prune history when simplifying by path + --dense # Show only commits that touch the given paths (default) + --sparse # Show all walked commits + --simplify-merges # Remove needless merges from the --full-history result + --ancestry-path?: by "nu-complete git commits" # Show only commits that are ancestors or descendants of the given commit + --date-order # Show no parents before all children, in commit timestamp order + --author-date-order # Show no parents before all children, in author timestamp order + --topo-order # Show no parents before all children, avoiding interleaved histories + --reverse # Output the selected commits in reverse order + --no-walk?: words [sorted unsorted] # Only show the given commits, do not traverse their ancestors + --do-walk # Override a previous --no-walk + --pretty?: words [oneline short medium full fuller reference email raw mboxrd "format:" "tformat:"] # Pretty-print the commit logs in the given format + --format: text # Pretty-print the commit logs in the given format + --abbrev-commit # Show a prefix of the commit object name + --no-abbrev-commit # Show the full commit object name + --oneline # Shorthand for --pretty=oneline --abbrev-commit + --encoding: text # Re-code the commit log message in this encoding + --expand-tabs?: text # Expand tabs in the log message + --no-expand-tabs # Do not expand tabs in the log message + --notes?: by "nu-complete git notes-refs" # Show the notes that annotate the commit + --no-notes # Do not show notes + --show-notes-by-default # Show the default notes unless options for displaying specific notes are given + --show-signature # Check the validity of a signed commit object + --relative-date # Synonym for --date=relative + --date: words [relative local iso iso8601 iso-strict iso8601-strict rfc rfc2822 short raw human unix default "format:" "format-local:"] # Format for dates shown in human-readable form + --parents # Also print the parents of the commit + --children # Also print the children of the commit + --left-right # Mark which side of a symmetric difference a commit is reachable from + --graph # Draw a text-based graphical representation of the commit history + --show-linear-break?: text # Put a barrier between two consecutive commits that are not linear + -c # Show combined diff format for merge commits + --cc # Show dense combined diff format for merge commits + --dd # Show diff relative to the first parent for merges and regular commits + -m # Show diffs for merge commits in the default format + --diff-merges: words [off none on first-parent 1 separate m combined c dense-combined cc remerge r] # Specify the diff format to be used for merge commits + --no-diff-merges # Disable output of diffs for merge commits + --combined-all-paths # Show the name of the file from all parents in combined diffs + -t # Show the tree objects in the diff output + --log-size # Include a line with the log message length in bytes + --count # Print a number stating how many commits would have been listed +] + +# Show the bisect log +export complete [git bisect log] [ + ...args: text +] + +# Bisect automatically using a script +export complete [git bisect run] [ + cmd: path + ...args: path + --reset-when-found?: text # Reset the bisection when the first bad commit is found +] + +# Show a short usage summary +export complete [git bisect help] [ + ...args: text +] + +# Add the given repository as a submodule +export complete [git submodule add] [ + repository: text + path?: path + --branch(-b): text # Branch of repository to add as submodule + --force(-f) # Allow adding an otherwise ignored submodule path + --name: text # Name of the new submodule + --reference: path # Reference repository + --depth: text # Create a shallow clone truncated to that many revisions + --quiet(-q) # Only print error messages +] + +# Show the status of the submodules +export complete [git submodule status] [ + ...path: by "nu-complete git submodules" + --cached # Use the commit stored in the index + --recursive # Recurse into nested submodules + --quiet(-q) # Only print error messages +] + +# Initialize the submodules recorded in the index +export complete [git submodule init] [ + ...path: by "nu-complete git submodules" + --quiet(-q) # Only print error messages +] + +# Unregister the given submodules +export complete [git submodule deinit] [ + ...path: by "nu-complete git submodules" + --force(-f) # Unregister the submodule even if its working tree has local modifications + --all # Unregister all submodules + --quiet(-q) # Only print error messages +] + +# Update the registered submodules to match the superproject +export complete [git submodule update] [ + ...path: by "nu-complete git submodules" + --init # Initialize all submodules for which git submodule init has not been called + --filter: words ["blob:none" "blob:limit=" "tree:0" "tree:1" "sparse:oid=" "object:type=blob" "object:type=tree" "combine:"] # Use a partial clone filter when cloning + --remote # Use the status of the submodule's remote-tracking branch + --no-fetch(-N) # Do not fetch new objects from the remote site + --force(-f) # Throw away local changes in submodules when switching commits + --checkout # Check out the superproject's recorded commit in a detached HEAD + --merge # Merge the superproject's recorded commit into the submodule branch + --rebase # Rebase the submodule branch onto the superproject's recorded commit + --recommend-shallow # Use the shallow recommendation in .gitmodules + --no-recommend-shallow # Ignore the shallow recommendation in .gitmodules + --reference: path # Reference repository + --dissociate # Borrow objects from the reference repository only during the clone + --recursive # Recurse into nested submodules + --depth: text # Create a shallow clone truncated to that many revisions + --jobs(-j): text # Number of submodules fetched at the same time + --single-branch # Clone only one branch + --no-single-branch # Clone all branches + --progress # Force progress reporting + --quiet(-q) # Only print error messages +] + +# Set the default remote tracking branch for the submodule +export complete [git submodule set-branch] [ + path: by "nu-complete git submodules" + --default(-d) # Remove the branch configuration and use the remote HEAD + --branch(-b): text # Branch to track + --quiet(-q) # Only print error messages +] + +# Set the URL of the specified submodule +export complete [git submodule set-url] [ + path: by "nu-complete git submodules" + newurl: text + --quiet(-q) # Only print error messages +] + +# Show a commit summary between the given commit and the working tree/index +export complete [git submodule summary] [ + commit?: by "nu-complete git refs" + ...path: by "nu-complete git submodules" + --cached # Use the commit stored in the index + --files # Compare the commit in the index with the submodule HEAD + --summary-limit(-n): text # Limit the summary size + --quiet(-q) # Only print error messages +] + +# Evaluate an arbitrary shell command in each checked out submodule +export complete [git submodule foreach] [ + command: text + ...args: text + --recursive # Recurse into nested submodules + --quiet(-q) # Only print error messages +] + +# Synchronize submodules' remote URL configuration +export complete [git submodule sync] [ + ...path: by "nu-complete git submodules" + --recursive # Recurse into nested submodules + --quiet(-q) # Only print error messages +] + +# Move the git directory of submodules into the superproject +export complete [git submodule absorbgitdirs] [ + ...path: by "nu-complete git submodules" + --quiet(-q) # Only print error messages +] + +# Create the <prefix> subtree by importing its contents +export complete [git subtree add] [ + repository_or_commit: by "nu-complete git remotes" + ref?: text +] + +# Merge recent changes up to <commit> into the <prefix> subtree +export complete [git subtree merge] [ + commit: by "nu-complete git refs" +] + +# Extract a new, synthetic project history from the <prefix> subtree +export complete [git subtree split] [ + commit?: by "nu-complete git refs" +] + +# Fetch from <repository> and merge <ref> into the <prefix> subtree +export complete [git subtree pull] [ + repository: by "nu-complete git remotes" + ref: text +] + +# Split the <prefix> subtree and push it to <repository> +export complete [git subtree push] [ + repository: by "nu-complete git remotes" + refspec: text +] + +# Reset the metadata used by rerere +export complete [git rerere clear] [ + ...args: text +] + +# Reset the conflict resolutions which rerere has recorded +export complete [git rerere forget] [ + ...pathspec: path +] + +# Display diffs for the current state of the resolution +export complete [git rerere diff] [ + ...args: text +] + +# Print paths with conflicts whose resolution rerere will record +export complete [git rerere status] [ + ...args: text +] + +# Print paths with conflicts that have not been autoresolved by rerere +export complete [git rerere remaining] [ + ...args: text +] + +# Prune records of conflicted merges that occurred a long time ago +export complete [git rerere gc] [ + ...args: text +] + +# Fill in missing credential fields +export complete [git credential fill] [ + ...args: text +] + +# Store a credential as good +export complete [git credential approve] [ + ...args: text +] + +# Erase a credential +export complete [git credential reject] [ + ...args: text +] + +# Announce the capabilities of git credential +export complete [git credential capability] [ + ...args: text +] + +export complete [git mergetool] [ + ...file: by "nu-complete git conflicted-files" + --tool(-t): words [araxis bc bc3 bc4 codecompare deltawalker diffmerge diffuse ecmerge emerge examdiff guiffy gvimdiff kdiff3 kompare meld nvimdiff opendiff p4merge smerge tkdiff tortoisemerge vimdiff vscode winmerge xxdiff] # Use the merge resolution program specified by <tool> + --tool-help # Print a list of merge tools that may be used with --tool + --no-prompt(-y) # Do not prompt before launching a merge resolution program + --prompt # Prompt before each invocation of the merge resolution program + --gui(-g) # Use the configured merge.guitool + --no-gui # Use the configured merge.tool + -O: path # Process files in the order specified in <orderfile> +] + +export complete [git submodule] [ + ...args: text + --quiet(-q) # Only print error messages + --cached # Use the commit stored in the index instead of the submodule HEAD +] + +export complete [git request-pull] [ + start: by "nu-complete git refs" + url: text + end?: by "nu-complete git refs" + -p # Show patch text as well +] + +export complete [git jump] [ + mode?: words [diff merge grep ws] + ...args: path + --stdout # Print the quickfix list to stdout instead of opening an editor +] + +export complete [git filter-branch] [ + ...rev: by "nu-complete git refs" + --setup: text # Setup command run once before the loop + --subdirectory-filter: path # Only look at the history which touches the given subdirectory + --env-filter: text # Filter for modifying the commit environment + --tree-filter: text # Filter for rewriting the tree and its contents + --index-filter: text # Filter for rewriting the index + --parent-filter: text # Filter for rewriting the commit's parent list + --msg-filter: text # Filter for rewriting the commit messages + --commit-filter: text # Filter for performing the commit + --tag-name-filter: text # Filter for rewriting tag names + --original: text # Namespace where the original commits will be stored + -d: path # Use this temporary directory for rewriting + --force(-f) # Start even if there is an existing temporary directory or backup + --state-branch: text # Load and store the mapping from old to new objects in this branch + --prune-empty # Remove commits that become empty +] + +export complete [git rerere] [ + ...args: path + --rerere-autoupdate # Register clean resolutions in index +] + +export complete [git instaweb] [ + ...args: path + --local(-l) # Only bind on 127.0.0.1 + --no-local # Negate --local + --port(-p): text # The port to bind to + --no-port # Negate --port + --httpd(-d): text # The command to launch + --no-httpd # Negate --httpd + --browser(-b): text # The browser to launch + --no-browser # Negate --browser + --module-path(-m): text # The module path (only needed for apache2) + --no-module-path # Negate --module-path + --stop # Stop the web server + --no-stop # Negate --stop + --start # Start the web server + --no-start # Negate --start + --restart # Restart the web server + --no-restart # Negate --restart +] + +export complete [git subtree] [ + ...args: path + --quiet(-q) # Quiet + --debug(-d) # Show debug messages + --prefix(-P): text # The name of the subdir to split out + --no-prefix # Negate --prefix + --annotate: text # Add a prefix to commit message of new commits + --no-annotate # Negate --annotate + --branch(-b): text # Create a new branch from the split subtree + --ignore-joins # Ignore prior --rejoin commits + --no-ignore-joins # Negate --ignore-joins + --onto: by "nu-complete git refs" # Try connecting new tree to an existing one + --no-onto # Negate --onto + --rejoin # Merge the new branch back into HEAD + --no-rejoin # Negate --rejoin + --squash # Merge subtree changes as a single commit + --no-squash # Negate --squash + --message(-m): text # Use the given message as the commit message for the merge commit + --gpg-sign(-S)?: text # GPG-sign commits. The keyid argument is optional and defaults to the committer identity + --no-gpg-sign # Negate --gpg-sign +] + +export complete [git send-email] [ + ...file: path + --from: text # Email From: + --to: text # Email To: + --no-to # Negate --to + --cc: text # Email Cc: + --no-cc # Negate --cc + --bcc: text # Email Bcc: + --no-bcc # Negate --bcc + --subject: text # Email "Subject:" + --reply-to: text # Email "Reply-To:" + --in-reply-to: text # Email "In-Reply-To:" + --outlook-id-fix # The SMTP host is an Outlook server that munges the Message-ID; retrieve it from the server + --no-outlook-id-fix # Negate --outlook-id-fix + --xmailer # Add "X-Mailer:" header (default). + --no-xmailer # Negate --xmailer + --annotate # Review each patch that will be sent in an editor. + --no-annotate # Negate --annotate + --compose # Open an editor for introduction. + --compose-encoding: text # Encoding to assume for introduction. + --8bit-encoding: text # Encoding to assume 8bit mails if undeclared + --transfer-encoding: words [7bit 8bit quoted-printable base64 auto] # Transfer encoding to use (quoted-printable, 8bit, base64) + --mailmap # Use mailmap file to map all email addresses to canonical real names and email addresses + --no-mailmap # Negate --mailmap + --envelope-sender: text # Email envelope sender. + --sendmail-cmd: text # Command to run to send email. + --smtp-server: text # Outgoing SMTP server to use; the port is optional (default 'localhost') + --smtp-server-option: text # Outgoing SMTP server option to use. + --smtp-server-port: text # Outgoing SMTP server port. + --smtp-user: text # Username for SMTP-AUTH. + --smtp-pass: text # Password for SMTP-AUTH; not necessary. + --smtp-encryption: text # Tls or ssl; anything else disables. + --smtp-ssl # Deprecated. Use `--smtp-encryption ssl`. + --smtp-ssl-cert-path: text # Path to ca-certificates (either directory or file). + --smtp-ssl-client-cert: text # Path to the client certificate file + --smtp-ssl-client-key: text # Path to the private key file for the client certificate + --smtp-domain: text # The domain name sent to HELO/EHLO handshake + --smtp-auth: text # Space-separated list of allowed AUTH mechanisms, or "none" to disable authentication + --no-smtp-auth # Disable SMTP authentication; shorthand for `--smtp-auth=none` + --smtp-debug: text # Disable, enable Net::SMTP debug. + --imap-sent-folder: text # IMAP folder where a copy of the emails should be sent. + --use-imap-only # Only copy emails to the IMAP folder given by --imap-sent-folder instead of sending them + --no-use-imap-only # Negate --use-imap-only + --batch-size: text # Send max <int> message per connection. + --relogin-delay: text # Delay <int> seconds between two successive login. + --identity: text # Use the sendemail.<id> options. + --to-cmd: text # Email To: via `<str> $patch_path`. + --cc-cmd: text # Email Cc: via `<str> $patch_path`. + --header-cmd: text # Add headers via `<str> $patch_path`. + --no-header-cmd # Disable any header command in use. + --suppress-cc: words [author self cc bodycc sob cccmd body all] # Author, self, sob, cc, cccmd, body, bodycc, misc-by, all. + --cc-cover # Email Cc: addresses in the cover letter. + --no-cc-cover # Negate --cc-cover + --to-cover # Email To: addresses in the cover letter. + --no-to-cover # Negate --to-cover + --signed-off-by-cc # Send to Signed-off-by: addresses. Default on. + --no-signed-off-by-cc # Negate --signed-off-by-cc + --suppress-from # Send to self. Default off. + --no-suppress-from # Negate --suppress-from + --chain-reply-to # Chain In-Reply-To: fields. Default off. + --no-chain-reply-to # Negate --chain-reply-to + --thread # Use In-Reply-To: field. Default on. + --no-thread # Negate --thread + --confirm: words [always never auto cc compose] # Confirm recipients before sending: auto, cc, compose, always or never + --quiet # Output one line of info per email. + --dry-run # Don't actually send the emails. + --validate # Perform patch sanity checks. Default on. + --no-validate # Negate --validate + --format-patch # Understand any non-optional arguments as `git format-patch` ones + --no-format-patch # Negate --format-patch + --force # Send even if safety checks would prevent it. + --dump-aliases # Dump configured aliases and exit. + --translate-aliases # Translate aliases read from standard input using the configured alias files +] + +export complete [git credential] [ + ...args: text +] + +export complete [git daemon] [ + ...directory: path ] diff --git a/custom-completions/git/tests/git-completions.nu b/custom-completions/git/tests/git-completions.nu index 29004db44..c624d30c5 100644 --- a/custom-completions/git/tests/git-completions.nu +++ b/custom-completions/git/tests/git-completions.nu @@ -2,7 +2,8 @@ # Set GIT_EXPECT_CUSTOM_COMPLETIONS=false only on older Nu versions whose engine # falls back to built-in paths; direct provider assertions still run there. use std/assert -source ../git-completions.nu +use ../git-completions.nu * +use ../git-completions.nu git-completion-utils use git-completion-utils * def with-repo [test: closure] { @@ -197,10 +198,20 @@ def offered [line: string]: nothing -> list<string> { $line | commandline complete --detailed | each {|row| $row.display_override? | default $row.value } } +# The word `line` ends with once a completion is accepted. The engine replaces only the part of +# a word it completes (the value after `--opt=`, one item of a comma list), so compare whole words. +def completed [line: string]: nothing -> list<string> { + $line | commandline complete --detailed | each {|row| + let before = $line | str substring ..<($row.span.start) + let start = $before | str index-of --end ' ' + ($before | str substring ($start + 1)..) + $row.value + } +} + def "undeclared flags are offered by the positional completers" [] { with-repo {|| # Optional-value and attached-value options are not declared on the externs. - assert ('--color=always' in (offered 'git log --color=')) + assert ('--color=always' in (completed 'git log --color=')) assert ('--pretty=oneline' in (offered 'git log --pre')) assert ('-Xtheirs' in (offered 'git merge -X')) assert ('-uno' in (offered 'git status -u')) @@ -279,7 +290,7 @@ def "completers are silent outside a repository" [] { 'nu-complete git mergable sources' 'nu-complete git reflog entries' 'nu-complete git config sections' ] let script = $completers | each {|c| $"($c) | ignore" } | str join "\n" - let result = do { cd $dir; ^$nu.current-exe --no-config-file -c $"source '($file)'\n($script)" } | complete + let result = do { cd $dir; ^$nu.current-exe --no-config-file -c $"use '($file)' *\nuse '($file)' git-completion-utils\nuse git-completion-utils *\n($script)" } | complete rm -r $dir assert equal $result.exit_code 0 assert equal $result.stderr '' @@ -312,7 +323,7 @@ def "command lines reach git unchanged" [] { let run = {|source, line| with-env {PATH: ($env.PATH | prepend $bin)} { ^$nu.current-exe --no-config-file -c $"($source)($line)" | complete } } for line in $lines { let raw = do $run '' $line - let ext = do $run $"source '($file)'\n" $line + let ext = do $run $"use '($file)' *\n" $line assert equal $ext.exit_code 0 $line assert equal $ext.stdout $raw.stdout $line } @@ -391,7 +402,7 @@ def "real git accepts what the externs pass" [] { ] for line in $lines { let raw = ^$nu.current-exe --no-config-file -c $line | complete - let ext = ^$nu.current-exe --no-config-file -c $"source '($file)'\n($line)" | complete + let ext = ^$nu.current-exe --no-config-file -c $"use '($file)' *\n($line)" | complete assert equal $ext.exit_code $raw.exit_code $line assert equal $ext.stdout $raw.stdout $line } @@ -404,7 +415,7 @@ def "values follow the command, aliases and option values" [] { ^git tag v1.0 # A per-command null means no values: commit --date takes a date, not a format. assert equal (offered 'git commit --date=') [] - assert ('--date=iso' in (offered 'git log --date=')) + assert ('--date=iso' in (completed 'git log --date=')) assert equal (offered 'git remote add --track ') [] # Shell parameters in a `!` alias are not arguments. ^git config alias.co2 '!git checkout "$@"' diff --git a/custom-completions/glow/glow-completions.nu b/custom-completions/glow/glow-completions.nu index b7352b0af..3d649d2b7 100644 --- a/custom-completions/glow/glow-completions.nu +++ b/custom-completions/glow/glow-completions.nu @@ -1,38 +1,48 @@ +# Declarative completions for glow, the terminal markdown renderer. # authour: DWTW -def commandsGlow [] { - [ "config", "help", "stash" ] +# Render markdown on the CLI, with pizzazz! +export complete [glow] [ + --all(-a) # Show system files and directories (TUI) + --config: path # Specify config file + --help(-h) # Help for glow + --local(-l) # Show local files only + --line-numbers(-n) # Show line numbers (TUI) + --pager(-p) # Display with pager + --preserve-new-lines # Preserve newlines in the output + --style(-s): words [auto dark light notty pink dracula tokyo-night ascii] # Style name or JSON path + --tui(-t) # Display with the TUI + --width(-w): text # Word-wrap width + --version(-v) # Version for glow + source?: path # Markdown file, directory, URL or `-` for stdin +] where { + excludes --pager --tui + terminal [--help --version] } -# Render markdown on the CLI, with pizzazz! -export extern "glow" [ - string? - --all(-a) # Show system files and directories (TUI) - --config: string # Specify config file - --help(-h) # Help for glow - --local(-l) # Show local files only - --pager(-p) # Display with pager - --style(-s): string # Style name or JSON path - --width(-w): int # Word-wrap width -] +# Edit the glow config file +export complete [glow config] [ + --config: path # Specify config file + --help(-h) # Help for config +] where { terminal [--help] } -# Create a config file -export extern "glow config" [ - --help(-h) # Help for config - --config: string # Specify config file -] +# Help about any command +export complete [glow help] [ + --config: path # Specify config file + --help(-h) # Help for help + command?: words [completion config help stash] # Command to show help for +] where { terminal [--help] } -# Provides help for any command -export extern "glow help" [ - string?: string@commandsGlow - --help(-h) # Help for config - --config: string # Specify config file -] +# Generate the autocompletion script for a shell +export complete [glow completion] [ + --help(-h) # Help for completion + shell?: words [bash fish powershell zsh] # Target shell +] where { terminal [--help] } -# Do stash stuff -export extern "glow stash" [ - string? - --memo: string # Memo or note for stashing - --help(-h) # Help for config - --config: string # Specify config file -] +# Stash a markdown document +export complete [glow stash] [ + --config: path # Specify config file + --help(-h) # Help for stash + --memo: text # Memo or note for stashing + file?: path # Markdown file to stash +] where { terminal [--help] } diff --git a/custom-completions/godoc/godoc-completions.nu b/custom-completions/godoc/godoc-completions.nu index 1e328ea52..baa66ae08 100644 --- a/custom-completions/godoc/godoc-completions.nu +++ b/custom-completions/godoc/godoc-completions.nu @@ -1,15 +1,38 @@ -# Show examples in command line mode -extern "godoc" [ - --ex # Show examples in command line mode - --html # Print HTML in command-line mode - # --httptest.serve # (this command breaks nu parser) httptest.NewServer serves on this address and blocks - --index # Enable search index - --index_files # Glob pattern specifying index files - --links # Link identifiers to their declarations - --play # Enable playground in web interface - --server # Webserver address for command line searches - --src # Print (exported) source in command-line mode - --timestamps # Show timestamps with directory listings - --help(-h) # Show help - ...args -] \ No newline at end of file +# Declarative completions for godoc, the Go documentation tool. +# +# godoc uses Go's flag package, which accepts both `-flag` and `--flag`, and `-flag=value`. + +# Packages in the standard library and the module cache, as import paths. +@non-destructive +export def "nu-complete godoc packages" []: nothing -> list<string> { + try { + ^go list std | lines + } catch { + [] + } +} + +export complete [godoc] [ + --ex # Show examples in command-line mode + --html # Print HTML in command-line mode + --index # Enable the search index + --index_files: text # Glob pattern of index files + --index_interval: text # Interval of indexing (e.g. 5m) + --index_throttle: text # Index throttle value between 0.0 and 1.0 + --links # Link identifiers to their declarations + --play # Enable the playground in the web interface + --http: text # HTTP service address, e.g. :6060 + --server: text # Web server address for command-line searches + --src # Print (exported) source in command-line mode + --goroot: dir # Go root directory + --templates: dir # Directory containing alternate template files + --timestamps # Show timestamps with directory listings + --url: text # Print the HTML for this URL + --v # Verbose mode + --write_index # Write the index to a file + --zip: path # Zip file providing the file system to serve + --help(-h) # Show help + ...packages: by "nu-complete godoc packages" # Packages (and symbols) to document +] where { + terminal [--help] +} diff --git a/custom-completions/gradlew/gradlew-completions.nu b/custom-completions/gradlew/gradlew-completions.nu index cec5e4504..3c69b875c 100644 --- a/custom-completions/gradlew/gradlew-completions.nu +++ b/custom-completions/gradlew/gradlew-completions.nu @@ -1,92 +1,125 @@ -def "nu-complete gradlew" [] { - ./gradlew tasks - | lines - | parse --regex '(?P<value>[a-zA-Z]+) - (?P<description>.+)' -} - -def "nu-complete gradlew console" [] { - [ - "plain" - "auto" - "rich" - "verbose" - ] -} +# Declarative completions for the Gradle wrapper (`./gradlew`) and `gradle`. -def "nu-complete gradlew deps-verify" [] { - [ - "strict" - "lenient" - "off" - ] +# Lifecycle tasks, plus `:project:task` variants for every project included in settings.gradle(.kts). +# (`./gradlew tasks` is far too slow to run on every keystroke.) +@non-destructive +export def "nu-complete gradlew tasks" [] { + try { + let base = [ + {value: build, description: "Assemble and test this project"} + {value: assemble, description: "Assemble the outputs of this project"} + {value: check, description: "Run all checks"} + {value: test, description: "Run the unit tests"} + {value: clean, description: "Delete the build directory"} + {value: jar, description: "Assemble a jar archive"} + {value: javadoc, description: "Generate Javadoc API documentation"} + {value: run, description: "Run this project as a JVM application"} + {value: bootRun, description: "Run this project as a Spring Boot application"} + {value: installDebug, description: "Install the Debug build (Android)"} + {value: assembleDebug, description: "Assemble the Debug build (Android)"} + {value: assembleRelease, description: "Assemble the Release build (Android)"} + {value: lint, description: "Run lint (Android)"} + {value: dependencies, description: "Display the declared dependencies"} + {value: dependencyInsight, description: "Explain why a dependency is selected"} + {value: projects, description: "Display the sub-projects"} + {value: properties, description: "Display the properties"} + {value: tasks, description: "Display the runnable tasks"} + {value: help, description: "Display a help message"} + {value: init, description: "Initialize a new Gradle build"} + {value: wrapper, description: "Generate Gradle wrapper files"} + {value: buildEnvironment, description: "Display the buildscript dependencies"} + {value: publish, description: "Publish all publications"} + {value: publishToMavenLocal, description: "Publish to the local Maven repository"} + ] + let settings = ["settings.gradle.kts" "settings.gradle"] | where {|f| $f | path exists } + let projects = if ($settings | is-empty) { [] } else { + open --raw ($settings | first) + | parse --regex `["'](?<p>:[\w:.-]+)["']` + | get p | uniq + } + $base | append ($projects | each {|p| [build test clean assemble] | each {|t| {value: $"($p):($t)", description: $"($t) in ($p)"} } } | flatten) + } catch { [] } } -def "nu-complete gradlew warning-mode" [] { - [ - "all" - "fail" - "summary" - "none" - ] +@non-destructive +export def "nu-complete gradlew projects" [] { + try { + let settings = ["settings.gradle.kts" "settings.gradle"] | where {|f| $f | path exists } + open --raw ($settings | first) | parse --regex `["'](?<p>:[\w:.-]+)["']` | get p | uniq + } catch { [] } } # Tool used to automate compilation process using gradle -export extern "./gradlew" [ - task?: string@"nu-complete gradlew" - --help(-h) # Shows this help message. - --no-rebuild(-a) # Do not rebuild project dependencies. - --build-file(-b) # Specify the build file. [deprecated] - --build-cache # Enables the Gradle build cache. Gradle will try to reuse outputs from previous builds. - --no-build-cache # Disables the Gradle build cache. - --settings-file(-c) # Specify the settings file. [deprecated] - --configuration-cache # Enables the configuration cache. Gradle will try to reuse the build configuration from previous builds. - --no-configuration-cache # Disables the configuration cache. - --configuration-cache-problems # Configures how the configuration cache handles problems (fail or warn). Defaults to fail. - --configure-on-demand # Configure necessary projects only. Gradle will attempt to reduce configuration time for large multi-project builds. [incubating] - --no-configure-on-demand # Disables the use of configuration on demand. [incubating] - --console: string@"nu-complete gradlew console" # Specifies which type of console output to generate. Values are 'plain', 'auto' (default), 'rich' or 'verbose'. - --continue # Continue task execution after a task failure. - --no-continue # Stop task execution after a task failure. - --system-prop(-D) # Set system property of the JVM (e.g. -Dmyprop=myvalue). - --debug(-d) # Log in debug mode (includes normal stacktrace). - --daemon # Uses the Gradle daemon to run the build. Starts the daemon if not running. - --no-daemon # Do not use the Gradle daemon to run the build. Useful occasionally if you have configured Gradle to always run with the daemon by default. - --export-keys # Exports the public keys used for dependency verification. - --dependency-verification(-F): string@"nu-complete gradlew deps-verify" # Configures the dependency verification mode. Values are 'strict', 'lenient' or 'off'. - --foreground # Starts the Gradle daemon in the foreground. - --gradle-user-home(-g) # Specifies the Gradle user home directory. Defaults to ~/.gradle - --init-script(-I) # Specify an initialization script. - --info(-i) # Set log level to info. - --include-build # Include the specified build in the composite. - --write-verification-metadata(-M) # Generates checksums for dependencies used in the project (comma-separated list) - --dry-run(-m) # Run the builds with all task actions disabled. - --max-workers # Configure the number of concurrent workers Gradle is allowed to use. - --offline # Execute the build without accessing network resources. - --project-prop(-P) # Set project property for the build script (e.g. -Pmyprop=myvalue). - --project-dir(-p) # Specifies the start directory for Gradle. Defaults to current directory. - --parallel # Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use. - --no-parallel # Disables parallel execution to build projects. - --priority # Specifies the scheduling priority for the Gradle daemon and all processes launched by it. Values are 'normal' (default) or 'low' - --profile # Profile build execution time and generates a report in the <build_dir>/reports/profile directory. - --project-cache-dir # Specify the project-specific cache directory. Defaults to .gradle in the root project directory. - --quiet(-q) # Log errors only. - --refresh-keys # Refresh the public keys used for dependency verification. - --rerun-tasks # Ignore previously cached task results. - --full-stacktrace(-S) # Print out the full (very verbose) stacktrace for all exceptions. - --stacktrace(-s) # Print out the stacktrace for all exceptions. - --scan # Creates a build scan. Gradle will emit a warning if the build scan plugin has not been applied. (https://gradle.com/build-scans) - --no-scan # Disables the creation of a build scan. For more information about build scans, please visit https://gradle.com/build-scans. - --status # Shows status of running and recently stopped Gradle daemon(s). - --stop # Stops the Gradle daemon if it is running. - --continuous(-t) # Enables continuous build. Gradle does not exit and will re-execute tasks when task file inputs change. - --refresh-dependencies(-U) # Refresh the state of dependencies. - --update-locks # Perform a partial update of the dependency lock, letting passed in module notations change version. [incubating] - --show-version(-V) # Print version info and continue. - --version(-v) # Print version info and exit. - --warn(-w) # Set log level to warn. - --warning-mode: string@"nu-complete gradlew warning-mode" # Specifies which mode of warnings to generate. Values are 'all', 'fail', 'summary'(default) or 'none' - --watch-fs # Enables watching the file system for changes, allowing data about the file system to be re-used for the next build. - --no-watch-fs # Disables watching the file system. - --write-locks # Persists dependency resolution for locked configurations, ignoring existing locking information if it exists - --exclude-task(-x) # Specify a task to be excluded from execution. -] \ No newline at end of file +export complete [./gradlew] [ + --help(-h) # Show this help message + --no-rebuild(-a) # Do not rebuild project dependencies + --build-file(-b): path # Specify the build file [deprecated] + --build-cache # Enable the Gradle build cache + --no-build-cache # Disable the Gradle build cache + --settings-file(-c): path # Specify the settings file [deprecated] + --configuration-cache # Enable the configuration cache + --no-configuration-cache # Disable the configuration cache + --configuration-cache-problems: words [fail warn] # How the configuration cache handles problems + --configure-on-demand # Configure necessary projects only [incubating] + --no-configure-on-demand # Disable configuration on demand [incubating] + --console: words [plain auto rich verbose] # Type of console output to generate + --continue # Continue task execution after a task failure + --no-continue # Stop task execution after a task failure + --system-prop(-D): text # Set a JVM system property (e.g. -Dmyprop=myvalue) + --debug(-d) # Log in debug mode + --daemon # Use the Gradle daemon to run the build + --no-daemon # Do not use the Gradle daemon + --export-keys # Export the public keys used for dependency verification + --dependency-verification(-F): words [strict lenient off] # Dependency verification mode + --foreground # Start the Gradle daemon in the foreground + --gradle-user-home(-g): dir # Gradle user home directory (default ~/.gradle) + --init-script(-I): path # Specify an initialization script + --info(-i) # Set log level to info + --include-build: dir # Include this build in the composite + --write-verification-metadata(-M): words [sha256 sha512 pgp "sha256,pgp"] # Generate dependency checksums + --dry-run(-m) # Run with all task actions disabled + --max-workers: text # Number of concurrent workers + --offline # Build without accessing network resources + --project-prop(-P): text # Set a project property (e.g. -Pmyprop=myvalue) + --project-dir(-p): dir cwd # Start directory for Gradle + --parallel # Build projects in parallel + --no-parallel # Disable parallel execution + --priority: words [normal low] # Scheduling priority of the daemon + --profile # Profile build execution time + --project-cache-dir: dir # Project-specific cache directory + --quiet(-q) # Log errors only + --refresh-keys # Refresh the public keys used for dependency verification + --rerun-tasks # Ignore previously cached task results + --full-stacktrace(-S) # Print the full stacktrace for all exceptions + --stacktrace(-s) # Print the stacktrace for all exceptions + --scan # Create a build scan + --no-scan # Disable the creation of a build scan + --status # Show the status of running and recently stopped daemons + --stop # Stop the Gradle daemon if it is running + --continuous(-t) # Re-execute tasks when task inputs change + --refresh-dependencies(-U) # Refresh the state of dependencies + --update-locks: text # Partially update the dependency lock [incubating] + --show-version(-V) # Print version info and continue + --version(-v) # Print version info and exit + --warn(-w) # Set log level to warn + --warning-mode: words [all fail summary none] # Which warnings to generate + --watch-fs # Watch the file system for changes + --no-watch-fs # Disable watching the file system + --write-locks # Persist dependency resolution for locked configurations + --exclude-task(-x): by "nu-complete gradlew tasks" # Exclude a task from execution + ...tasks: by "nu-complete gradlew tasks" # Tasks to run +] where { + excludes --build-cache --no-build-cache + excludes --configuration-cache --no-configuration-cache + excludes --configure-on-demand --no-configure-on-demand + excludes --continue --no-continue + excludes --daemon --no-daemon + excludes --parallel --no-parallel + excludes --scan --no-scan + excludes --watch-fs --no-watch-fs + excludes --foreground --no-daemon + at-most-one [--quiet --warn --info --debug] + at-most-one [--stacktrace --full-stacktrace] + excludes --offline --refresh-dependencies + terminal [--help --version --status --stop] +} diff --git a/custom-completions/jj/jj-completions.nu b/custom-completions/jj/jj-completions.nu index edfdc7e80..5da9d7422 100644 --- a/custom-completions/jj/jj-completions.nu +++ b/custom-completions/jj/jj-completions.nu @@ -1,2456 +1,3593 @@ -# Completions based on Jujutsu 0.43.0 - -def operations [] { - { - options: { - sort: false, - }, - completions: (^jj op log --ignore-working-copy --color never --no-graph -T 'id.short() ++ " " ++ description.first_line() ++ "\n"' | parse --regex '(?<value>\w+) (?<description>.*)'), - } +# Declarative completions for Jujutsu (jj 0.46.0). +# +# Every route below is an `export complete` declaration generated from `jj <sub> -h`; the +# `where` rules mirror the option conflicts jj itself enforces. The live providers (all +# `@non-destructive`, all wrapped in `try`/`catch`) pass `--ignore-working-copy`, so completing +# never snapshots the working copy or records an operation. + +# The bookmarks, one row each: `name`, the `remote` it is on (empty for a local bookmark), +# whether it is `tracked` and the `commit` it points at. `--ignore-working-copy` makes this read +# only: it takes no snapshot and records no operation. +@non-destructive +@example "Names of the local bookmarks" { jj-bookmarks | where remote == "" | get name } +@example "Remote bookmarks that are not tracked yet" { jj-bookmarks | where remote != "" and not tracked | get name } +export def jj-bookmarks []: nothing -> table<name: string, remote: string, tracked: bool, commit: string> { + ^jj bookmark list --ignore-working-copy --color never --all-remotes -T 'name ++ "\t" ++ remote ++ "\t" ++ tracked ++ "\t" ++ if(normal_target, normal_target.commit_id().short(), "") ++ "\n"' + | lines + | parse "{name}\t{remote}\t{tracked}\t{commit}" + | where remote != 'git' + | update tracked { $in == 'true' } } -def tracked-files [] { - ^jj file list --ignore-working-copy --color never | lines -} +# --- Providers -------------------------------------------------------------------- -def modified-files [] { - ^jj diff --ignore-working-copy --color never -T 'path.display() ++ "\n"' | lines +# Bookmarks (local and `name@remote`), described by the first line of their target's description. +@non-destructive +export def "nu-complete jj bookmarks" [] { + try { + ^jj bookmark list --ignore-working-copy --color never --all-remotes -T 'if(remote != "git", name ++ if(remote, "@" ++ remote) ++ "\t" ++ if(normal_target, normal_target.description().first_line(), "(conflicted)") ++ "\n")' + | lines + | parse "{value}\t{description}" + } catch { [] } } -def all-bookmarks [] { - ^jj bookmark list --ignore-working-copy --color never --all-remotes -T 'if(remote != "git", name ++ if(remote, "@" ++ remote) ++ "\n")' | lines +# Local bookmarks only: the ones `jj bookmark move/set/delete/rename` act on. +@non-destructive +export def "nu-complete jj local-bookmarks" [] { + try { + ^jj bookmark list --ignore-working-copy --color never -T 'if(!remote, name ++ "\t" ++ if(normal_target, normal_target.description().first_line(), "(conflicted)") ++ "\n")' + | lines + | parse "{value}\t{description}" + } catch { [] } } -def local-bookmarks [] { - ^jj bookmark list --ignore-working-copy --color never -T 'if(!remote, name ++ "\n")' | lines +# Revisions: a few common revset symbols, bookmarks, tags, then the change ids in the default log +# revset, each described by its first description line. The order is kept as listed. +@non-destructive +export def "nu-complete jj revisions" [] { + try { + let symbols = [ + {value: '@', description: 'the working-copy change'} + {value: '@-', description: 'the parent of the working-copy change'} + {value: 'trunk()', description: 'the main bookmark of the default remote'} + {value: 'root()', description: 'the root commit'} + ] + let changes = ^jj log --ignore-working-copy --color never --no-graph --limit 200 -T 'change_id.shortest(8) ++ if(divergent, "/" ++ change_offset) ++ "\t" ++ if(description, description.first_line(), "(no description)") ++ "\n"' + | lines + | parse "{value}\t{description}" + let tags = nu-complete jj tags | each {|tag| {value: $tag, description: 'tag'} } + [...$symbols ...(nu-complete jj bookmarks) ...$tags ...$changes] + } catch { [] } } -def tracked-bookmarks [] { - ^jj bookmark list --ignore-working-copy --color never --all-remotes -T 'if(tracked && remote != "git", name ++ "\n")' | lines | uniq +# Git remotes, described by their URL. +@non-destructive +export def "nu-complete jj remotes" [] { + try { + ^jj git remote list --ignore-working-copy --color never + | lines + | parse --regex '^(?<value>\S+)\s+(?<description>.*)$' + } catch { [] } } -def untracked-bookmarks [] { - ^jj bookmark list --ignore-working-copy --color never --all-remotes -T 'if(!tracked && remote != "git", name ++ "\n")' | lines | uniq +# Operations in the operation log, newest first, described by what they did. +@non-destructive +export def "nu-complete jj operations" [] { + try { + ^jj operation log --ignore-working-copy --color never --no-graph --limit 200 -T 'id.short() ++ "\t" ++ description.first_line() ++ "\n"' + | lines + | parse "{value}\t{description}" + } catch { [] } } -def tags [] { - ^jj tag list --ignore-working-copy --color never -T 'if(!remote, name ++ "\n")' | lines +# Files tracked in the working-copy revision. +@non-destructive +export def "nu-complete jj files" [] { + try { + ^jj file list --ignore-working-copy --color never | lines + } catch { [] } } -def revsets [] { - { - options: { sort: false }, - completions: [ - ...(all-bookmarks | each {|b| { value: $b, style: purple } }), - ...(tags | each {|t| { value: $t, style: default }}), - ...(^jj log --ignore-working-copy --color never --no-graph -r 'all()' -T 'change_id.short() ++ if(divergent, "/" ++ change_offset) ++ " " ++ description.first_line() ++ "\n"' | parse --regex '(?<value>[\w/]+) (?<description>.*)' | each {|o| { ...$o, style: cyan } }), - ] - } +# Files changed in the working-copy revision, described by how (falls back to tracked files). +@non-destructive +export def "nu-complete jj changed-files" [] { + try { + let changed = ^jj diff --ignore-working-copy --color never --summary + | lines + | parse --regex '^(?<code>\S) (?<value>.+)$' + | each {|row| {value: $row.value, description: ({M: 'modified', A: 'added', D: 'deleted', R: 'renamed', C: 'copied'} | get -o $row.code | default $row.code)} } + if ($changed | is-empty) { nu-complete jj files } else { $changed } + } catch { [] } } -def remotes [] { - ^jj git remote list --ignore-working-copy --color never | parse --regex '(?<value>\S+)\s+(?<description>\S+)' +# Local tags. +@non-destructive +export def "nu-complete jj tags" [] { + try { + ^jj tag list --ignore-working-copy --color never -T 'if(!remote, name ++ "\n")' | lines + } catch { [] } } -def workspaces [] { - ^jj --ignore-working-copy --color never workspace list -T 'name ++ "\n"' | lines +# Workspaces. +@non-destructive +export def "nu-complete jj workspaces" [] { + try { + ^jj workspace list --ignore-working-copy --color never -T 'name ++ "\n"' | lines + } catch { [] } } -def modes [] { - [ - { value: 'normal', description: 'make a path non-executable' } - { value: 'executable', description: 'male a path executable' } - ] +# Top-level subcommands, described by their summary in `jj --help`. +@non-destructive +export def "nu-complete jj commands" [] { + try { + ^jj --help --color never + | lines + | skip until {|line| $line == 'Commands:' } + | skip 1 + | take while {|line| $line starts-with ' ' } + | parse --regex '^\s+(?<value>\S+)\s+(?<description>.*)$' + } catch { [] } } -def fetch-tags [] { - [ - { value: 'all', description: 'always fetch all tags' } - { value: 'included', description: 'only fetch tags that point to transmitted objects' } - { value: 'none', description: 'do not fetch tags' } - ] +# --- Routes ----------------------------------------------------------------------- + +# Jujutsu (An experimental VCS) +export complete [jj] [ + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help --version] } -def commands [] { - [ - 'abandon' - 'absorb' - 'arrange' - 'bisect' - 'bisect run' - 'bookmark' - 'bookmark advance' - 'bookmark create' - 'bookmark delete' - 'bookmark forget' - 'bookmark list' - 'bookmark move' - 'bookmark rename' - 'bookmark set' - 'bookmark track' - 'bookmark untrack' - 'commit' - 'config' - 'config edit' - 'config gc' - 'config get' - 'config list' - 'config path' - 'config set' - 'config unset' - 'describe' - 'diff' - 'diffedit' - 'duplicate' - 'edit' - 'evolog' - 'file' - 'file annotate' - 'file chmod' - 'file list' - 'file search' - 'file show' - 'file track' - 'file untrack' - 'fix' - 'gerrit' - 'gerrit upload' - 'git' - 'git clone' - 'git colocation' - 'git colocation disable' - 'git colocation enable' - 'git colocation status' - 'git export' - 'git fetch' - 'git import' - 'git init' - 'git push' - 'git remote' - 'git remote add' - 'git remote list' - 'git remote remove' - 'git remote rename' - 'git remote set-url' - 'git root' - 'help' - 'interdiff' - 'log' - 'metaedit' - 'new' - 'next' - 'operation' - 'operation abandon' - 'operation diff' - 'operation integrate' - 'operation log' - 'operation restore' - 'operation revert' - 'operation show' - 'parallelize' - 'prev' - 'rebase' - 'redo' - 'resolve' - 'restore' - 'revert' - 'root' - 'run' - 'show' - 'sign' - 'simplify-parents' - 'sparse' - 'sparse edit' - 'sparse list' - 'sparse reset' - 'sparse set' - 'split' - 'squash' - 'status' - 'tag' - 'tag delete' - 'tag list' - 'tag set' - 'undo' - 'unsign' - 'util' - 'util backend' - 'util backend name' - 'util completion' - 'util config-schema' - 'util exec' - 'util gc' - 'util install-man-pages' - 'util markdown-help' - 'util snapshot' - 'version' - 'workspace' - 'workspace add' - 'workspace forget' - 'workspace list' - 'workspace rename' - 'workspace root' - 'workspace update-stale' - ] -} +# Abandon a revision +export complete [jj abandon] [ + ...revsets: by "nu-complete jj revisions" # The revision(s) to abandon (default: @) [aliases: -r] + --retain-bookmarks # Do not delete bookmarks pointing to the revisions to abandon + --restore-descendants # Do not modify the content of the children of the abandoned commits + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] -def keywords [] { - [ - { value: 'bookmarks', description: 'named pointers to revisions' } - { value: 'config', description: 'how and where to set configuration options' } - { value: 'filesets', description: 'a functional language for selecting a set of files' } - { value: 'glossary', description: 'definitions of various terms' } - { value: 'revsets', description: 'a functional language for selecting a set of revision' } - { value: 'templates', description: 'a functional language to customize command output' } - { value: 'tutorial', description: 'show a tutorial to get started with jj' } - ] -} +# Move changes from a revision into the stack of mutable revisions +export complete [jj absorb] [ + ...filesets: by "nu-complete jj changed-files" # Move only changes to these paths (instead of all paths) + --from(-f): by "nu-complete jj revisions" # Source revision to absorb from [default: @] + --into(-t): by "nu-complete jj revisions" # Destination revisions to absorb into [default: mutable()] [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --into + --interactive(-i) # Interactively choose which parts to absorb + --tool: text # Specify diff editor to be used (implies --interactive) + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] -def bookmarks-sort [] { - [ - 'name' - 'name-' - 'author-name' - 'author-name-' - 'author-email' - 'author-email-' - 'author-date' - 'author-date-' - 'committer-name' - 'committer-name-' - 'committer-email' - 'committer-email-' - 'committer-date' - 'committer-date-' - ] -} +# Interactively arrange the commit graph +export complete [jj arrange] [ + ...revsets: by "nu-complete jj revisions" # The revisions to arrange [aliases: -r] + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Find a bad revision by bisection +export complete [jj bisect] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Run a given command to find the first bad revision +export complete [jj bisect run] [ + command?: command # Command to run to determine the status of a revision + ...args: fallback # Arguments to pass to the command + --range(-r): by "nu-complete jj revisions" # Range of revisions to bisect (can be repeated) + --find-good # Find the first good revision instead + --trust-endpoints # Skip the pre-bisection checks + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Manage bookmarks [default alias: b] +export complete [jj bookmark] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Manage bookmarks [default alias: b] +export complete [jj b] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] -def tags-sort [] { - [ - 'name' - 'name-' - 'author-name' - 'author-name-' - 'author-email' - 'author-email-' - 'author-date' - 'author-date-' - 'committer-name' - 'committer-name-' - 'committer-email' - 'committer-email-' - 'committer-date' - 'committer-date-' - ] -} +# Advance the closest bookmarks to a target revision +export complete [jj bookmark advance] [ + ...names: by "nu-complete jj local-bookmarks" # Move bookmarks matching the given name patterns + --to(-t): by "nu-complete jj revisions" # Move bookmarks to this revision + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] -def restore-options [] { - [ - { value: 'repo', description: 'the jj repo state and local bookmarks' } - { value: 'remote-tracking', description: 'the remote-tracking bookmarks' } - ] -} +# Advance the closest bookmarks to a target revision +export complete [jj b advance] [ + ...names: by "nu-complete jj local-bookmarks" # Move bookmarks matching the given name patterns + --to(-t): by "nu-complete jj revisions" # Move bookmarks to this revision + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] -def shells [] { - ['bash', 'elvish', 'fish', 'nushell', 'power-shell', 'zsh'] +# Advance the closest bookmarks to a target revision +export complete [jj bookmark a] [ + ...names: by "nu-complete jj local-bookmarks" # Move bookmarks matching the given name patterns + --to(-t): by "nu-complete jj revisions" # Move bookmarks to this revision + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Advance the closest bookmarks to a target revision +export complete [jj b a] [ + ...names: by "nu-complete jj local-bookmarks" # Move bookmarks matching the given name patterns + --to(-t): by "nu-complete jj revisions" # Move bookmarks to this revision + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Create a new bookmark +export complete [jj bookmark create] [ + ...names: text # The bookmarks to create + --revision(-r): by "nu-complete jj revisions" # The bookmark's target revision [default: @] [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --revision + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Create a new bookmark +export complete [jj b create] [ + ...names: text # The bookmarks to create + --revision(-r): by "nu-complete jj revisions" # The bookmark's target revision [default: @] [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --revision + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Create a new bookmark +export complete [jj bookmark c] [ + ...names: text # The bookmarks to create + --revision(-r): by "nu-complete jj revisions" # The bookmark's target revision [default: @] [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --revision + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Create a new bookmark +export complete [jj b c] [ + ...names: text # The bookmarks to create + --revision(-r): by "nu-complete jj revisions" # The bookmark's target revision [default: @] [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --revision + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Delete an existing bookmark and propagate the deletion to remotes on the next push +export complete [jj bookmark delete] [ + ...names: by "nu-complete jj local-bookmarks" # The bookmarks to delete + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Delete an existing bookmark and propagate the deletion to remotes on the next push +export complete [jj b delete] [ + ...names: by "nu-complete jj local-bookmarks" # The bookmarks to delete + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Delete an existing bookmark and propagate the deletion to remotes on the next push +export complete [jj bookmark d] [ + ...names: by "nu-complete jj local-bookmarks" # The bookmarks to delete + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Delete an existing bookmark and propagate the deletion to remotes on the next push +export complete [jj b d] [ + ...names: by "nu-complete jj local-bookmarks" # The bookmarks to delete + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Forget a bookmark without marking it as a deletion to be pushed +export complete [jj bookmark forget] [ + ...names: by "nu-complete jj bookmarks" # The bookmarks to forget + --include-remotes # When forgetting a local bookmark, also forget any corresponding remote bookmarks + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Forget a bookmark without marking it as a deletion to be pushed +export complete [jj b forget] [ + ...names: by "nu-complete jj bookmarks" # The bookmarks to forget + --include-remotes # When forgetting a local bookmark, also forget any corresponding remote bookmarks + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Forget a bookmark without marking it as a deletion to be pushed +export complete [jj bookmark f] [ + ...names: by "nu-complete jj bookmarks" # The bookmarks to forget + --include-remotes # When forgetting a local bookmark, also forget any corresponding remote bookmarks + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Forget a bookmark without marking it as a deletion to be pushed +export complete [jj b f] [ + ...names: by "nu-complete jj bookmarks" # The bookmarks to forget + --include-remotes # When forgetting a local bookmark, also forget any corresponding remote bookmarks + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# List bookmarks and their targets +export complete [jj bookmark list] [ + ...names: by "nu-complete jj bookmarks" # Show bookmarks whose local name matches + --all-remotes(-a) # Show all tracked and untracked remote bookmarks including the ones whose targets are synchronized with the... + --remote: by "nu-complete jj remotes" # Show all tracked and untracked remote bookmarks belonging to this remote + --tracked(-t) # Show tracked remote bookmarks only + --conflicted(-c) # Show conflicted bookmarks only + --revision(-r): by "nu-complete jj revisions" # Show bookmarks whose local targets are in the given revisions + --revisions: by "nu-complete jj revisions" # Alias of --revision + --template(-T): text # Render each bookmark using the given template + --sort: words [name name- author-name author-name- author-email author-email- author-date author-date- committer-name committer-name- committer-email committer-email- committer-date committer-date-] # Sort bookmarks based on the given key (or multiple keys) + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--all-remotes --remote] + at-most-one [--all-remotes --tracked] + at-most-one [--all-remotes --conflicted] } -def sparse-patterns [] { - [ - { value: 'copy', description: 'copy all sparse patterns from the current workspace' } - { value: 'full', description: 'include all files in the new workspace' } - { value: 'empty', description: 'clear all files from the workspace' } - ] +# List bookmarks and their targets +export complete [jj b list] [ + ...names: by "nu-complete jj bookmarks" # Show bookmarks whose local name matches + --all-remotes(-a) # Show all tracked and untracked remote bookmarks including the ones whose targets are synchronized with the... + --remote: by "nu-complete jj remotes" # Show all tracked and untracked remote bookmarks belonging to this remote + --tracked(-t) # Show tracked remote bookmarks only + --conflicted(-c) # Show conflicted bookmarks only + --revision(-r): by "nu-complete jj revisions" # Show bookmarks whose local targets are in the given revisions + --revisions: by "nu-complete jj revisions" # Alias of --revision + --template(-T): text # Render each bookmark using the given template + --sort: words [name name- author-name author-name- author-email author-email- author-date author-date- committer-name committer-name- committer-email committer-email- committer-date committer-date-] # Sort bookmarks based on the given key (or multiple keys) + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--all-remotes --remote] + at-most-one [--all-remotes --tracked] + at-most-one [--all-remotes --conflicted] } -def color-when [] { - ['always', 'never', 'debug', 'auto'] +# List bookmarks and their targets +export complete [jj bookmark l] [ + ...names: by "nu-complete jj bookmarks" # Show bookmarks whose local name matches + --all-remotes(-a) # Show all tracked and untracked remote bookmarks including the ones whose targets are synchronized with the... + --remote: by "nu-complete jj remotes" # Show all tracked and untracked remote bookmarks belonging to this remote + --tracked(-t) # Show tracked remote bookmarks only + --conflicted(-c) # Show conflicted bookmarks only + --revision(-r): by "nu-complete jj revisions" # Show bookmarks whose local targets are in the given revisions + --revisions: by "nu-complete jj revisions" # Alias of --revision + --template(-T): text # Render each bookmark using the given template + --sort: words [name name- author-name author-name- author-email author-email- author-date author-date- committer-name committer-name- committer-email committer-email- committer-date committer-date-] # Sort bookmarks based on the given key (or multiple keys) + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--all-remotes --remote] + at-most-one [--all-remotes --tracked] + at-most-one [--all-remotes --conflicted] } -def gerrit-notify [] { - [ - { value: 'none', description: 'no notification' } - { value: 'owner', description: 'notify the change owner' } - { value: 'owner-reviewers', description: 'notify the change owner and reviewers' } - { value: 'all', description: 'notify all relevant users' } - ] +# List bookmarks and their targets +export complete [jj b l] [ + ...names: by "nu-complete jj bookmarks" # Show bookmarks whose local name matches + --all-remotes(-a) # Show all tracked and untracked remote bookmarks including the ones whose targets are synchronized with the... + --remote: by "nu-complete jj remotes" # Show all tracked and untracked remote bookmarks belonging to this remote + --tracked(-t) # Show tracked remote bookmarks only + --conflicted(-c) # Show conflicted bookmarks only + --revision(-r): by "nu-complete jj revisions" # Show bookmarks whose local targets are in the given revisions + --revisions: by "nu-complete jj revisions" # Alias of --revision + --template(-T): text # Render each bookmark using the given template + --sort: words [name name- author-name author-name- author-email author-email- author-date author-date- committer-name committer-name- committer-email committer-email- committer-date committer-date-] # Sort bookmarks based on the given key (or multiple keys) + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--all-remotes --remote] + at-most-one [--all-remotes --tracked] + at-most-one [--all-remotes --conflicted] } -# Abandon a revision -export extern "jj abandon" [ - ...revsets: string@revsets # the revision(s) to abandon (default: @) - --retain-bookmarks # move bookmakrs to parent revisions - --restore-descendents # do not modify the content of the children of the abandoned commits - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +# Move existing bookmarks to target revision +export complete [jj bookmark move] [ + ...names: by "nu-complete jj local-bookmarks" # Move bookmarks matching the given name patterns + --from(-f): by "nu-complete jj revisions" # Move bookmarks from the given revisions + --to(-t): by "nu-complete jj revisions" # Move bookmarks to this revision [default: @] + --allow-backwards(-B) # Allow moving bookmarks backwards or sideways + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] -# Move changes from a revision into the stack of mutable revisions -export extern "jj absorb" [ - ...filesets: path # move only changes to these paths - --from(-f): string@revsets # source revision to absorb from - --into(-t): string@revsets # destination revisions to absorb into - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +# Move existing bookmarks to target revision +export complete [jj b move] [ + ...names: by "nu-complete jj local-bookmarks" # Move bookmarks matching the given name patterns + --from(-f): by "nu-complete jj revisions" # Move bookmarks from the given revisions + --to(-t): by "nu-complete jj revisions" # Move bookmarks to this revision [default: @] + --allow-backwards(-B) # Allow moving bookmarks backwards or sideways + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] -# Interactively arrange the commit graph -export extern "jj arrange" [ - ...revisions: string@revsets # the revisions to edit - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Run a given command to find the first bad revision. -export extern "jj bisect run" [ - command: string # command to run to determine whether the bug is present - ...args: string # arguments to pass to the command - --range(-r): string@revsets # range of revisions to bisect - --find-good # whether to find the first good revision instead - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +# Move existing bookmarks to target revision +export complete [jj bookmark m] [ + ...names: by "nu-complete jj local-bookmarks" # Move bookmarks matching the given name patterns + --from(-f): by "nu-complete jj revisions" # Move bookmarks from the given revisions + --to(-t): by "nu-complete jj revisions" # Move bookmarks to this revision [default: @] + --allow-backwards(-B) # Allow moving bookmarks backwards or sideways + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] -# Advance the closest bookmarks to a target revision -export extern "jj bookmark advance" [ - ...names: string@local-bookmarks # move bookmarks matching the given name - --to(-t): string@revsets # move bookmarks to this revision - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +# Move existing bookmarks to target revision +export complete [jj b m] [ + ...names: by "nu-complete jj local-bookmarks" # Move bookmarks matching the given name patterns + --from(-f): by "nu-complete jj revisions" # Move bookmarks from the given revisions + --to(-t): by "nu-complete jj revisions" # Move bookmarks to this revision [default: @] + --allow-backwards(-B) # Allow moving bookmarks backwards or sideways + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Rename `old` bookmark name to `new` bookmark name +export complete [jj bookmark rename] [ + old: by "nu-complete jj local-bookmarks" # The old name of the bookmark + new: text # The new name of the bookmark + --overwrite-existing # Allow renaming even if the new bookmark name already exists + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Rename `old` bookmark name to `new` bookmark name +export complete [jj b rename] [ + old: by "nu-complete jj local-bookmarks" # The old name of the bookmark + new: text # The new name of the bookmark + --overwrite-existing # Allow renaming even if the new bookmark name already exists + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Rename `old` bookmark name to `new` bookmark name +export complete [jj bookmark r] [ + old: by "nu-complete jj local-bookmarks" # The old name of the bookmark + new: text # The new name of the bookmark + --overwrite-existing # Allow renaming even if the new bookmark name already exists + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Rename `old` bookmark name to `new` bookmark name +export complete [jj b r] [ + old: by "nu-complete jj local-bookmarks" # The old name of the bookmark + new: text # The new name of the bookmark + --overwrite-existing # Allow renaming even if the new bookmark name already exists + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Create a new bookmark, or update an existing one by name +export complete [jj bookmark set] [ + ...names: by "nu-complete jj local-bookmarks" # The bookmarks to update + --revision(-r): by "nu-complete jj revisions" # The bookmark's target revision [default: @] [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --revision + --allow-backwards(-B) # Allow moving the bookmark backwards or sideways + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Create a new bookmark, or update an existing one by name +export complete [jj b set] [ + ...names: by "nu-complete jj local-bookmarks" # The bookmarks to update + --revision(-r): by "nu-complete jj revisions" # The bookmark's target revision [default: @] [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --revision + --allow-backwards(-B) # Allow moving the bookmark backwards or sideways + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Create a new bookmark, or update an existing one by name +export complete [jj bookmark s] [ + ...names: by "nu-complete jj local-bookmarks" # The bookmarks to update + --revision(-r): by "nu-complete jj revisions" # The bookmark's target revision [default: @] [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --revision + --allow-backwards(-B) # Allow moving the bookmark backwards or sideways + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Create a new bookmark, or update an existing one by name +export complete [jj b s] [ + ...names: by "nu-complete jj local-bookmarks" # The bookmarks to update + --revision(-r): by "nu-complete jj revisions" # The bookmark's target revision [default: @] [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --revision + --allow-backwards(-B) # Allow moving the bookmark backwards or sideways + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] -# Create a new bookmark -export extern "jj bookmark create" [ - ...bookmarks: string # the bookmarks to create - --revision(-r): string@revsets # the bookmark's target revision - --to: string@revsets # the bookmark's target revision - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Delete an existing bookmark -export extern "jj bookmark delete" [ - ...bookmarks: string@local-bookmarks # the bookmarks to delete - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Forget a bookmark without making it as a deletion to be pushed -export extern "jj bookmark forget" [ - ...bookmarks: string@local-bookmarks # the bookmarks to forget - --include-remotes # also forget any corresponding remote bookmarks - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# List bookmarks and their target -export extern "jj bookmark list" [ - ...names: string@local-bookmarks # show bookmarks whose local name matches the pattern - --all-remotes(-a) # show all tracking and non-tracking remote bookmarks - --remote: string@remotes # show all tracking and non-tracking bookmarks belonging to this remote - --tracked(-t) # only show tracked bookmarks - --conflicted(-c) # only show conflicted bookmarks - --revisions(-r): string@revsets # show bookmarks whose local targets are in the given revisions - --template(-T): string # use a template to render bookmarks - --sort: string@bookmarks-sort # sort bookmarks based on the given key - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +# Start tracking given remote bookmarks +export complete [jj bookmark track] [ + ...bookmark: by "nu-complete jj bookmarks" # Bookmark name patterns or remote bookmark symbols to track + --remote: by "nu-complete jj remotes" # Remote names to track + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] -# Move existing bookmarks to target revision -export extern "jj bookmark move" [ - ...names: string@local-bookmarks # move bookmarks matching the pattern - --from(-f): string@revsets # the revisions to move the bookmarks from - --to(-t): string@revsets # the revision to move the bookmarks to - --allow-backwards(-B) # allow moving bookmarks backwards or sideways - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Rename a bookmark -export extern "jj bookmark rename" [ - old: string@local-bookmarks # the bookmark to rename - new: string # the new name of the bookmark - --overwrite-existing # allow overwriting an existing bookmark - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Create or update a bookmark to point to a certain commit -export extern "jj bookmark set" [ - ...names: string@local-bookmarks # the bookmarks to update - --revision(-r): string@revsets # the bookmark's target revision - --to: string@revsets # the bookmark's target revision - --allow-backwards(-B) # allow moving the bookmark backwards or sideways - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +# Start tracking given remote bookmarks +export complete [jj b track] [ + ...bookmark: by "nu-complete jj bookmarks" # Bookmark name patterns or remote bookmark symbols to track + --remote: by "nu-complete jj remotes" # Remote names to track + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Start tracking given remote bookmarks -export extern "jj bookmark track" [ - ...bookmarks: string@untracked-bookmarks # remote bookmarks to track - --remote: string@remotes # remotes to track bookmark from - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj bookmark t] [ + ...bookmark: by "nu-complete jj bookmarks" # Bookmark name patterns or remote bookmark symbols to track + --remote: by "nu-complete jj remotes" # Remote names to track + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Start tracking given remote bookmarks -export extern "jj bookmark untrack" [ - ...bookmarks: string@tracked-bookmarks # remote bookmarks to untrack - --remote: string@remotes # remotes to untrack bookmark from - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj b t] [ + ...bookmark: by "nu-complete jj bookmarks" # Bookmark name patterns or remote bookmark symbols to track + --remote: by "nu-complete jj remotes" # Remote names to track + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Stop tracking given remote bookmarks +export complete [jj bookmark untrack] [ + ...bookmark: by "nu-complete jj bookmarks" # Bookmark name patterns or remote bookmark symbols to untrack + --remote: by "nu-complete jj remotes" # Remote names to untrack + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Stop tracking given remote bookmarks +export complete [jj b untrack] [ + ...bookmark: by "nu-complete jj bookmarks" # Bookmark name patterns or remote bookmark symbols to untrack + --remote: by "nu-complete jj remotes" # Remote names to untrack + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Update the description and create a new change on top [default alias: ci] -export extern "jj commit" [ - ...filesets: path@modified-files # put theses changes in the first commit - --interactive(-i) # interactively choose which changes to include in the first commit - --tool: path # specify diff editor to be used (implies --interactive) - --message(-m): string # the change description to use - --editor # open an editor to edit the change description - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Start an editor on a jj config file. -export extern "jj config edit" [ - --user # targer the user-level config - --repo # target the repo-level config - --workspace # target the workspace-level config - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Get the value of a given config option -export extern "jj config get" [ - name: string # the config option to get - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj commit] [ + ...filesets: by "nu-complete jj changed-files" # Put these paths in the current commit + --interactive(-i) # Interactively choose which changes to include in the current commit + --tool: text # Specify diff editor to be used (implies --interactive) + --message(-m): text # The change description to use (don't open editor) + --editor # Open an editor to edit the change description + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] -# List variables set in config files, along with their values -export extern "jj config list" [ - name?: string # name of a config option to look upi - --include-defaults # whether to include default values - --include-overriden # whether to include overriden values - --user # target the user-level config - --repo # target the repo-level config - --workspace # target the workspace-level config - --template(-T): string # render each variable using the template - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +# Update the description and create a new change on top [default alias: ci] +export complete [jj ci] [ + ...filesets: by "nu-complete jj changed-files" # Put these paths in the current commit + --interactive(-i) # Interactively choose which changes to include in the current commit + --tool: text # Specify diff editor to be used (implies --interactive) + --message(-m): text # The change description to use (don't open editor) + --editor # Open an editor to edit the change description + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Manage config options +export complete [jj config] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Start an editor on a jj config file +export complete [jj config edit] [ + --user # Target the user-level config + --repo # Target the repo-level config + --workspace # Target the workspace-level config + --file: path # Target the config file specified by the given path + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--user --repo --workspace --file] +} + +# Find and optionally delete repo-level config directories whose repo path no longer exists +export complete [jj config gc] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Get the value of a given config option. +export complete [jj config get] [ + name: text # + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] +# List variables set in config files, along with their values +export complete [jj config list] [ + name?: text # An optional name of a specific config option to look up + --include-defaults # Whether to explicitly include built-in default values in the list + --include-overridden # Allow printing overridden values + --user # Target the user-level config + --repo # Target the repo-level config + --workspace # Target the workspace-level config + --template(-T): text # Render each variable using the given template + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--include-defaults --user --repo --workspace] +} + # Print the paths to the config files -export extern "jj config path" [ - --user # targer the user-level config - --repo # target the repo-level config - --workspace # target the workspace-level config - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj config path] [ + --user # Target the user-level config + --repo # Target the repo-level config + --workspace # Target the workspace-level config + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--user --repo --workspace] +} # Update a config file to set the given option to a given value -export extern "jj config set" [ - name: string # the config option to set - value: string # the value to set - --user # targer the user-level config - --repo # target the repo-level config - --workspace # target the workspace-level config - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj config set] [ + name: text # + value: text # New value to set + --user # Target the user-level config + --repo # Target the repo-level config + --workspace # Target the workspace-level config + --file: path # Target the config file specified by the given path + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--user --repo --workspace --file] +} # Update a config file to unset the given option -export extern "jj config unset" [ - name: string # the config option to unset - --user # targer the user-level config - --repo # target the repo-level config - --workspace # target the workspace-level config - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Update the change description or other metadata -export extern "jj describe" [ - ...revisions: string@revsets # the revision(s) whose description to edit (default: @) - --message(-m): string # the change description to use - --stdin # read the change description from stdin - --editor # open an editor to edit the change description - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj config unset] [ + name: text # + --user # Target the user-level config + --repo # Target the repo-level config + --workspace # Target the workspace-level config + --file: path # Target the config file specified by the given path + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--user --repo --workspace --file] +} + +# Converge divergent changes +export complete [jj converge] [ + --revision(-r): by "nu-complete jj revisions" # The search space to look for divergent revisions + --revisions: by "nu-complete jj revisions" # Alias of --revision + --no-interactive # Do not prompt the user for help resolving divergence + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Update the change description or other metadata [default alias: desc] +export complete [jj describe] [ + ...revsets: by "nu-complete jj revisions" # The revision(s) whose description to edit (default: @) [aliases: -r] + --message(-m): text # The change description to use (don't open editor) + --stdin # Read the change description from stdin + --editor # Open an editor to edit the change description + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--message --stdin] +} + +# Update the change description or other metadata [default alias: desc] +export complete [jj desc] [ + ...revsets: by "nu-complete jj revisions" # The revision(s) whose description to edit (default: @) [aliases: -r] + --message(-m): text # The change description to use (don't open editor) + --stdin # Read the change description from stdin + --editor # Open an editor to edit the change description + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--message --stdin] +} # Compare file contents between two revisions -export extern "jj diff" [ - ...filesets: path # restrict the diff to these paths - --revisions(-r): string@revsets # show changes in these revisions - --from(-f): string@revsets # show changes from this revision - --to(-t): string@revsets # show changes to this revision - --template(-T): string # render each file diff entry using the given template - --summary(-s) # show only whether each path was modified, added, or deleted - --stat # show a histogram of the changes - --types # for each path, show only its type before and after - --name-only # for each path, show only its path - --git # show a Git-format diff - --color-words # show a word-level diff with changes indicated only by color - --tool: path # generate diff by external command - --context: int # number of lines of context to show - --ignore-all-space(-w) # ignore whitespace when comparing lines - --ignore-space-change(-b) # ignore changes in amount of whitespace when comparing lines - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Display the content changes in a revision with a diff editor -export extern "jj diffedit" [ - ...filesets: path # only display these paths - --revisions(-r): string@revsets # show changes in these revisions - --from(-f): string@revsets # show changes from this revision - --to(-t): string@revsets # show changes to this revision - --tool: path # specify diff editor to use - --restore-descendants # preserve the content when rebasing descendants - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj diff] [ + ...filesets: by "nu-complete jj changed-files" # Restrict the diff to these paths + --revisions(-r): by "nu-complete jj revisions" # Show changes in these revisions + --from(-f): by "nu-complete jj revisions" # Show changes from this revision + --to(-t): by "nu-complete jj revisions" # Show changes to this revision + --help(-h) # Print help + --template(-T): text # Render each file diff entry using the given template + --summary(-s) # For each path, show only whether it was modified, added, or deleted + --stat # Show a histogram of the changes + --types # For each path, show only its type before and after + --name-only # For each path, show only its path + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace when comparing lines + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--revisions --from] + at-most-one [--revisions --to] + at-most-one [--template --summary --stat --types --name-only] + at-most-one [--template --git --color-words] + at-most-one [--template --tool] + at-most-one [--ignore-all-space --ignore-space-change] +} + +# Touch up the content changes in a revision with a diff editor +export complete [jj diffedit] [ + ...filesets: by "nu-complete jj changed-files" # Edit only these paths (unmatched paths will remain unchanged) + --revision(-r): by "nu-complete jj revisions" # The revision to touch up + --from(-f): by "nu-complete jj revisions" # Show changes from this revision + --to(-t): by "nu-complete jj revisions" # Edit changes in this revision + --tool: text # Specify diff editor to be used + --restore-descendants # Preserve the content (not the diff) when rebasing descendants + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--revision --from] + at-most-one [--revision --to] +} # Create new changes with the same content as existing ones -export extern "jj duplicate" [ - ...revsets: string@revsets # the revisions to duplicate - --onto(-o): string@revsets # the revisions to duplicate onto - --insert-after(-A): string@revsets # the revisions to insert after - --after: string@revsets # the revisions to insert after - --insert-before(-B): string@revsets # the revisions to isnert before - --before: string@revsets # the revisions to isnert before - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj duplicate] [ + ...revsets: by "nu-complete jj revisions" # The revision(s) to duplicate (default: @) [aliases: -r] + --onto(-o): by "nu-complete jj revisions" # The revision(s) to duplicate onto (can be repeated to create a merge commit) [aliases: -d, --destination] + --insert-after(-A): by "nu-complete jj revisions" # The revision(s) to insert after (can be repeated to create a merge commit) [alias: --after] + --after: by "nu-complete jj revisions" # Alias of --insert-after + --insert-before(-B): by "nu-complete jj revisions" # The revision(s) to insert before (can be repeated to create a merge commit) [alias: --before] + --before: by "nu-complete jj revisions" # Alias of --insert-before + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--onto --insert-after] + at-most-one [--onto --insert-before] +} # Sets the specified revision as the working-copy revision -export extern "jj edit" [ - revset: string@revsets # the commit to edit - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj edit] [ + revset?: by "nu-complete jj revisions" # The commit to edit [aliases: -r] + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Show how a change has evolved over time -export extern "jj evolog" [ - --revisions(-r): string@revsets # follow changes from these revisions - --limit(-n): int # limit the number of revisions to show - --reversed # show revisions in the opposite order - --no-graph(-G) # do not show the graph - --template(-T): string # render each revision using the given template - --patch(-p) # show patch compated to the previous version - --summary(-s) # show only whether each path was modified, added, or deleted - --stat # show a histogram of the changes - --types # for each path, show only its type before and after - --name-only # for each path, show only its path - --git # show a Git-format diff - --color-words # show a word-level diff with changes indicated only by color - --tool: path # generate diff by external command - --context: int # number of lines of context to show - --ignore-all-space # ignore whitespace when comparing lines - --ignore-space-change # ignore changes in amount of whitespace when comparing lines - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Show the source change for each line of the target file. -export extern "jj file annotate" [ - path: path@tracked-files # the file to annotate - --revision(-r): string@revsets # an optional revision to start at - --template(-T): string # render each line using the given template - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj evolog] [ + --revisions(-r): by "nu-complete jj revisions" # Follow changes from these revisions [default: @] + --limit(-n): text # Limit number of revisions to show + --reversed # Show revisions in the opposite order (older revisions first) + --no-graph(-G) # Show a flat list of revisions instead of a graph + --template(-T): text # Render each revision using the given template + --patch(-p) # Show patch compared to the previous version of this change + --help(-h) # Print help + --summary(-s) # For each path, show only whether it was modified, added, or deleted + --stat # Show a histogram of the changes + --types # For each path, show only its type before and after + --name-only # For each path, show only its path + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space # Ignore whitespace when comparing lines + --ignore-space-change # Ignore changes in amount of whitespace when comparing lines + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--summary --stat --types --name-only] + at-most-one [--git --color-words] + at-most-one [--ignore-all-space --ignore-space-change] +} + +# File operations +export complete [jj file] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Show the source change for each line of the target file +export complete [jj file annotate] [ + path: by "nu-complete jj files" # the file to annotate + --revision(-r): by "nu-complete jj revisions" # an optional revision to start at + --template(-T): text # Render each line using the given template + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Sets or removes the executable bit for paths in the repo -export extern "jj file chmod" [ - mode: string@modes # the mode to set - ...files: path@tracked-files # paths to change the executable bit for - --revision(-r): string@revsets # an optional revision to start at - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj file chmod] [ + mode: words [normal: "make a path non-executable" executable: "make a path executable"] # + ...filesets: by "nu-complete jj files" # Paths to change the executable bit for + --revision(-r): by "nu-complete jj revisions" # The revision to update [default: @] + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Delete files from the given revision +export complete [jj file delete] [ + ...filesets: by "nu-complete jj files" # Files or directories to delete (filesets are accepted) + --revision(-r): by "nu-complete jj revisions" # The revision to delete the files in [default: @] + --restore-descendants # Preserve the content (not the diff) when rebasing descendants + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Edit the contents of a file in a revision +export complete [jj file edit] [ + file: by "nu-complete jj files" # The file to edit + --revision(-r): by "nu-complete jj revisions" # The revision to edit the file in [default: @] + --restore-descendants # Preserve the content (not the diff) when rebasing descendants + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # List files in a revision -export extern "jj file list" [ - ...files: path # only list files matching these prefixes - --revision(-r): string@revsets # the revision to list files in - --template(-T): string # render each line using the given template - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj file list] [ + ...filesets: by "nu-complete jj files" # Only list files matching these prefixes (instead of all files) + --revision(-r): by "nu-complete jj revisions" # The revision to list files in [default: @] + --template(-T): text # Render each file entry using the given template + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Search for content in files -export extern "jj file search" [ - ...filesets: path # only search files matching these prefixes - --revision(-r): string@revsets # the revision to search files in - --pattern(-p): string # the pattern to search for - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj file search] [ + ...filesets: by "nu-complete jj files" # Only search files matching these prefixes (instead of all files) + --revision(-r): by "nu-complete jj revisions" # The revision to search files in [default: @] + --pattern(-p): text # The pattern to search for in a single line + --name-only # Print only the paths of files that contain a match, not the matched lines + --line-number(-n) # Prefix each matched line with its 1-based line number within the file + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--name-only --line-number] +} # Print contents of files in a revision -export extern "jj file show" [ - ...files: path # paths to print - --revision(-r): string@revsets # the revision to get the file contents from - --template(-T): string # render each file metadata using the given template - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj file show] [ + ...filesets: by "nu-complete jj files" # Paths to print + --revision(-r): by "nu-complete jj revisions" # The revision to get the file contents from [default: @] + --template(-T): text # Render each file metadata using the given template + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Start tracking specified paths in the working copy -export extern "jj file track" [ - ...files: path # paths to track - --include-ignored # track paths even if they're ignored or too large - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj file track] [ + ...filesets: by "nu-complete jj files" # Paths to track + --include-ignored # Track paths even if they're ignored or too large + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Stop tracking specified paths in the working copy -export extern "jj file untrack" [ - ...files: path@tracked-files # paths to untrack - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj file untrack] [ + ...filesets: by "nu-complete jj changed-files" # Paths to untrack. They must already be ignored + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Update files with formatting fixes or other changes -export extern "jj fix" [ - ...filesets: path # fix only these paths - --source(-s): string@revsets # fix files in these revisions and their descendants - --include-unchanged-files # also fix unchanged files - --all-lines(-a) # format all lines instead of only modified lines - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Upload changes to Gerrit for code review, or update existing changes. -export extern "jj gerrit upload" [ - --revisions(-r): string@revsets # the revisions to send to gerrit - --remote-branch(-b) # the location where your changes are intended to land - --remote: string # the gerrit remote to push top - --dry-run(-n) # do not actually push the changes to gerrit - --reviewer: string # add these emails as a reviewer - --cc: string # CC these emails on the change - --label(-l): string # add the following labels - --topic: string # applies a topic to the change - --hashtag: string # applies a hashtag to the change - --message(-m) # a patch set description of the new patch - --edit # push the change as a change edit - --wip # marks the change as work in progress - --ready # unmarks the change as work in progress - --private # - --remove-private # unmarks the change as private - --publish-comments # publishes any draft comments for the given change - --no-publish-comments # disables publishing of any draft comments - --notify: string@gerrit-notify # who to email notifications to - --submit # directly submit the changes - --skip-validation # skip performing validations - --merged # create a new change, even if the change has already been merged - --ignore-attention-set # do not modify the attention set upon uploading - --deadline: string # the deadline after which the push should be aborted - --custom: string # send the following custom keyed values - --option(-o): string # send a `git push -o` option - --trace: string # for debugging Gerrit - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj fix] [ + ...filesets: by "nu-complete jj files" # Fix only these paths + --source(-s): by "nu-complete jj revisions" # Fix files in the specified revision(s) and their descendants. If no revisions are specified, this defaults... + --include-unchanged-files # Fix unchanged files in addition to changed ones. If no paths are specified, all files in the repo will be f... + --all-lines(-a) # Format all lines instead of only modified lines + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Interact with Gerrit Code Review +export complete [jj gerrit] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Upload changes to Gerrit for code review, or update existing changes +export complete [jj gerrit upload] [ + --revision(-r): by "nu-complete jj revisions" # The revisions to upload to Gerrit + --remote-branch(-b): text # The location where your changes are intended to land + --remote: by "nu-complete jj remotes" # The Gerrit remote to push to + --dry-run(-n) # Only display what will change on the remote; do not push changes to Gerrit + --reviewer: text # Add these emails as a reviewer (can be repeated) + --cc: text # CC these emails on the change (can be repeated) + --label(-l): text # Add the following labels configured by Gerrit (can be repeated) + --topic: text # Apply a topic to the change + --hashtag: text # Apply a hashtag to the change (can be repeated) + --message(-m): text # The description for the patch set + --edit # Push the change as a change edit + --wip # Mark the change as WIP (work in progress) + --ready # Mark the change as ready (no longer work in progress) + --private # Mark the change as private + --remove-private # Unmark the change as private + --publish-comments # Publish draft comments for the given change + --no-publish-comments # Do not publish draft comments for the given change + --notify: words [none owner owner-reviewers all] # Who to email notifications to (defaults to all) + --submit # Directly submit the changes, bypassing code review + --skip-validation # When --submit is provided, skip performing validations + --merged # Create a new change, even if the change has already been merged + --ignore-attention-set # Do not modify the attention set upon uploading + --deadline: text # The deadline after which the push should be aborted + --custom: text # Send the following custom keyed values to Gerrit (can be repeated) + --option(-o): text # Send a `git push -o` option (can be repeated) + --trace: text # For debugging Gerrit + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Commands for working with Git remotes and the underlying Git repo +export complete [jj git] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Create a new repo backed by a clone of a Git repo -export extern "jj git clone" [ - source: string # url or path of the git repo to clone - destination?: path # target directory for the repository clone - --remote: string # name of the newly created remote - --colocate # colocate the jj repo with the git repo - --no-colocate # disable colocation of the jj repo with the git repo - --depth: int # creates a shallow clone of the given depth - --fetch-tags: string@fetch-tags # configure when to fetch tags - --branch(-b): string # name of the branch to fetch - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj git clone] [ + source: text # URL or path of the Git repo to clone + destination?: dir # Specifies the target directory for the Jujutsu repository clone. If not provided, defaults to a directory n... + --remote: text # Name of the newly created remote [default: origin] + --colocate # Colocate the Jujutsu repo with the git repo + --no-colocate # Disable colocation of the Jujutsu repo with the git repo + --depth: text # Create a shallow clone of the given depth + --branch(-b): text # Name of the branch to fetch and use as the parent of the working-copy change (can be repeated) + --tag(-t): text # Fetch only some of the tags (can be repeated) + --object-hash: words [sha1 sha256] # Object hash algorithm for the local Git repository + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--colocate --no-colocate] +} + +# Manage Jujutsu repository colocation with Git +export complete [jj git colocation] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Convert into a non-colocated Jujutsu/Git repository -export extern "jj git colocation disable" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj git colocation disable] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Convert into a colocated Jujutsu/Git repository -export extern "jj git colocation enable" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj git colocation enable] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Show the current colocation status -export extern "jj git colocation status" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj git colocation status] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Update the underlying Git repo with changes made in the repo -export extern "jj git export" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj git export] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Fetch from a Git remote -export extern "jj git fetch" [ - --branch(-b): string # only fetch some of the branches - --tracked # only fetch tracked bookmarks - --remote: string@remotes # the remote to fetch from - --all-remotes # fetch from all remotes - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj git fetch] [ + --branch(-b): by "nu-complete jj bookmarks" # Name of the branch to fetch (can be repeated) + --tag(-t): by "nu-complete jj tags" # Fetch only some of the tags (can be repeated) + --tracked # Fetch only tracked bookmarks and tags + --remote: by "nu-complete jj remotes" # The remote to fetch from (only named remotes are supported, can be repeated) + --all-remotes # Fetch from all remotes + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--branch --tracked] + at-most-one [--tag --tracked] + at-most-one [--remote --all-remotes] +} # Update repo with changes made in the underlying Git repo -export extern "jj git import" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj git import] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Create a new Git backed repo -export extern "jj git init" [ - destination?: path # the directory where the repo will be created (default '.') - --colocate # creates a valid git repo - --no-colocate # disable colocation of the jj repo with the git repo - --git-repo: path # the git repo to use as the backing repo - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj git init] [ + destination?: dir # The destination directory where the `jj` repo will be created. If the directory does not exist, it will be... + --colocate # Colocate the workspace of the Jujutsu repo with the Git repo + --no-colocate # Disable colocation for the workspace of the Jujutsu repo with the Git repo + --object-hash: words [sha1 sha256] # Object hash algorithm for the newly created Git repository + --git-repo: dir # Specifies a path to an **existing** git repository to be used as the backing git repo for the newly created... + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--colocate --no-colocate] + at-most-one [--colocate --git-repo] + at-most-one [--object-hash --git-repo] +} # Push to a Git remote -export extern "jj git push" [ - --remote: string@remotes # the remote to push to - --bookmark(-b): string@local-bookmarks # push only this bookmark - --all # push all bookmarks - --tracked # push all tracked bookmarks - --deleted # push all deleted bookmarks - --allow-empty-description # allow pushing commits with empty descriptions - --allow-private # allow pushing commits that are private - --revisions(-r): string@revsets # push bookmarks pointing to these commits - --change(-c): string@revsets # push this commit by creating a bookmark - --named: string # specify a new bookmark and the revision it points to - --dry-run # only display what will change on the remote - --option(-o): string # git push option - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj git push] [ + --remote: by "nu-complete jj remotes" # The remote(s) to push to (can be repeated) + --bookmark(-b): by "nu-complete jj bookmarks" # Push only this bookmark, or bookmarks matching a pattern (can be repeated) + --tag(-t): by "nu-complete jj tags" # Push only this tag, or tags matching a pattern (can be repeated) + --all # Push all bookmarks and tags (including new ones) + --tracked # Push all tracked bookmarks and tags + --deleted # Push all deleted bookmarks and tags + --allow-empty-description # Allow pushing commits with empty descriptions + --allow-private # Allow pushing commits that are private + --allow-conflicts # Allow pushing commits that contain conflicts + --revision(-r): by "nu-complete jj revisions" # Push bookmarks and tags pointing to these commits (can be repeated) + --revisions: by "nu-complete jj revisions" # Alias of --revision + --change(-c): by "nu-complete jj revisions" # Push this commit by creating a bookmark (can be repeated) + --named: text # Specify a new bookmark name and a revision to push under that name, e.g. '--named myfeature=@' + --dry-run # Only display what will change on the remote + --option(-o): text # Git push options + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--bookmark --all --tracked] + at-most-one [--bookmark --deleted] + at-most-one [--tag --all --tracked] + at-most-one [--tag --deleted] + at-most-one [--all --tracked --revision] + at-most-one [--all --tracked --change] + at-most-one [--all --tracked --named] + at-most-one [--deleted --revision] + at-most-one [--deleted --change] + at-most-one [--deleted --named] +} + +# Manage Git remotes +export complete [jj git remote] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Add a Git remote -export extern "jj git remote add" [ - remote: string # the remote name - url: string # the remote's URL or path - --fetch-tags: string@fetch-tags # configure when to fetch tags - --push-url: string # the URL or path to push to - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj git remote add] [ + remote: text # The remote's name + url: text # The remote's URL or path + --push-url: text # The URL used for push + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # List Git remotes -export extern "jj git remote list" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj git remote list] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Remove a Git remote and forget its bookmarks -export extern "jj git remote remove" [ - remote: string@remotes # the remote's name - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Rename a git remote -export extern "jj git remote rename" [ - old: string@remotes # the name of the existing remote - new: string # the new name of the remote - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj git remote remove] [ + remote: by "nu-complete jj remotes" # The remote's name + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Rename a Git remote +export complete [jj git remote rename] [ + old: by "nu-complete jj remotes" # The name of an existing remote + new: text # The desired name for `old` + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Set the URL of a Git remote -export extern "jj git remote set-url" [ - remote: string@remotes # the name of the existing remote - url?: string # the new url or path for the remote - --push: string # the URL or path to push to - --fetch: string # the URL or path to fetch from - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj git remote set-url] [ + remote: by "nu-complete jj remotes" # The remote's name + url?: text # The URL or path to fetch from + --push: text # The URL or path to push to + --fetch: text # The URL or path to fetch from + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Show the underlying Git directory of a repository using the Git backend -export extern "jj git root" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Print a help message -export extern "jj help" [ - ...commands: string@commands # print help for the subcommands - --keyword(-k): string@keywords # show help for a keyword instead of a command - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Compare the changes of two commits -export extern "jj interdiff" [ - ...filesets: path # restrict the diff to these paths - --from(-f): string@revsets # show changes from this revision - --to(-t): string@revsets # show changes to this revision - --summary(-s) # show only whether each path was modified, added, or deleted - --stat # show a histogram of the changes - --types # for each path, show only its type before and after - --name-only # for each path, show only its path - --git # show a Git-format diff - --color-words # show a word-level diff with changes indicated only by color - --tool: path # generate diff by external command - --context: int # number of lines of context to show - --ignore-all-space(-w) # ignore whitespace when comparing lines - --ignore-space-change(-b) # ignore changes in amount of whitespace when comparing lines - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj git root] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Show differences between the diffs of two revisions +export complete [jj interdiff] [ + ...filesets: by "nu-complete jj changed-files" # Restrict the diff to these paths + --from(-f): by "nu-complete jj revisions" # The first revision to compare (default: @) + --to(-t): by "nu-complete jj revisions" # The second revision to compare (default: @) + --help(-h) # Print help + --summary(-s) # For each path, show only whether it was modified, added, or deleted + --stat # Show a histogram of the changes + --types # For each path, show only its type before and after + --name-only # For each path, show only its path + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace when comparing lines + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--summary --stat --types --name-only] + at-most-one [--git --color-words] + at-most-one [--ignore-all-space --ignore-space-change] +} # Show revision history -export extern "jj log" [ - ...filesets: path # show revisions modifying the given paths - --revisions(-r): string@revsets # which revisions to show - --limit(-n): int # number of revisions to show - --reversed # show revisions in the opposite order - --no-graph(-G) # do not show the graph, use a flat list - --template(-T): string # use a template to render revisions - --patch(-p) # show patch - --count # print the number of commits instead of showing them - --summary(-s) # for each path, show only whether it was modified, added, or deleted - --stat # show a histogram of the changes - --types # for each path, show only its type before and after - --name-only # for each path, show only its path - --git # show a git format diff - --color-words # show a word-level diff with changes indicated by color - --tool: path # generate diff by external command - --context: int # number of lines of context to show - --ignore--all-space # ignore whitespace when comparing lines - --ignore-space-change # ignore changes in amount of whitespace when comparing lines - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj log] [ + ...filesets: by "nu-complete jj files" # Show revisions modifying the given paths + --revision(-r): by "nu-complete jj revisions" # Which revisions to show + --revisions: by "nu-complete jj revisions" # Alias of --revision + --limit(-n): text # Limit number of revisions to show + --reversed # Show revisions in the opposite order (older revisions first) + --no-graph(-G) # Show a flat list of revisions instead of a graph + --template(-T): text # Render each revision using the given template + --patch(-p) # Show patch + --count # Print the number of commits instead of showing them + --help(-h) # Print help + --summary(-s) # For each path, show only whether it was modified, added, or deleted + --stat # Show a histogram of the changes + --types # For each path, show only its type before and after + --name-only # For each path, show only its path + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space # Ignore whitespace when comparing lines + --ignore-space-change # Ignore changes in amount of whitespace when comparing lines + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--reversed --count] + at-most-one [--no-graph --count] + at-most-one [--template --count] + at-most-one [--patch --count] + at-most-one [--count --summary --stat --types --name-only] + at-most-one [--count --git --color-words] + at-most-one [--count --tool] + at-most-one [--count --ignore-all-space --ignore-space-change] +} # Modify the metadata of a revision without changing its content -export extern "jj metaedit" [ - ...revsets: string@revsets # the revision(s) to modify - --update-change-id # generate a new change-id - --message(-m): string # update the change description - --update-author-timestamp # update the author timestamp - --update-author # update the author to the configured user - --author: string # set author to the provided string - --author-timestamp: string # set the author timestamp to the given date - --force-rewrite # rewrite the commit, even if no other metadata changed - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Create a new, empty change -export extern "jj new" [ - ...revsets: string@revsets # parent(s) of the new change - --message(-m): string # the change description to use - --no-edit # do not edit the newly created change - --insert-after(-A): string@revsets # insert the new change after the given commits - --after: string@revsets # insert the new change after the given commits - --insert-before(-B): string@revsets # insert the new change before the given commits - --before: string@revsets # insert the new change before the given commits - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj metaedit] [ + ...revsets: by "nu-complete jj revisions" # The revision(s) to modify (default: @) [aliases: -r] + --update-change-id # Generate a new change-id + --message(-m): text # Update the change description + --update-author-timestamp # Update the author timestamp + --update-author # Update the author to the configured user + --author: text # Set author to the provided string + --author-timestamp: text # Set the author date to the given date + --force-rewrite # Rewrite the commit, even if no other metadata changed + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Create a new, empty change and (by default) edit it in the working copy +export complete [jj new] [ + ...revsets: by "nu-complete jj revisions" # Parent(s) of the new change [default: @] [aliases: -o, -r] + --message(-m): text # The change description to use + --no-edit # Do not edit the newly created change + --insert-after(-A): by "nu-complete jj revisions" # Insert the new change after the given commit(s) [alias: --after] + --after: by "nu-complete jj revisions" # Alias of --insert-after + --insert-before(-B): by "nu-complete jj revisions" # Insert the new change before the given commit(s) [alias: --before] + --before: by "nu-complete jj revisions" # Alias of --insert-before + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Move the working-copy commit to the child revision -export extern "jj next" [ - offset?: int # how many revisions to move forward - --edit(-e) # edit the target instead of creating a new working copy commit - --no-edit(-e) # create a new working copy commit - --conflict # jump to the next conflicted descendant - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj next] [ + offset?: text # How many revisions to move forward. Advances to the next child by default [default: 1] + --edit(-e) # Instead of creating a new working-copy commit on top of the target commit (like `jj new`), edit the target... + --no-edit(-n) # The inverse of `--edit` + --conflict # Jump to the next conflicted descendant + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--edit --no-edit] +} + +# Commands for working with the operation log +export complete [jj operation] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Commands for working with the operation log +export complete [jj op] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Abandon operation history -export extern "jj operation abandon" [ - operation: string@operations # the operation to abandon - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj operation abandon] [ + operation: by "nu-complete jj operations" # The operation or operation range to abandon + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] +# Abandon operation history +export complete [jj op abandon] [ + operation: by "nu-complete jj operations" # The operation or operation range to abandon + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Compare changes to the repository between two operations +export complete [jj operation diff] [ + --operation: by "nu-complete jj operations" # Show repository changes in this operation, compared to its parent [alias: --op] + --from(-f): by "nu-complete jj operations" # Show repository changes from this operation + --to(-t): by "nu-complete jj operations" # Show repository changes to this operation + --no-graph(-G) # Show a flat list of modified changes instead of a graph + --patch(-p) # Show patch of modifications to changes + --help(-h) # Print help + --summary(-s) # For each path, show only whether it was modified, added, or deleted + --stat # Show a histogram of the changes + --types # For each path, show only its type before and after + --name-only # For each path, show only its path + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space # Ignore whitespace when comparing lines + --ignore-space-change # Ignore changes in amount of whitespace when comparing lines + --show-changes-in: text # Show only changed revisions matching the given revset expression + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--operation --from] + at-most-one [--operation --to] + at-most-one [--summary --stat --types --name-only] + at-most-one [--git --color-words] + at-most-one [--ignore-all-space --ignore-space-change] +} + # Compare changes to the repository between two operations -export extern "jj operation diff" [ - --operation: string@operations # show repository changes in this operation - --from(-f): string@operations # show repository changes from this operation - --to(-t): string@operations # show repository changes to this operation - --no-graph(-G) # do not show the graph - --patch(-p) # show patch of modifications to changes - --summary(-s) # show only whether each path was modified, added, or deleted - --stat # show a histogram of the changes - --types # for each path, show only its type before and after - --name-only # for each path, show only its path - --git # show a Git-format diff - --color-words # show a word-level diff with changes indicated only by color - --tool: path # generate diff by external command - --context: int # number of lines of context to show - --ignore-all-space # ignore whitespace when comparing lines - --ignore-space-change # ignore changes in amount of whitespace when comparing lines - --show-changes-in: string@revsets # only show changes in these revisions - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj op diff] [ + --operation: by "nu-complete jj operations" # Show repository changes in this operation, compared to its parent [alias: --op] + --from(-f): by "nu-complete jj operations" # Show repository changes from this operation + --to(-t): by "nu-complete jj operations" # Show repository changes to this operation + --no-graph(-G) # Show a flat list of modified changes instead of a graph + --patch(-p) # Show patch of modifications to changes + --help(-h) # Print help + --summary(-s) # For each path, show only whether it was modified, added, or deleted + --stat # Show a histogram of the changes + --types # For each path, show only its type before and after + --name-only # For each path, show only its path + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space # Ignore whitespace when comparing lines + --ignore-space-change # Ignore changes in amount of whitespace when comparing lines + --show-changes-in: text # Show only changed revisions matching the given revset expression + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--operation --from] + at-most-one [--operation --to] + at-most-one [--summary --stat --types --name-only] + at-most-one [--git --color-words] + at-most-one [--ignore-all-space --ignore-space-change] +} + +# Make an operation part of the operation log +export complete [jj operation integrate] [ + operation: by "nu-complete jj operations" # The operation to integrate + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Make an operation part of the operation log -export extern "jj opreation integrate" [ - opreation: string # the operation to integrate - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj op integrate] [ + operation: by "nu-complete jj operations" # The operation to integrate + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Show the operation log -export extern "jj operation log" [ - --limit(-n): int # limit the number of operations to show - --reversed # show operations in the opposite order - --no-graph(-G) # do not show the graph - --template(-T): string # render each operation using the given template - --op-diff(-d) # show changes to the repository at each operation - --patch(-p) # show patch of modifications to changes - --summary(-s) # show only whether each path was modified, added, or deleted - --stat # show a histogram of the changes - --types # for each path, show only its type before and after - --name-only # for each path, show only its path - --git # show a Git-format diff - --color-words # show a word-level diff with changes indicated only by color - --tool: path # generate diff by external command - --context: int # number of lines of context to show - --ignore-all-space # ignore whitespace when comparing lines - --ignore-space-change # ignore changes in amount of whitespace when comparing lines - --show-changes-in: string@revsets # only show operations in these revisions - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj operation log] [ + --limit(-n): text # Limit number of operations to show + --reversed # Show operations in the opposite order (older operations first) + --no-graph(-G) # Show a flat list of operations instead of a graph + --template(-T): text # Render each operation using the given template + --op-diff(-d) # Show changes to the repository at each operation + --patch(-p) # Show patch of modifications to changes (implies --op-diff) + --help(-h) # Print help + --summary(-s) # For each path, show only whether it was modified, added, or deleted + --stat # Show a histogram of the changes + --types # For each path, show only its type before and after + --name-only # For each path, show only its path + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space # Ignore whitespace when comparing lines + --ignore-space-change # Ignore changes in amount of whitespace when comparing lines + --show-changes-in: text # Show only changed revisions matching the given revset expression + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--summary --stat --types --name-only] + at-most-one [--git --color-words] + at-most-one [--ignore-all-space --ignore-space-change] +} + +# Show the operation log +export complete [jj op log] [ + --limit(-n): text # Limit number of operations to show + --reversed # Show operations in the opposite order (older operations first) + --no-graph(-G) # Show a flat list of operations instead of a graph + --template(-T): text # Render each operation using the given template + --op-diff(-d) # Show changes to the repository at each operation + --patch(-p) # Show patch of modifications to changes (implies --op-diff) + --help(-h) # Print help + --summary(-s) # For each path, show only whether it was modified, added, or deleted + --stat # Show a histogram of the changes + --types # For each path, show only its type before and after + --name-only # For each path, show only its path + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space # Ignore whitespace when comparing lines + --ignore-space-change # Ignore changes in amount of whitespace when comparing lines + --show-changes-in: text # Show only changed revisions matching the given revset expression + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--summary --stat --types --name-only] + at-most-one [--git --color-words] + at-most-one [--ignore-all-space --ignore-space-change] +} + +# Create a new operation that restores the repo to an earlier state +export complete [jj operation restore] [ + operation: by "nu-complete jj operations" # The operation to restore to + --what: words [repo remote-tracking] # What portions of the local state to restore (can be repeated) [default: repo remote-tracking] + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Create a new operation that restores the repo to an earlier state -export extern "jj operation restore" [ - operation: string@operations # the operation to restore to - --what: string@restore-options # what portions of the local state to restore - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj op restore] [ + operation: by "nu-complete jj operations" # The operation to restore to + --what: words [repo remote-tracking] # What portions of the local state to restore (can be repeated) [default: repo remote-tracking] + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Create a new operation that reverts an earlier operation -export extern "jj operation revert" [ - operation?: string@operations # the operation to revert - --what: string@restore-options # what portions of the local state to revert - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj operation revert] [ + operation?: by "nu-complete jj operations" # The operation to revert [default: @] + --what: words [repo remote-tracking] # What portions of the local state to restore (can be repeated) [default: repo remote-tracking] + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] -# Show changes to the repository in an operation -export extern "jj operation show" [ - operation: string@operations # show repository changes in this operation - --no-graph(-G) # do not show the graph - --template(-T): string # render the operation using the given template - --patch(-p) # show patch of modifications to changes - --no-op-diff # do not show operation diff - --summary(-s) # show only whether each path was modified, added, or deleted - --stat # show a histogram of the changes - --types # for each path, show only its type before and after - --name-only # for each path, show only its path - --git # show a Git-format diff - --color-words # show a word-level diff with changes indicated only by color - --tool: path # generate diff by external command - --context: path # number of lines of context to show - --ignore-all-space # ignore whitespace when comparing lines - --ignore-space-change # ignore changes in amount of whitespace when comparing lines - --show-changes-in: string@revsets # only show changes in these revisions - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +# Create a new operation that reverts an earlier operation +export complete [jj op revert] [ + operation?: by "nu-complete jj operations" # The operation to revert [default: @] + --what: words [repo remote-tracking] # What portions of the local state to restore (can be repeated) [default: repo remote-tracking] + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] +# Show changes to the repository in an operation +export complete [jj operation show] [ + operation?: by "nu-complete jj operations" # Show repository changes in this operation, compared to its parent(s) [default: @] + --no-graph(-G) # Show a flat list of modified changes instead of a graph + --template(-T): text # Render the operation using the given template + --patch(-p) # Show patch of modifications to changes + --no-op-diff # Do not show operation diff + --help(-h) # Print help + --summary(-s) # For each path, show only whether it was modified, added, or deleted + --stat # Show a histogram of the changes + --types # For each path, show only its type before and after + --name-only # For each path, show only its path + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space # Ignore whitespace when comparing lines + --ignore-space-change # Ignore changes in amount of whitespace when comparing lines + --show-changes-in: text # Show only changed revisions matching the given revset expression + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--patch --no-op-diff] + at-most-one [--no-op-diff --summary --stat --types --name-only] + at-most-one [--no-op-diff --git --color-words] + at-most-one [--no-op-diff --tool] + at-most-one [--no-op-diff --ignore-all-space --ignore-space-change] +} + +# Show changes to the repository in an operation +export complete [jj op show] [ + operation?: by "nu-complete jj operations" # Show repository changes in this operation, compared to its parent(s) [default: @] + --no-graph(-G) # Show a flat list of modified changes instead of a graph + --template(-T): text # Render the operation using the given template + --patch(-p) # Show patch of modifications to changes + --no-op-diff # Do not show operation diff + --help(-h) # Print help + --summary(-s) # For each path, show only whether it was modified, added, or deleted + --stat # Show a histogram of the changes + --types # For each path, show only its type before and after + --name-only # For each path, show only its path + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space # Ignore whitespace when comparing lines + --ignore-space-change # Ignore changes in amount of whitespace when comparing lines + --show-changes-in: text # Show only changed revisions matching the given revset expression + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--patch --no-op-diff] + at-most-one [--no-op-diff --summary --stat --types --name-only] + at-most-one [--no-op-diff --git --color-words] + at-most-one [--no-op-diff --tool] + at-most-one [--no-op-diff --ignore-all-space --ignore-space-change] +} + # Parallelize revisions by making them siblings -export extern "jj parallelize" [ - ...revesets: string@revsets # revisions to parallelize - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Move the working-copy commit to the parent revision -export extern "jj prev" [ - offset?: int # how many revisions to move backward - --edit(-e) # edit the target instead of creating a new working copy commit - --no-edit(-e) # create a new working copy commit - --conflict # jump to the next conflicted ancestor - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj parallelize] [ + ...revsets: by "nu-complete jj revisions" # The revisions to parallelize [aliases: -r] + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Change the working copy revision relative to the parent revision +export complete [jj prev] [ + offset?: text # How many revisions to move backward. Moves to the parent by default [default: 1] + --edit(-e) # Edit the parent directly, instead of moving the working-copy commit + --no-edit(-n) # The inverse of `--edit` + --conflict # Jump to the previous conflicted ancestor + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--edit --no-edit] +} # Move revisions to different parent(s) -export extern "jj rebase" [ - --branch(-b): string@revsets # rebase the whole branch relative to destination - --source(-s): string@revsets # rebase specified revisions with their descendants - --revisions(-r): string@revsets # rebase only the given revisions - --onto(-o): string@revsets # the revisions to rebase onto - --insert-after(-A): string@revsets # the revision(s) to insert after - --after: string@revsets # the revision(s) to insert after - --insert-before(-B): string@revsets # the revision(s) to insert before - --before: string@revsets # the revision(s) to insert before - --skip-emptied # abandon empty commits - --keep-divergent # keep divergent commits - --simplify-parents # simplify parents of rebased commits - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj rebase] [ + --branch(-b): by "nu-complete jj revisions" # Rebase the whole branch relative to destination's ancestors (can be repeated) + --source(-s): by "nu-complete jj revisions" # Rebase specified revision(s) together with their trees of descendants (can be repeated) + --revision(-r): by "nu-complete jj revisions" # Rebase the given revisions, rebasing descendants onto this revision's parent(s) + --revisions: by "nu-complete jj revisions" # Alias of --revision + --onto(-o): by "nu-complete jj revisions" # The revision(s) to rebase onto (can be repeated to create a merge commit) [aliases: -d, --destination] + --destination(-d): by "nu-complete jj revisions" # Alias of --onto + --insert-after(-A): by "nu-complete jj revisions" # The revision(s) to insert after (can be repeated to create a merge commit) [alias: --after] + --after: by "nu-complete jj revisions" # Alias of --insert-after + --insert-before(-B): by "nu-complete jj revisions" # The revision(s) to insert before (can be repeated to create a merge commit) [alias: --before] + --before: by "nu-complete jj revisions" # Alias of --insert-before + --skip-emptied # If true, when rebasing would produce an empty commit, the commit is abandoned. It will not be abandoned if... + --keep-divergent # Keep divergent commits while rebasing + --simplify-parents # Simplify parents of rebased commits, like `jj simplify-parents`, while rebasing them. Any parents that are... + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--branch --source --revision] + at-most-one [--onto --insert-after] + at-most-one [--onto --insert-before] + at-most-one [--destination --insert-after] + at-most-one [--destination --insert-before] +} # Redo the most recently undone operation -export extern "jj redo" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj redo] [ + --allow-cross-workspace # Allow redoing an undo-operation that was performed in another workspace + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Resolve conflicted files with an external merge tool -export extern "jj resolve" [ - ...filesets: path # only resolve conflicts in these paths - --revision(-r): string@revsets # revision the conflicts of to resolve - --list(-l) # instead of resolving conflicts, list all the conflicts - --tool: path # the 3-way merge tool to be used - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj resolve] [ + ...filesets: by "nu-complete jj files" # Only resolve conflicts in these paths. You can use the `--list` argument to find paths to use here + --revision(-r): by "nu-complete jj revisions" # [default: @] + --list(-l) # Instead of resolving conflicts, list all the conflicts + --tool: text # Specify 3-way merge tool to be used + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--list --tool] +} # Restore paths from another revision -export extern "jj restore" [ - ...filesets: path # restore only these paths - --from(-f): string@revsets # revision to restore from - --into(-t): string@revsets # revision to restore into - --to: string@revsets # revision to restore into - --changes-in(-c): string@revsets # undo the changes in a revision - --interactive(-i) # interactively choose which parts to restore - --tool: path # specify diff editor to be used - --restore-descendants # preserve the content when rebasing descendants - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj restore] [ + ...filesets: by "nu-complete jj changed-files" # Restore only these paths (instead of all paths) + --from(-f): by "nu-complete jj revisions" # Revision to restore from (source) + --into(-t): by "nu-complete jj revisions" # Revision to restore into (destination) [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --into + --changes-in(-c): by "nu-complete jj revisions" # Undo the changes in a revision as compared to the merge of its parents + --interactive(-i) # Interactively choose which parts to restore + --tool: text # Specify diff editor to be used (implies --interactive) + --restore-descendants # Preserve the content (not the diff) when rebasing descendants + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--from --changes-in] + at-most-one [--into --changes-in] +} # Apply the reverse of the given revision(s) -export extern "jj revert" [ - --revisions(-r): string@revsets # the revision(s) to apply the reverse of - --onto(-o): string@revsets # the revision(s) to apply the reverse on top of - --insert-after(-A): string@revsets # the revision(s) to insert the reverse changes after - --after: string@revsets # the revision(s) to insert the reverse changes after - --insert-before(-B): string@revsets # the revision(s) to insert the reverse changes before - --before: string@revsets # the revision(s) to insert the reverse changes before - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj revert] [ + --revision(-r): by "nu-complete jj revisions" # The revision(s) to apply the reverse of + --revisions: by "nu-complete jj revisions" # Alias of --revision + --onto(-o): by "nu-complete jj revisions" # The revision(s) to apply the reverse changes on top of [aliases: -d, --destination] + --insert-after(-A): by "nu-complete jj revisions" # The revision(s) to insert the reverse changes after (can be repeated to create a merge commit) [alias: --after] + --after: by "nu-complete jj revisions" # Alias of --insert-after + --insert-before(-B): by "nu-complete jj revisions" # The revision(s) to insert the reverse changes before (can be repeated to create a merge commit) [alias: --before] + --before: by "nu-complete jj revisions" # Alias of --insert-before + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--onto --insert-after] + at-most-one [--onto --insert-before] +} # Show the current workspace root directory (shortcut for `jj workspace root`) -export extern "jj root" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj root] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Run a command across a set of revisions. -export extern "jj run" [ - command: string # command to run accros all selected revisions - ...args: string # arguments to pass to the command - --revision(-r): string@revsets # the revisions to change - --job(-j): int # how mnay porcesses should run in parallel - --root # run the command from the working-copy root - --clean # delete each working copy before running the command - --restore-descendants # preserve the content when rebasing descendants - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Show commit description and changes in a revision -export extern "jj show" [ - revset: string@revsets # show changes in this revision - --reversed # show revisions in the opposite order - --template(-T): string # render a revision using the given template - --summary(-s) # for each path, show only whether it was modified, added, or deleted - --stat # show a histogram of the changes - --types # for each path, show only its type before and after - --name-only # for each path, show only its path - --git # show a Git-format diff - --color-words # show a word-level diff with changes indicated by color - --tool: path # generate diff by external command - --context: int # number of lines of context to show - --no-patch # do not show the patch - --ignore-all-space(-w) # ignore whitespace when comparing lines - --ignore-space-change(-b) # ignore changes in amount of whitespace when comparing lines - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj run] [ + command: command # Command to run across all selected revisions + ...args: fallback # Arguments to pass to the command + --revision(-r): by "nu-complete jj revisions" # The revisions to change + --revisions: by "nu-complete jj revisions" # Alias of --revision + --jobs(-j): text # How many processes should run in parallel + --root # Run the command from the working-copy root in each commit instead of from the subdirectory `jj run` was inv... + --clean # Delete each working copy before running the command + --restore-descendants # Preserve the content (not the diff) when rebasing descendants + --passthrough # Pass through stdout and stderr directly to the terminal + --ignore-changes # Run the command without rewriting any commits + --ignore-errors # Continue with remaining revisions when a command's exit code indicates failure + --sparse-patterns: words [copy full empty] # How to handle sparse patterns when running the command. This is controlled per `jj run` invocation [default... + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--restore-descendants --ignore-changes] +} + +# Show revision metadata and diff +export complete [jj show] [ + ...revsets: by "nu-complete jj revisions" # Show changes in these revisions, compared to their parent(s) [default: @] [aliases: -r] + --reversed # Show revisions in the opposite order (older revisions first) + --template(-T): text # Render each revision using the given template + --help(-h) # Print help + --summary(-s) # For each path, show only whether it was modified, added, or deleted + --stat # Show a histogram of the changes + --types # For each path, show only its type before and after + --name-only # For each path, show only its path + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace when comparing lines + --no-patch # Do not show the patch + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--summary --stat --types --name-only --no-patch] + at-most-one [--git --color-words --no-patch] + at-most-one [--tool --no-patch] + at-most-one [--ignore-all-space --ignore-space-change --no-patch] +} # Cryptographically sign a revision -export extern "jj sign" [ - --revisions(-r): string@revsets # the revision(s) to sign - --key: string # the key to use for signing - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj sign] [ + --revision(-r): by "nu-complete jj revisions" # What revision(s) to sign + --revisions: by "nu-complete jj revisions" # Alias of --revision + --key: path # The key used for signing + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Simplify parent edges for the specified revision(s) -export extern "jj simplify-parents" [ - --source(-s): string@revsets # revisions to be simplified together with their descendants - --revisions(-r): string@revsets # revisions to be simplified - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj simplify-parents] [ + --source(-s): by "nu-complete jj revisions" # Simplify specified revision(s) together with their trees of descendants (can be repeated) + --revision(-r): by "nu-complete jj revisions" # Simplify specified revision(s) (can be repeated) + --revisions: by "nu-complete jj revisions" # Alias of --revision + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Manage which paths from the working-copy commit are present in the working copy +export complete [jj sparse] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Start an editor to update the patterns that are present in the working copy -export extern "jj sparse edit" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj sparse edit] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # List the patterns that are currently present in the working copy -export extern "jj sparse list" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj sparse list] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Reset the patterns to include all files in the working copy -export extern "jj sparse reset" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Update the patterns that are present in the working cop -export extern "jj sparse set" [ - --add: path # patterns to add to the working copy - --remove: path # patterns to remove from the working copy - --clear # include no files in the working copy - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj sparse reset] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Update the patterns that are present in the working copy +export complete [jj sparse set] [ + --add: text # Patterns to add to the working copy + --remove: text # Patterns to remove from the working copy + --clear # Include no files in the working copy (combine with --add) + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--remove --clear] +} # Split a revision in two -export extern "jj split" [ - ...filesets: path@modified-files # files to put in the selected changes - --interactive(-i) # interactively choose which parts to split - --tool: path # the edito to be used - --revision(-r): string@revsets # the revision to spli - --onto(-o): string@revsets # the revision(s) to base the new revision onto - --insert-after(-A): string@revsets # the revision(s) to insert after - --after: string@revsets # the revision(s) to insert after - --insert-before(-B): string@revsets # the revision(s) to insert before - --before: string@revsets # the revision(s) to insert before - --message(-m): string # the change description to use - --editor # open an editor to edit the change description - --parallel(-p) # split the revision into two parallel revisions - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj split] [ + ...filesets: by "nu-complete jj changed-files" # Files matching any of these filesets are put in the selected changes + --interactive(-i) # Interactively choose which parts to split + --tool: text # Specify diff editor to be used (implies --interactive) + --revision(-r): by "nu-complete jj revisions" # The revision to split [default: @] + --onto(-o): by "nu-complete jj revisions" # The revision(s) to rebase the selected changes onto (can be repeated to create a merge commit) [aliases: -d... + --insert-after(-A): by "nu-complete jj revisions" # The revision(s) to insert after (can be repeated to create a merge commit) [alias: --after] + --after: by "nu-complete jj revisions" # Alias of --insert-after + --insert-before(-B): by "nu-complete jj revisions" # The revision(s) to insert before (can be repeated to create a merge commit) [alias: --before] + --before: by "nu-complete jj revisions" # Alias of --insert-before + --message(-m): text # The change description to use for the selected changes (don't open editor) + --editor # Open an editor to edit the change description(s) + --parallel(-p) # Split the revision into two parallel revisions instead of a parent and child + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--onto --insert-after --parallel] + at-most-one [--onto --insert-before --parallel] +} # Move changes from a revision into another revision -export extern "jj squash" [ - ...filesets: path # move only changes to these paths - --revision(-r): string@revsets # revision to squash into its parent - --from(-f): string@revsets # revision(s) to squash from - --into(-t): string@revsets # revision to squash into - --to: string@revsets # revision to squash into - --onto(-o): string@revsets # the revision(s) to use as parent for the new commit - --insert-after(-A): string@revsets # the revision(s) to insert the new commit after - --after: string@revsets # the revision(s) to insert the new commit after - --insert-before(-B): string@revsets # the revision(s) to insert the new commit before - --before: string@revsets # the revision(s) to insert the new commit before - --message(-m): string # the description to use for squashed revision - --use-destination-message(-u) # use the description of the destination revision - --editor # open an editor to edit the change description - --interactive(-i) # interactively choose which parts to squash - --tool: path # specify diff editor to be used - --keep-emptied(-k) # the source revision will not be andandoned - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# Show high-level repo status -export extern "jj status" [ - ...filesets: path # restrict the status display to these paths - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj squash] [ + ...filesets: by "nu-complete jj changed-files" # Move only changes to these paths (instead of all paths) + --revision(-r): by "nu-complete jj revisions" # Revision to squash into its parent (default: @). Incompatible with the experimental `-o`/`-A`/`-B` options + --from(-f): by "nu-complete jj revisions" # Revision(s) to squash from (default: @) + --into(-t): by "nu-complete jj revisions" # Revision to squash into (default: @) [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --into + --onto(-o): by "nu-complete jj revisions" # (Experimental) The revision(s) to use as parent for the new commit (can be repeated to create a merge commit) [aliases: -d, --destination] + --insert-after(-A): by "nu-complete jj revisions" # (Experimental) The revision(s) to insert the new commit after (can be repeated to create a merge commit) [alias: --after] + --after: by "nu-complete jj revisions" # Alias of --insert-after + --insert-before(-B): by "nu-complete jj revisions" # (Experimental) The revision(s) to insert the new commit before (can be repeated to create a merge commit) [alias: --before] + --before: by "nu-complete jj revisions" # Alias of --insert-before + --message(-m): text # The description to use for squashed revision (don't open editor) + --use-destination-message(-u) # Use the description of the destination revision and discard the description(s) of the source revision(s) + --editor # Open an editor to edit the change description + --interactive(-i) # Interactively choose which parts to squash + --tool: text # Specify diff editor to be used (implies --interactive) + --keep-emptied(-k) # The source revision will not be abandoned + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--revision --from] + at-most-one [--revision --into --onto --insert-after] + at-most-one [--revision --into --onto --insert-before] + at-most-one [--message --use-destination-message] +} + +# Show high-level repo status [default alias: st] +export complete [jj status] [ + ...filesets: by "nu-complete jj changed-files" # Restrict the status display to these paths + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Show high-level repo status [default alias: st] +export complete [jj st] [ + ...filesets: by "nu-complete jj changed-files" # Restrict the status display to these paths + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Manage tags +export complete [jj tag] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Delete existing tags -export extern "jj tag delete" [ - ...names: string@tags # tag names to delete - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] - -# List tags -export extern "jj tag list" [ - ...names: string # show tags whose local name matches - --all-remotes(-a) # show tags from all remotes - --conflicted(-c) # only show conflicted tags - --revision(-r): string@revsets # show tags in these revisions - --template(-T): string # render each tag using the given template - --sort: string@tags-sort # sort tags based on the given key - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj tag delete] [ + ...names: by "nu-complete jj tags" # Tag names to delete + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# List tags and their targets +export complete [jj tag list] [ + ...names: by "nu-complete jj tags" # Show tags whose local name matches + --all-remotes(-a) # Show all tracked and untracked remote tags including the ones whose targets are synchronized with the local... + --remote: by "nu-complete jj remotes" # Show all tracked and untracked remote tags belonging to this remote + --tracked(-t) # Show tracked remote tags only + --conflicted(-c) # Show conflicted tags only + --revision(-r): by "nu-complete jj revisions" # Show tags whose local targets are in the given revisions + --revisions: by "nu-complete jj revisions" # Alias of --revision + --template(-T): text # Render each tag using the given template + --sort: words [name name- author-name author-name- author-email author-email- author-date author-date- committer-name committer-name- committer-email committer-email- committer-date committer-date-] # Sort tags based on the given key (or multiple keys) + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--all-remotes --remote] + at-most-one [--all-remotes --tracked] + at-most-one [--all-remotes --conflicted] +} # Create or update tags -export extern "jj tag set" [ - ...names: string # tag names to create or update - --revision(-r): string@revsets # target revision to point to - --allow-move # allow moving existing tags - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj tag set] [ + ...names: by "nu-complete jj tags" # Tag names to create or update + --revision(-r): by "nu-complete jj revisions" # Target revision to point to [default: @] [alias: --to] + --to: by "nu-complete jj revisions" # Alias of --revision + --allow-move # Allow moving existing tags + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Start tracking given remote tags +export complete [jj tag track] [ + ...tag: by "nu-complete jj tags" # Tag name patterns or remote tag symbols to track + --remote: by "nu-complete jj remotes" # Remote names to track + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Stop tracking given remote tags +export complete [jj tag untrack] [ + ...tag: by "nu-complete jj tags" # Tag name patterns or remote tag symbols to untrack + --remote: by "nu-complete jj remotes" # Remote names to untrack + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Undo the last operation -export extern "jj undo" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj undo] [ + --allow-cross-workspace # Allow undoing an operation that was performed in another workspace + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Drop a cryptographic signature -export extern "jj unsign" [ - --revisions(-r): string@revsets # the revision(s) to unsign - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj unsign] [ + --revision(-r): by "nu-complete jj revisions" # What revision(s) to unsign + --revisions: by "nu-complete jj revisions" # Alias of --revision + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Infrequently used commands such as for generating shell completions +export complete [jj util] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Commands relating to the backend used in the current repo +export complete [jj util backend] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Print the name of the backend used in the current repo -export extern "jj util backend name" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj util backend name] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Print a command-line-completion script -export extern "jj util completion" [ - shell: string@shells # shell to print completion for - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj util completion] [ + shell: words [bash elvish fish nushell power-shell zsh] # + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Print the JSON schema for the jj TOML config format -export extern "jj util config-schema" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj util config-schema] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Compare two files on disk +export complete [jj util diff] [ + path1: path # First path to compare + path2: path # Second path to compare + --help(-h) # Print help + --git # Show a Git-format diff + --color-words # Show a word-level diff with changes indicated only by color + --tool: text # Generate diff by external command + --context: text # Number of lines of context to show + --ignore-all-space(-w) # Ignore whitespace when comparing lines + --ignore-space-change(-b) # Ignore changes in amount of whitespace when comparing lines + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--git --color-words] + at-most-one [--ignore-all-space --ignore-space-change] +} # Execute an external command via jj -export extern "jj util exec" [ - command: path # external command to execute - ...args # arguments to pass to the external command - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj util exec] [ + command: command # External command to execute + ...args: fallback # Arguments to pass to the external command + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Run backend-dependent garbage collection -export extern "jj util gc" [ - --expire: string # time threshold - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj util gc] [ + --expire: text # Time threshold + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Install Jujutsu's manpages to the provided path -export extern "jj util install-man-pages" [ - path: path # the path where manpages will be installed - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj util install-man-pages] [ + path: dir # The path where manpages will installed. An example path might be `/usr/share/man`. The provided path will b... + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] -# Snapshot the working copy if needed -export extern "jj util snapshot" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +# Print the CLI help for all subcommands in Markdown +export complete [jj util markdown-help] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] -# Print the CLI help for all subcommands in Markdown -export extern "jj util markdown-help" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +# Snapshot the working copy if needed +export complete [jj util snapshot] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Display version information -export extern "jj version" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj version] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Commands for working with workspaces +export complete [jj workspace] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Add a workspace -export extern "jj workspace add" [ - destination: path # where to create the new workspace - --name: string # a name for the workspace - --revision(-r): string@revsets # a list of parent revisions for the created workspace - --message(-m): string # the change description to use - --sparse-patterns: string@sparse-patterns # how to handle sparse patterns when creating a new workspace - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file -] +export complete [jj workspace add] [ + destination: dir # Where to create the new workspace + --name: text # A name for the workspace + --revision(-r): by "nu-complete jj revisions" # A list of parent revisions for the working-copy commit of the newly created workspace. You may specify noth... + --revisions: by "nu-complete jj revisions" # Alias of --revision + --message(-m): text # The change description to use + --colocate # Create a corresponding Git worktree for this workspace + --no-colocate # Do not create a Git worktree for this workspace + --sparse-patterns: words [copy full empty] # How to handle sparse patterns when creating a new workspace [default: copy] + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] where { + at-most-one [--colocate --no-colocate] +} # Stop tracking a workspace's working-copy commit in the repo -export extern "jj workspace forget" [ - ...workspaces: string@workspaces # names of the workspaces to forget - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj workspace forget] [ + ...workspaces: by "nu-complete jj workspaces" # Names of the workspaces to forget. By default, forgets only the current workspace + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # List workspaces -export extern "jj workspace list" [ - --template(-T): string # render each workspace using the given template - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj workspace list] [ + --template(-T): text # Render each workspace using the given template + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Remove a workspace and its working-copy files from disk +export complete [jj workspace remove] [ + ...workspaces: by "nu-complete jj workspaces" # Names of the workspaces to remove + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Renames the current workspace -export extern "jj workspace rename" [ - new_name: string # the new name of the workspace - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj workspace rename] [ + new-workspace-name: text # The name of the workspace to update to + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Show the workspace root directory -export extern "jj workspace root" [ - --name: string # name of the workspace - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj workspace root] [ + --name: by "nu-complete jj workspaces" # Name of the workspace (defaults to current) + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] # Update a workspace that has become stale -export extern "jj workspace update-stale" [ - --help # print help - -h # print help summary - --repository(-R): path # repository to operate on - --ignore-working-copy # do not snapshot the working copy - --no-integrate-operation # do not integrate any operations - --ignore-immutable # allow rewriting immutable commits - --at-operation: string@operations # operation to load the repo at - --debug # enable debug logging - --color: string@color-when # when to colorize output - --quiet # silence non-primary command output - --no-pager # disable the pager - --config: string # additional configuration options - --config-file: path # additional configuration file +export complete [jj workspace update-stale] [ + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) +] + +# Print this message or the help of the given subcommand(s) +export complete [jj help] [ + ...command: by "nu-complete jj commands" # Print help for the subcommand(s) + --keyword(-k): words [bookmarks config filesets glossary revsets templates tutorial] # Show help for keywords instead of commands + --help(-h) # Print help + --repository(-R): dir # Path to repository to operate on + --ignore-working-copy # Don't snapshot the working copy, and don't update it + --no-integrate-operation # Run the command as usual but don't integrate any operations + --ignore-immutable # Allow rewriting immutable commits + --at-operation: by "nu-complete jj operations" # Operation to load the repo at [alias: --at-op] + --debug # Enable debug logging + --color: words [always never debug auto] # When to colorize output + --quiet # Silence non-primary command output + --no-pager # Disable the pager + --config: text # Additional configuration options (can be repeated) + --config-file: path # Additional configuration files (can be repeated) ] diff --git a/custom-completions/just/just-completions.nu b/custom-completions/just/just-completions.nu index 3d2dcd268..fff4be100 100644 --- a/custom-completions/just/just-completions.nu +++ b/custom-completions/just/just-completions.nu @@ -1,205 +1,172 @@ +# just — a handy way to save and run project-specific commands. +# Declarative completions (`export complete`), verified against `just --help` (just 1.58). -# official completion from `just --completion nushell` -def get-recipes [] { - let just_dumps = generate { |just_json| - if not $just_json.settings.fallback { - return {out: $just_json} - } - let justfile_dir = $just_json.source | path dirname - if $justfile_dir == ($justfile_dir | path dirname) { - # at file system root - return {out: $just_json} - } - let next_dump_result = do { - cd ($justfile_dir | path dirname) - (^just --unstable --dump --dump-format json | complete) - } - if $next_dump_result.exit_code == 0 { - {out: $just_json, next: ($next_dump_result.stdout | from json)} - } else { - {out: $just_json} - } - } (^just --unstable --dump --dump-format json | from json) - $just_dumps | each { get-recipes-for-just-dump $in } | flatten | uniq-by recipe -} - -def get-recipes-for-just-dump [just_json: record] { - [ - ...( - $just_json.recipes - | transpose recipe data - | flatten - ) - ...( - $just_json.modules - | transpose "module" data - | flatten - | select "module" recipes - | each {|row| - $row.recipes | items {|k, v| - { - recipe: ($"($row.module)::($k)" | str replace --regex '::default$' '') - ...$v - } - }} - | flatten - ) - ] - | where {|recipe| not $recipe.private } - | sort-by recipe -} - -def "nu-complete just" [] { - let completions = ( - get-recipes - | select recipe doc parameters - | each {|recipe| - let name = $recipe.recipe - mut desc = $recipe.doc | default " " - for $p in $recipe.parameters { - if ($p.default | is-empty) { - $desc += $" [(ansi blue)($p.name)(ansi reset)]" - } else { - $desc += $" [(ansi blue)($p.name)='($p.default)'(ansi reset)]" - } - } - { value: $name description: ($desc | str trim) } - } - ) - { - options: { sort: false } - completions: $completions +# The public recipes of the justfile (honouring `--justfile`), including those of the parent +# justfiles it falls back to and of its modules. Reads only: `just --dump` runs nothing. +def get-recipes [justfile?: string] { + let flags = if ($justfile | is-empty) { [] } else { ['--justfile' $justfile] } + generate {|just_json| + let justfile_dir = $just_json.source | path dirname + # Stop unless the justfile falls back to its parent directory's one. + if not $just_json.settings.fallback or $justfile_dir == ($justfile_dir | path dirname) { + return {out: $just_json} } -} - -def "nu-complete args" [context:string,offset:int] { - let r = ($context | split row ' ') - let name = $r.1 - # First two are 'just' and name, minus one because `get-just-args` is zero-indexed - let position = ($r | length) - 3 - - get-just-arg $name $position -} - -# Provides argument of recipe $name at position $positions. -def get-just-arg [name:string,position:int] { - let recipes = ( - get-recipes - | where {|r| $r.name == $name } - | get parameters - | flatten) - let len = $recipes | length - if $position > ($recipes | length) { - [[value description]; ["" "No more args"]] + let parent = do { cd ($justfile_dir | path dirname); ^just --unstable --dump --dump-format json | complete } + if $parent.exit_code == 0 { + {out: $just_json, next: ($parent.stdout | from json)} } else { - $recipes - | get $position - | each {|recipe| - let name = $recipe.name - if not ($recipe.default | is-empty) { - [[value description]; - [$recipe.default $"'($name)' (ansi green)\(default\)(ansi reset)"] - ["" $name]] - } else { - # Need two empty different values - # Otherwise they get filtered and empty value gets inserted automatically - [[value description]; - [null $"'($name)'"] - [' ' $"'($name)'"]] - } - } + {out: $just_json} } + } (^just --unstable ...$flags --dump --dump-format json | from json) + | each {|dump| + let module_recipes = $dump.modules | items {|module, data| + $data.recipes | items {|name, recipe| + {recipe: ($"($module)::($name)" | str replace --regex '::default$' ''), ...$recipe} + } + } | flatten + [...($dump.recipes | transpose recipe data | flatten) ...$module_recipes] + } + | flatten + | where {|recipe| not $recipe.private } + | uniq-by recipe + | sort-by recipe } -# Variables and Assignments are apparently the same thing... -def "nu-complete just assignments" [] { - ^just --dump --dump-format json - | from json - | get assignments - | transpose name value - | each {|x| { - value: $x.name, - description: $"Current value: '($x.value.value)'" - }} +# `[name='default']` for each parameter of a recipe. +def format-parameters []: list<record> -> string { + each {|p| if ($p.default | is-empty) { $"[($p.name)]" } else { $"[($p.name)='($p.default)']" } } | str join ' ' } -# Just: A Command Runner. A handy way to save and run project-specific commands. -export extern "just" [ - recipe?:string@"nu-complete just" # Recipe to execute - --changelog # Print changelog - --check # Run `--fmt` in 'check' mode. Exits with 0 if justfile is formatted correctly. Exits with 1 and prints a diff if formatting is required. - --choose # Select one or more recipes to run using a binary chooser. If `--chooser` is not passed the chooser defaults to the value of $JUST_CHOOSER, falling back to `fzf` - --clear-shell-args # Clear shell arguments - --dry-run(-n) # Print what just would do without doing it - --dump # Print justfile - --edit(-e) # Edit justfile with editor given by $VISUAL or $EDITOR, falling back to `vim` - --evaluate # Evaluate and print all variables. If a variable name is given as an argument, only print that variable's value. - --explain # Print recipe doc comment before running it - --fmt # Format and overwrite justfile - --global-justfile(-g) # Use global justfile - --groups # List recipe groups - --highlight # Highlight echoed recipe lines in bold - --init # Initialize new justfile in project root - --list(-l) # List available recipes and their arguments - --man # Print man page - --no-aliases # Don't show aliases in list - --no-deps # Don't run recipe dependencies - --no-dotenv # Don't load `.env` file - --no-highlight # Don't highlight echoed recipe lines in bold - --one # Forbid multiple recipes from being invoked on the command line - --quiet(-q) # Suppress all output - --shell-command # Invoke <COMMAND> with the shell used to run recipe lines and backticks - --summary # List names of available recipes - --tempdir:glob # Save temporary files to <TEMPDIR>. - --timestamp # Print recipe command timestamps - --timestamp-format:string # Timestamp format string - --unsorted(-u) # Return list and summary entries in source order - --unstable # Enable unstable features - --variables # List names of variables - --verbose(-v) # Use verbose output - --yes # Automatically confirm all recipes. - --help(-h) # Print help information - --version(-V) # Print version information - - --alias-style:string@"nu-complete just al-st" # Set list command alias display style - --chooser:string # Override binary invoked by `--choose` - --color:string@"nu-complete just color-when" # Print colorful output [default: auto] [possible values: auto, always, never] - --command(-c):string # Run an arbitrary command with the working directory, `.env`, overrides, and exports set - --command-color:string@"nu-complete just color" # Echo recipe lines in <COMMAND-COLOR> [possible values: black, blue, cyan, green, purple, red, yellow] - --completions:string@"nu-complete just shells" # Print shell completion script for <SHELL> [possible values: zsh, bash, fish, powershell, elvish, nushell] - --dotenv-filename:glob # Search for environment file named <DOTENV-FILENAME> instead of `.env` - --dotenv-path(-E):glob # Load <DOTENV-PATH> as environment file instead of searching for one - --dump-format:string@"nu-complete just format" # Dump justfile as <FORMAT> [default: just] [possible values: just, json] - --justfile(-f):glob # Use <JUSTFILE> as justfile - --list-heading:string # Print <TEXT> before list - --list-prefix:string # Print <TEXT> before each list item - --list-submodules # List recipes in submodules - --set:string@"nu-complete just assignments" # Override <VARIABLE> with <VALUE> - --shell:string@"nu-complete just shells" # Invoke <SHELL> to run recipes - --shell-arg:string # Invoke shell with <SHELL-ARG> as an argument - --show(-s):string@"nu-complete just" # Show information about <RECIPE> - --working-directory(-d):glob # Use <WORKING-DIRECTORY> as working directory. --justfile must also be set -] +# The recipes of the justfile, one row each: `name`, its `doc` comment and the names of its +# `parameters`. Reads only. +@non-destructive +export def just-recipes []: nothing -> table<name: string, doc: string, parameters: list<string>> { + try { + get-recipes | each {|recipe| {name: $recipe.recipe, doc: ($recipe.doc? | default ''), parameters: ($recipe.parameters | get name)} } + } catch { [] } +} -def "nu-complete just al-st" [] { - [ "left", "right", "separate" ] +# Recipes, with their doc comment and parameters. Falls back to `just --summary`. +@non-destructive +export def "nu-complete just" [justfile?: string] { + try { + get-recipes $justfile | each {|recipe| + {value: $recipe.recipe, description: ($"($recipe.doc | default '') ($recipe.parameters | format-parameters)" | str trim)} + } + } catch { + try { ^just --summary | split row ' ' | where $it != '' } catch { [] } + } } -def "nu-complete just format" [] { - [ "just", "json" ] +# The default values of the parameters of the recipe being run. +@non-destructive +export def "nu-complete just args" [recipe?: string] { + try { + get-recipes + | where recipe == $recipe + | get 0.parameters + | where {|p| $p.default | is-not-empty } + | each {|p| {value: $"($p.default)", description: $"($p.name) \(default)"} } + } catch { [] } } -# Shells as listed in `--completions` -def "nu-complete just shells" [] { - [ "zsh", "bash", "fish", "powershell", "elvish", "nushell" ] +# Variables of the justfile, for `--set`. Variables and assignments are the same thing. +@non-destructive +export def "nu-complete just assignments" [justfile?: string] { + let flags = if ($justfile | is-empty) { [] } else { ['--justfile' $justfile] } + try { + ^just ...$flags --dump --dump-format json + | from json + | get assignments + | transpose name value + | each {|x| {value: $x.name, description: $"Current value: '($x.value.value)'"} } + } catch { [] } } -# Color outputs as listed in `--color` -def "nu-complete just color-when" [] { - [ "auto", "always", "never" ] +# Recipe groups (`[group('x')]` attributes), for `--group`. +@non-destructive +export def "nu-complete just groups" [justfile?: string] { + let flags = if ($justfile | is-empty) { [] } else { ['--justfile' $justfile] } + try { ^just ...$flags --groups --list-heading '' --list-prefix '' | lines | str trim | where $it != '' } catch { [] } } -# Colors as listed in `--command-color` -def "nu-complete just color" [] { - [ "black", "blue", "cyan", "green", "purple", "red", "yellow" ] +export complete [just] [ + recipe?: by "nu-complete just" [justfile: --justfile] # Recipe to execute + ...args: by "nu-complete just args" [recipe: recipe] # Arguments of the recipe + --justfile(-f): path # Use <JUSTFILE> as justfile + --working-directory(-d): dir cwd # Use <WORKING-DIRECTORY> as working directory. --justfile must also be set + --justfile-name: text # Look for justfiles named <NAME> + --ceiling: dir # Don't search above <CEILING> for justfiles + --global-justfile(-g) # Use global justfile + --color: words [auto always never] # Print colorful output + --command-color: words [black blue cyan green purple red yellow] # Echo recipe lines in <COMMAND-COLOR> + --alias-style: words [left right separate] # Set list command alias display style + --allow-missing # Ignore missing recipe and module errors + --check # Run `--fmt` in 'check' mode + --chooser: text # Override binary invoked by `--choose` + --clear-shell-args # Clear shell arguments + --complete-aliases # Complete aliases + --cygpath: path # Use binary at <CYGPATH> to convert between unix and Windows paths + --default-list # List recipes when no recipe is given + --dotenv-command: text # Run <COMMAND> to load environment + --dotenv-filename(-F): text # Search for environment file named <DOTENV-FILENAME> + --dotenv-path(-E): path # Load <DOTENV-PATH> as environment file + --dry-run(-n) # Print what just would do without doing it + --dump-format: words [just json] # Dump justfile as <FORMAT> + --evaluate-format: words [just shell] # Evaluate variables as <FORMAT> + --explain # Print recipe doc comment before running it + --group: by "nu-complete just groups" [justfile: --justfile] # Only list recipes in <GROUP> + --highlight # Highlight echoed recipe lines in bold + --no-highlight # Don't highlight echoed recipe lines in bold + --indentation: text # Indent `--fmt` output with <INDENTATION> + --jobs: text # Run up to <N> recipes in parallel + --list-heading: text # Print <TEXT> before list + --list-prefix: text # Print <TEXT> before each list item + --list-submodules # List recipes in submodules + --no-aliases # Don't show aliases in list + --no-cache # Don't use the recipe cache + --no-deps # Don't run recipe dependencies + --no-dotenv # Don't load `.env` file + --one # Forbid multiple recipes from being invoked on the command line + --quiet(-q) # Suppress all output + --verbose(-v) # Use verbose output + --set: by "nu-complete just assignments" [justfile: --justfile] # Override <VARIABLE> with <VALUE> + --shell: text # Invoke <SHELL> to run recipes + --shell-arg: text # Invoke shell with <SHELL-ARG> as an argument + --shell-command # Invoke <COMMAND> with the shell used to run recipe lines + --tempdir: dir # Save temporary files to <TEMPDIR> + --time # Print recipe execution time + --timestamp # Print recipe command timestamps + --timestamp-format: text # Timestamp format string + --unsorted(-u) # Return list and summary entries in source order + --unstable # Enable unstable features + --yes # Automatically confirm all recipes + --changelog # Print changelog + --choose # Select one or more recipes to run using a binary chooser + --clean # Clear recipe cache + --command(-c): text # Run an arbitrary command with the working directory, `.env`, overrides, and exports set + --completions: words [bash elvish fish nushell powershell zsh] # Print shell completion script for <SHELL> + --dump # Print justfile + --edit(-e) # Edit justfile with $VISUAL or $EDITOR + --evaluate # Evaluate and print all variables + --fmt # Format and overwrite justfile + --groups # List recipe groups + --init # Initialize new justfile in project root + --json # Print justfile as JSON + --list(-l) # List available recipes + --man # Print man page + --show(-s): by "nu-complete just" [justfile: --justfile] # Show recipe at <RECIPE_PATH> + --summary # List names of available recipes + --usage: by "nu-complete just" [justfile: --justfile] # Print usage information for recipe + --variables # List names of variables + --help(-h) # Print help + --version(-V) # Print version +] where { + requires --working-directory --justfile + excludes --global-justfile --justfile + at-most-one [--verbose --quiet] + overrides [--highlight --no-highlight] + requires --check --fmt + at-most-one [--changelog --choose --clean --command --completions --dump --edit --evaluate --fmt --groups --init --json --list --man --show --summary --usage --variables] + terminal [--help --version --changelog --man --completions --init --summary --variables] } diff --git a/custom-completions/komorebi/komorebi-completions.nu b/custom-completions/komorebi/komorebi-completions.nu index 4693f27b1..18c2a03b8 100644 --- a/custom-completions/komorebi/komorebi-completions.nu +++ b/custom-completions/komorebi/komorebi-completions.nu @@ -1,175 +1,391 @@ -def 'nu-complete komorebic commands' [] { - [[value description]; - [quickstart 'Gather example configurations for a new-user quickstart'] - [start 'Start komorebi.exe as a background process'] - [stop 'Stop the komorebi.exe process and restore all hidden windows'] - [check 'Check komorebi configuration and related files for common errors'] - [configuration 'Show the path to komorebi.json'] - [bar-configuration 'Show the path to komorebi.bar.json'] - [whkdrc 'Show the path to whkdrc'] - [state 'Show a JSON representation of the current window manager state'] - [global-state 'Show a JSON representation of the current global state'] - [gui 'Launch the komorebi-gui debugging tool'] - [visible-windows 'Show a JSON representation of visible windows'] - [monitor-information 'Show information about connected monitors'] - [query 'Query the current window manager state'] - [subscribe-socket 'Subscribe to komorebi events using a Unix Domain Socket'] - [unsubscribe-socket 'Unsubscribe from komorebi events'] - [subscribe-pipe 'Subscribe to komorebi events using a Named Pipe'] - [unsubscribe-pipe 'Unsubscribe from komorebi events'] - [log "Tail komorebi.exe's process logs (cancel with Ctrl-C)"] - [quick-save-resize 'Quicksave the current resize layout dimensions'] - [quick-load-resize 'Load the last quicksaved resize layout dimensions'] - [save-resize 'Save the current resize layout dimensions to a file'] - [load-resize 'Load the resize layout dimensions from a file'] - [focus 'Change focus to the window in the specified direction'] - [move 'Move the focused window in the specified direction'] - [minimize 'Minimize the focused window'] - [close 'Close the focused window'] - [force-focus 'Forcibly focus the window at the cursor with a left mouse click'] - [cycle-focus 'Change focus to the window in the specified cycle direction'] - [cycle-move 'Move the focused window in the specified cycle direction'] - [stack 'Stack the focused window in the specified direction'] - [unstack 'Unstack the focused window'] - [cycle-stack 'Cycle the focused stack in the specified cycle direction'] - [focus-stack-window 'Focus the specified window index in the focused stack'] - [stack-all 'Stack all windows on the focused workspace'] - [unstack-all 'Unstack all windows in the focused container'] - [resize-edge 'Resize the focused window in the specified direction'] - [resize-axis 'Resize the focused window or primary column along the specified axis'] - [move-to-monitor 'Move the focused window to the specified monitor'] - [cycle-move-to-monitor 'Move the focused window to the monitor in the given cycle direction'] - [move-to-workspace 'Move the focused window to the specified workspace'] - [move-to-named-workspace 'Move the focused window to the specified workspace'] - [cycle-move-to-workspace 'Move the focused window to the workspace in the given cycle direction'] - [send-to-monitor 'Send the focused window to the specified monitor'] - [cycle-send-to-monitor 'Send the focused window to the monitor in the given cycle direction'] - [send-to-workspace 'Send the focused window to the specified workspace'] - [send-to-named-workspace 'Send the focused window to the specified workspace'] - [cycle-send-to-workspace 'Send the focused window to the workspace in the given cycle direction'] - [send-to-monitor-workspace 'Send the focused window to the specified monitor workspace'] - [move-to-monitor-workspace 'Move the focused window to the specified monitor workspace'] - [focus-monitor 'Focus the specified monitor'] - [focus-last-workspace 'Focus the last focused workspace on the focused monitor'] - [focus-workspace 'Focus the specified workspace on the focused monitor'] - [focus-workspaces 'Focus the specified workspace on all monitors'] - [focus-monitor-workspace 'Focus the specified workspace on the target monitor'] - [focus-named-workspace 'Focus the specified workspace'] - [cycle-monitor 'Focus the monitor in the given cycle direction'] - [cycle-workspace 'Focus the workspace in the given cycle direction'] - [move-workspace-to-monitor 'Move the focused workspace to the specified monitor'] - [cycle-move-workspace-to-monitor 'Move the focused workspace monitor in the given cycle direction'] - [swap-workspaces-with-monitor 'Swap focused monitor workspaces with specified monitor'] - [new-workspace 'Create and append a new workspace on the focused monitor'] - [resize-delta 'Set the resize delta (used by resize-edge and resize-axis)'] - [invisible-borders 'Set the invisible border dimensions around each window'] - [global-work-area-offset 'Set offsets to exclude parts of the work area from tiling'] - [monitor-work-area-offset 'Set offsets for a monitor to exclude parts of the work area from tiling'] - [focused-workspace-container-padding 'Set container padding on the focused workspace'] - [focused-workspace-padding 'Set workspace padding on the focused workspace'] - [adjust-container-padding 'Adjust container padding on the focused workspace'] - [adjust-workspace-padding 'Adjust workspace padding on the focused workspace'] - [change-layout 'Set the layout on the focused workspace'] - [cycle-layout 'Cycle between available layouts'] - [flip-layout 'Flip the layout on the focused workspace (BSP only)'] - [promote 'Promote the focused window to the top of the tree'] - [promote-focus 'Promote the user focus to the top of the tree'] - [promote-window 'Promote the window in the specified direction'] - [retile 'Force the retiling of all managed windows'] - [monitor-index-preference 'Set the monitor index preference for a monitor identified using its size'] - [display-index-preference 'Set the display index preference for a monitor identified using its display name'] - [ensure-workspaces 'Create at least this many workspaces for the specified monitor'] - [ensure-named-workspaces 'Create these many named workspaces for the specified monitor'] - [container-padding 'Set the container padding for the specified workspace'] - [named-workspace-container-padding 'Set the container padding for the specified workspace'] - [workspace-padding 'Set the workspace padding for the specified workspace'] - [named-workspace-padding 'Set the workspace padding for the specified workspace'] - [workspace-layout 'Set the layout for the specified workspace'] - [named-workspace-layout 'Set the layout for the specified workspace'] - [workspace-layout-rule 'Add a dynamic layout rule for the specified workspace'] - [named-workspace-layout-rule 'Add a dynamic layout rule for the specified workspace'] - [clear-workspace-layout-rules 'Clear all dynamic layout rules for the specified workspace'] - [clear-named-workspace-layout-rules 'Clear all dynamic layout rules for the specified workspace'] - [workspace-tiling 'Enable or disable window tiling for the specified workspace'] - [named-workspace-tiling 'Enable or disable window tiling for the specified workspace'] - [workspace-name 'Set the workspace name for the specified workspace'] - [toggle-window-container-behaviour 'Toggle the behaviour for new windows (stacking or dynamic tiling)'] - [toggle-float-override 'Enable or disable float override, which makes it so every new window opens in floating mode'] - [toggle-workspace-window-container-behavior 'Toggle the behaviour for new windows (stacking or dynamic tiling) for currently focused workspace. If there was no behaviour set for the workspace previously it takes the opposite of the global value'] - [toggle-workspace-float-override 'Enable or disable float override, which makes it so every new window opens in floating mode, for the currently focused workspace. If there was no override value set for the workspace previously it takes the opposite of the global value'] - [toggle-pause 'Toggle window tiling on the focused workspace'] - [toggle-tiling 'Toggle window tiling on the focused workspace'] - [toggle-float 'Toggle floating mode for the focused window'] - [toggle-monocle 'Toggle monocle mode for the focused container'] - [toggle-maximize 'Toggle native maximization for the focused window'] - [restore-windows 'Restore all hidden windows (debugging command)'] - [manage 'Force komorebi to manage the focused window'] - [unmanage 'Unmanage a window that was forcibly managed'] - [replace-configuration 'Replace the configuration of a running instance of komorebi from a static configuration file'] - [reload-configuration 'Reload legacy komorebi.ahk or komorebi.ps1 configurations (if they exist)'] - [watch-configuration 'Enable or disable watching of legacy komorebi.ahk or komorebi.ps1 configurations (if they exist)'] - [complete-configuration 'For legacy komorebi.ahk or komorebi.ps1 configurations, signal that the final configuration option has been sent'] - [window-hiding-behaviour 'Set the window behaviour when switching workspaces / cycling stacks'] - [cross-monitor-move-behaviour 'Set the behaviour when moving windows across monitor boundaries'] - [toggle-cross-monitor-move-behaviour 'Toggle the behaviour when moving windows across monitor boundaries'] - [unmanaged-window-operation-behaviour 'Set the operation behaviour when the focused window is not managed'] - [ignore-rule 'Add a rule to ignore the specified application'] - [manage-rule 'Add a rule to always manage the specified application'] - [initial-workspace-rule 'Add a rule to associate an application with a workspace on first show'] - [initial-named-workspace-rule 'Add a rule to associate an application with a named workspace on first show'] - [workspace-rule 'Add a rule to associate an application with a workspace'] - [named-workspace-rule 'Add a rule to associate an application with a named workspace'] - [clear-workspace-rules 'Remove all application association rules for a workspace by monitor and workspace index'] - [clear-named-workspace-rules 'Remove all application association rules for a named workspace'] - [clear-all-workspace-rules 'Remove all application association rules for all workspaces'] - [identify-object-name-change-application 'Identify an application that sends EVENT_OBJECT_NAMECHANGE on launch'] - [identify-tray-application 'Identify an application that closes to the system tray'] - [identify-layered-application 'Identify an application that has WS_EX_LAYERED, but should still be managed'] - [remove-title-bar 'Whitelist an application for title bar removal'] - [toggle-title-bars 'Toggle title bars for whitelisted applications'] - [border 'Enable or disable borders'] - [border-colour 'Set the colour for a window border kind'] - [border-width 'Set the border width'] - [border-offset 'Set the border offset'] - [border-style 'Set the border style'] - [border-implementation 'Set the border implementation'] - [transparency 'Enable or disable transparency for unfocused windows'] - [transparency-alpha 'Set the alpha value for unfocused window transparency'] - [toggle-transparency 'Toggle transparency for unfocused windows'] - [animation 'Enable or disable movement animations'] - [animation-duration 'Set the duration for movement animations in ms'] - [animation-fps 'Set the frames per second for movement animations'] - [animation-style 'Set the ease function for movement animations'] - [mouse-follows-focus 'Enable or disable mouse follows focus on all workspaces'] - [toggle-mouse-follows-focus 'Toggle mouse follows focus on all workspaces'] - [ahk-app-specific-configuration 'Generate common app-specific configurations and fixes to use in komorebi.ahk'] - [pwsh-app-specific-configuration 'Generate common app-specific configurations and fixes in a PowerShell script'] - [convert-app-specific-configuration 'Convert a v1 ASC YAML file to a v2 ASC JSON file'] - [fetch-app-specific-configuration 'Fetch the latest version of applications.json from komorebi-application-specific-configuration'] - [application-specific-configuration-schema 'Generate a JSON Schema for applications.json'] - [notification-schema 'Generate a JSON Schema of subscription notifications'] - [socket-schema 'Generate a JSON Schema of socket messages'] - [static-config-schema 'Generate a JSON Schema of the static configuration file'] - [generate-static-config 'Generates a static configuration JSON file based on the current window manager state'] - [enable-autostart 'Generates the komorebi.lnk shortcut in tartup to autostart komorebi'] - [disable-autostart 'Deletes the komorebi.lnk shortcut in tartup to disable autostart'] - [help 'Print this message or the help of the given subcommand(s)'] - ] +# Declarative completions for komorebi, a tiling window manager for Windows. + +# komorebic subcommands, with their descriptions. +@non-destructive +export def "nu-complete komorebic commands" []: nothing -> list<record<value: string, description: string>> { + try { + [ + {value: quickstart, description: "Gather example configurations for a new-user quickstart"} + {value: start, description: "Start komorebi.exe as a background process"} + {value: stop, description: "Stop the komorebi.exe process and restore all hidden windows"} + {value: check, description: "Check komorebi configuration and related files for common errors"} + {value: configuration, description: "Show the path to komorebi.json"} + {value: bar-configuration, description: "Show the path to komorebi.bar.json"} + {value: whkdrc, description: "Show the path to whkdrc"} + {value: state, description: "Show a JSON representation of the current window manager state"} + {value: global-state, description: "Show a JSON representation of the current global state"} + {value: gui, description: "Launch the komorebi-gui debugging tool"} + {value: visible-windows, description: "Show a JSON representation of visible windows"} + {value: monitor-information, description: "Show information about connected monitors"} + {value: query, description: "Query the current window manager state"} + {value: subscribe-socket, description: "Subscribe to komorebi events using a Unix Domain Socket"} + {value: unsubscribe-socket, description: "Unsubscribe from komorebi events"} + {value: subscribe-pipe, description: "Subscribe to komorebi events using a Named Pipe"} + {value: unsubscribe-pipe, description: "Unsubscribe from komorebi events"} + {value: log, description: "Tail komorebi.exe's process logs (cancel with Ctrl-C)"} + {value: quick-save-resize, description: "Quicksave the current resize layout dimensions"} + {value: quick-load-resize, description: "Load the last quicksaved resize layout dimensions"} + {value: save-resize, description: "Save the current resize layout dimensions to a file"} + {value: load-resize, description: "Load the resize layout dimensions from a file"} + {value: focus, description: "Change focus to the window in the specified direction"} + {value: move, description: "Move the focused window in the specified direction"} + {value: minimize, description: "Minimize the focused window"} + {value: close, description: "Close the focused window"} + {value: force-focus, description: "Forcibly focus the window at the cursor with a left mouse click"} + {value: cycle-focus, description: "Change focus to the window in the specified cycle direction"} + {value: cycle-move, description: "Move the focused window in the specified cycle direction"} + {value: stack, description: "Stack the focused window in the specified direction"} + {value: unstack, description: "Unstack the focused window"} + {value: cycle-stack, description: "Cycle the focused stack in the specified cycle direction"} + {value: focus-stack-window, description: "Focus the specified window index in the focused stack"} + {value: stack-all, description: "Stack all windows on the focused workspace"} + {value: unstack-all, description: "Unstack all windows in the focused container"} + {value: resize-edge, description: "Resize the focused window in the specified direction"} + {value: resize-axis, description: "Resize the focused window or primary column along the specified axis"} + {value: move-to-monitor, description: "Move the focused window to the specified monitor"} + {value: cycle-move-to-monitor, description: "Move the focused window to the monitor in the given cycle direction"} + {value: move-to-workspace, description: "Move the focused window to the specified workspace"} + {value: move-to-named-workspace, description: "Move the focused window to the specified workspace"} + {value: cycle-move-to-workspace, description: "Move the focused window to the workspace in the given cycle direction"} + {value: send-to-monitor, description: "Send the focused window to the specified monitor"} + {value: cycle-send-to-monitor, description: "Send the focused window to the monitor in the given cycle direction"} + {value: send-to-workspace, description: "Send the focused window to the specified workspace"} + {value: send-to-named-workspace, description: "Send the focused window to the specified workspace"} + {value: cycle-send-to-workspace, description: "Send the focused window to the workspace in the given cycle direction"} + {value: send-to-monitor-workspace, description: "Send the focused window to the specified monitor workspace"} + {value: move-to-monitor-workspace, description: "Move the focused window to the specified monitor workspace"} + {value: focus-monitor, description: "Focus the specified monitor"} + {value: focus-last-workspace, description: "Focus the last focused workspace on the focused monitor"} + {value: focus-workspace, description: "Focus the specified workspace on the focused monitor"} + {value: focus-workspaces, description: "Focus the specified workspace on all monitors"} + {value: focus-monitor-workspace, description: "Focus the specified workspace on the target monitor"} + {value: focus-named-workspace, description: "Focus the specified workspace"} + {value: cycle-monitor, description: "Focus the monitor in the given cycle direction"} + {value: cycle-workspace, description: "Focus the workspace in the given cycle direction"} + {value: move-workspace-to-monitor, description: "Move the focused workspace to the specified monitor"} + {value: cycle-move-workspace-to-monitor, description: "Move the focused workspace monitor in the given cycle direction"} + {value: swap-workspaces-with-monitor, description: "Swap focused monitor workspaces with specified monitor"} + {value: new-workspace, description: "Create and append a new workspace on the focused monitor"} + {value: resize-delta, description: "Set the resize delta (used by resize-edge and resize-axis)"} + {value: invisible-borders, description: "Set the invisible border dimensions around each window"} + {value: global-work-area-offset, description: "Set offsets to exclude parts of the work area from tiling"} + {value: monitor-work-area-offset, description: "Set offsets for a monitor to exclude parts of the work area from tiling"} + {value: focused-workspace-container-padding, description: "Set container padding on the focused workspace"} + {value: focused-workspace-padding, description: "Set workspace padding on the focused workspace"} + {value: adjust-container-padding, description: "Adjust container padding on the focused workspace"} + {value: adjust-workspace-padding, description: "Adjust workspace padding on the focused workspace"} + {value: change-layout, description: "Set the layout on the focused workspace"} + {value: cycle-layout, description: "Cycle between available layouts"} + {value: flip-layout, description: "Flip the layout on the focused workspace (BSP only)"} + {value: promote, description: "Promote the focused window to the top of the tree"} + {value: promote-focus, description: "Promote the user focus to the top of the tree"} + {value: promote-window, description: "Promote the window in the specified direction"} + {value: retile, description: "Force the retiling of all managed windows"} + {value: monitor-index-preference, description: "Set the monitor index preference for a monitor identified using its size"} + {value: display-index-preference, description: "Set the display index preference for a monitor identified using its display name"} + {value: ensure-workspaces, description: "Create at least this many workspaces for the specified monitor"} + {value: ensure-named-workspaces, description: "Create these many named workspaces for the specified monitor"} + {value: container-padding, description: "Set the container padding for the specified workspace"} + {value: named-workspace-container-padding, description: "Set the container padding for the specified workspace"} + {value: workspace-padding, description: "Set the workspace padding for the specified workspace"} + {value: named-workspace-padding, description: "Set the workspace padding for the specified workspace"} + {value: workspace-layout, description: "Set the layout for the specified workspace"} + {value: named-workspace-layout, description: "Set the layout for the specified workspace"} + {value: workspace-layout-rule, description: "Add a dynamic layout rule for the specified workspace"} + {value: named-workspace-layout-rule, description: "Add a dynamic layout rule for the specified workspace"} + {value: clear-workspace-layout-rules, description: "Clear all dynamic layout rules for the specified workspace"} + {value: clear-named-workspace-layout-rules, description: "Clear all dynamic layout rules for the specified workspace"} + {value: workspace-tiling, description: "Enable or disable window tiling for the specified workspace"} + {value: named-workspace-tiling, description: "Enable or disable window tiling for the specified workspace"} + {value: workspace-name, description: "Set the workspace name for the specified workspace"} + {value: toggle-window-container-behaviour, description: "Toggle the behaviour for new windows (stacking or dynamic tiling)"} + {value: toggle-float-override, description: "Toggle float override, so every new window opens floating"} + {value: toggle-workspace-window-container-behavior, description: "Toggle the behaviour for new windows (stacking or dynamic tiling) on the focused workspace"} + {value: toggle-workspace-float-override, description: "Toggle float override, so every new window opens floating, on the focused workspace"} + {value: toggle-pause, description: "Toggle window tiling on the focused workspace"} + {value: toggle-tiling, description: "Toggle window tiling on the focused workspace"} + {value: toggle-float, description: "Toggle floating mode for the focused window"} + {value: toggle-monocle, description: "Toggle monocle mode for the focused container"} + {value: toggle-maximize, description: "Toggle native maximization for the focused window"} + {value: restore-windows, description: "Restore all hidden windows (debugging command)"} + {value: manage, description: "Force komorebi to manage the focused window"} + {value: unmanage, description: "Unmanage a window that was forcibly managed"} + {value: replace-configuration, description: "Replace the configuration of a running instance of komorebi from a static configuration file"} + {value: reload-configuration, description: "Reload legacy komorebi.ahk or komorebi.ps1 configurations (if they exist)"} + {value: watch-configuration, description: "Enable or disable watching of legacy komorebi.ahk or komorebi.ps1 configurations (if they exist)"} + {value: complete-configuration, description: "For legacy komorebi.ahk or komorebi.ps1 configurations, signal that the final configuration option has been sent"} + {value: window-hiding-behaviour, description: "Set the window behaviour when switching workspaces / cycling stacks"} + {value: cross-monitor-move-behaviour, description: "Set the behaviour when moving windows across monitor boundaries"} + {value: toggle-cross-monitor-move-behaviour, description: "Toggle the behaviour when moving windows across monitor boundaries"} + {value: unmanaged-window-operation-behaviour, description: "Set the operation behaviour when the focused window is not managed"} + {value: ignore-rule, description: "Add a rule to ignore the specified application"} + {value: manage-rule, description: "Add a rule to always manage the specified application"} + {value: initial-workspace-rule, description: "Add a rule to associate an application with a workspace on first show"} + {value: initial-named-workspace-rule, description: "Add a rule to associate an application with a named workspace on first show"} + {value: workspace-rule, description: "Add a rule to associate an application with a workspace"} + {value: named-workspace-rule, description: "Add a rule to associate an application with a named workspace"} + {value: clear-workspace-rules, description: "Remove all application association rules for a workspace by monitor and workspace index"} + {value: clear-named-workspace-rules, description: "Remove all application association rules for a named workspace"} + {value: clear-all-workspace-rules, description: "Remove all application association rules for all workspaces"} + {value: identify-object-name-change-application, description: "Identify an application that sends EVENT_OBJECT_NAMECHANGE on launch"} + {value: identify-tray-application, description: "Identify an application that closes to the system tray"} + {value: identify-layered-application, description: "Identify an application that has WS_EX_LAYERED, but should still be managed"} + {value: remove-title-bar, description: "Whitelist an application for title bar removal"} + {value: toggle-title-bars, description: "Toggle title bars for whitelisted applications"} + {value: border, description: "Enable or disable borders"} + {value: border-colour, description: "Set the colour for a window border kind"} + {value: border-width, description: "Set the border width"} + {value: border-offset, description: "Set the border offset"} + {value: border-style, description: "Set the border style"} + {value: border-implementation, description: "Set the border implementation"} + {value: transparency, description: "Enable or disable transparency for unfocused windows"} + {value: transparency-alpha, description: "Set the alpha value for unfocused window transparency"} + {value: toggle-transparency, description: "Toggle transparency for unfocused windows"} + {value: animation, description: "Enable or disable movement animations"} + {value: animation-duration, description: "Set the duration for movement animations in ms"} + {value: animation-fps, description: "Set the frames per second for movement animations"} + {value: animation-style, description: "Set the ease function for movement animations"} + {value: mouse-follows-focus, description: "Enable or disable mouse follows focus on all workspaces"} + {value: toggle-mouse-follows-focus, description: "Toggle mouse follows focus on all workspaces"} + {value: ahk-app-specific-configuration, description: "Generate common app-specific configurations and fixes to use in komorebi.ahk"} + {value: pwsh-app-specific-configuration, description: "Generate common app-specific configurations and fixes in a PowerShell script"} + {value: convert-app-specific-configuration, description: "Convert a v1 ASC YAML file to a v2 ASC JSON file"} + {value: fetch-app-specific-configuration, description: "Fetch the latest version of applications.json from komorebi-application-specific-configuration"} + {value: application-specific-configuration-schema, description: "Generate a JSON Schema for applications.json"} + {value: notification-schema, description: "Generate a JSON Schema of subscription notifications"} + {value: socket-schema, description: "Generate a JSON Schema of socket messages"} + {value: static-config-schema, description: "Generate a JSON Schema of the static configuration file"} + {value: generate-static-config, description: "Generates a static configuration JSON file based on the current window manager state"} + {value: enable-autostart, description: "Generates the komorebi.lnk shortcut in Startup to autostart komorebi"} + {value: disable-autostart, description: "Deletes the komorebi.lnk shortcut in Startup to disable autostart"} + {value: help, description: "Print this message or the help of the given subcommand(s)"} + ] + } catch { + [] + } +} + +export complete [komorebi] [ + --ffm(-f) # Use komorebi's custom focus-follows-mouse implementation + --await-configuration(-a) # Wait for `komorebic complete-configuration` before processing events + --tcp-port(-t): text # Start a TCP server on this port for SocketMessages + --config(-c): path # Path to a static configuration JSON file + --clean-state # Do not attempt to restore the previous window manager state + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help --version] +} + +# The komorebic command-line interface; subcommands with their own options follow. +export complete [komorebic] [ + command?: by "nu-complete komorebic commands" # Subcommand to run + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help --version] +} + +# Start komorebi.exe as a background process. +export complete [komorebic start] [ + --ffm(-f) # Use komorebi's custom focus-follows-mouse implementation + --config(-c): path # Path to a static configuration JSON file + --await-configuration(-a) # Wait for `komorebic complete-configuration` before processing events + --tcp-port(-t): text # Start a TCP server on this port for SocketMessages + --whkd # Start whkd in a background process + --ahk # Start autohotkey configuration file + --bar # Start komorebi-bar in a background process + --masir # Start masir in a background process + --clean-state # Do not attempt to restore the previous window manager state + --help(-h) # Print help +] where { + terminal [--help] +} + +# Stop the komorebi.exe process and restore all hidden windows. +export complete [komorebic stop] [ + --whkd # Also stop whkd if it is running + --ahk # Also stop the AutoHotkey configuration + --bar # Also stop komorebi-bar if it is running + --masir # Also stop masir if it is running + --ignore-restore # Do not restore windows after stopping + --help(-h) # Print help +] where { + terminal [--help] } -export extern komorebi [ -# A tiling window manager for Windows - --ffm (-f) # Allow the use of komorebi's custom focus-follows-mouse implementation - --await-configuration (-a) # Wait for 'komorebic complete-configuration' to be sent before processing events - --tcp-port: int (-t) # Start a TCP server on the given port to allow the direct sending of SocketMessages - --config: string (-c) # Path to a static configuration JSON file - --help (-h) # Print help - --version (-V) # Print version -] - -export extern komorebic [ -# The command-line interface for Komorebi, a tiling window manager for Windows - string?: string@'nu-complete komorebic commands' - --bar # Start komorebi with bar - --whkd # Start komorebic with whkd +# Change focus to the window in the given direction. +export complete [komorebic focus] [ + direction: words [left right up down] # Direction to focus + --help(-h) # Print help +] + +# Move the focused window in the given direction. +export complete [komorebic move] [ + direction: words [left right up down] # Direction to move + --help(-h) # Print help +] + +# Stack the focused window in the given direction. +export complete [komorebic stack] [ + direction: words [left right up down] # Direction to stack + --help(-h) # Print help +] + +# Promote the window in the given direction. +export complete [komorebic promote-window] [ + direction: words [left right up down] # Direction of the window to promote + --help(-h) # Print help +] + +# Change focus to the window in the given cycle direction. +export complete [komorebic cycle-focus] [ + direction: words [previous next] # Cycle direction + --help(-h) # Print help +] + +# Move the focused window in the given cycle direction. +export complete [komorebic cycle-move] [ + direction: words [previous next] # Cycle direction + --help(-h) # Print help +] + +# Cycle the focused stack in the given cycle direction. +export complete [komorebic cycle-stack] [ + direction: words [previous next] # Cycle direction + --help(-h) # Print help +] + +# Focus the monitor in the given cycle direction. +export complete [komorebic cycle-monitor] [ + direction: words [previous next] # Cycle direction + --help(-h) # Print help +] + +# Focus the workspace in the given cycle direction. +export complete [komorebic cycle-workspace] [ + direction: words [previous next] # Cycle direction + --help(-h) # Print help +] + +# Cycle between the available layouts. +export complete [komorebic cycle-layout] [ + direction: words [previous next] # Cycle direction + --help(-h) # Print help +] + +# Resize the focused window in the given direction. +export complete [komorebic resize-edge] [ + edge: words [left right up down] # Edge to resize + sizing: words [increase decrease] # Whether to grow or shrink + --help(-h) # Print help +] + +# Resize the focused window or primary column along an axis. +export complete [komorebic resize-axis] [ + axis: words [horizontal vertical horizontal-and-vertical] # Axis to resize along + sizing: words [increase decrease] # Whether to grow or shrink + --help(-h) # Print help +] + +# Set the layout on the focused workspace. +export complete [komorebic change-layout] [ + layout: words [bsp columns rows vertical-stack horizontal-stack ultrawide-vertical-stack grid right-main-vertical-stack scrolling] # Default layout to use + --help(-h) # Print help +] + +# Flip the layout on the focused workspace (BSP only). +export complete [komorebic flip-layout] [ + axis: words [horizontal vertical horizontal-and-vertical] # Axis to flip on + --help(-h) # Print help +] + +# Query the current window manager state. +export complete [komorebic query] [ + state-query: words [focused-monitor-index focused-workspace-index focused-container-index focused-window-index focused-workspace-name focused-workspace-layout focused-container-kind version] # State to query + --help(-h) # Print help +] + +# Replace the configuration of a running komorebi from a static configuration file. +export complete [komorebic replace-configuration] [ + path: path # Static configuration JSON file + --help(-h) # Print help +] + +# Save the current resize layout dimensions to a file. +export complete [komorebic save-resize] [ + path: path # File to save to + --help(-h) # Print help +] + +# Load the resize layout dimensions from a file. +export complete [komorebic load-resize] [ + path: path # File to load from + --help(-h) # Print help +] + +# Set the window behaviour when switching workspaces or cycling stacks. +export complete [komorebic window-hiding-behaviour] [ + hiding-behaviour: words [hide minimize cloak] # How to hide windows + --help(-h) # Print help +] + +# Set the behaviour when moving windows across monitor boundaries. +export complete [komorebic cross-monitor-move-behaviour] [ + move-behaviour: words [swap insert no-op] # Behaviour across monitors + --help(-h) # Print help +] + +# Set the operation behaviour when the focused window is not managed. +export complete [komorebic unmanaged-window-operation-behaviour] [ + operation-behaviour: words [op no-op] # Process or ignore commands + --help(-h) # Print help +] + +# Enable or disable borders. +export complete [komorebic border] [ + boolean-state: words [enable disable] # Desired state + --help(-h) # Print help +] + +# Set the border style. +export complete [komorebic border-style] [ + style: words [system rounded square] # Border style + --help(-h) # Print help +] + +# Set the border implementation. +export complete [komorebic border-implementation] [ + style: words [komorebi windows] # Border implementation + --help(-h) # Print help +] + +# Enable or disable transparency for unfocused windows. +export complete [komorebic transparency] [ + boolean-state: words [enable disable] # Desired state + --help(-h) # Print help +] + +# Enable or disable movement animations. +export complete [komorebic animation] [ + boolean-state: words [enable disable] # Desired state + --animation-type(-a): words [movement transparency] # Animation type to apply the state to + --help(-h) # Print help +] + +# Enable or disable mouse follows focus on all workspaces. +export complete [komorebic mouse-follows-focus] [ + boolean-state: words [enable disable] # Desired state + --help(-h) # Print help +] + +# Enable or disable watching of legacy configurations. +export complete [komorebic watch-configuration] [ + boolean-state: words [enable disable] # Desired state + --help(-h) # Print help +] + +# Print the help of komorebic or of a subcommand. +export complete [komorebic help] [ + command?: by "nu-complete komorebic commands" # Subcommand to describe ] diff --git a/custom-completions/kubectl/kubectl-completions.nu b/custom-completions/kubectl/kubectl-completions.nu new file mode 100644 index 000000000..95e377844 --- /dev/null +++ b/custom-completions/kubectl/kubectl-completions.nu @@ -0,0 +1,907 @@ +# Declarative completions for kubectl. +# +# Contexts, namespaces, resource types and object names are read live from the cluster with +# read-only `kubectl get`/`config`/`api-resources` calls. Name providers honour an explicit +# `--namespace`/`-n` on the line. Every provider returns `[]` when kubectl is missing, the +# cluster is unreachable or the call fails (completion providers run under a short timeout). +# +# kubectl accepts global flags (`-n`, `--context`, `--kubeconfig`, ...) on every subcommand, +# so each subcommand spec repeats them. `TYPE/NAME` references (`deploy/web`) and +# `kubectl cp` `POD:PATH` operands are parsed with small syntaxes so each part completes. + +# Run a read-only kubectl query and return its output lines, or nothing on any failure. +def kubectl-lines [args: list<string>]: nothing -> list<string> { + try { + let out = ^kubectl ...$args | complete + if $out.exit_code != 0 { return [] } + $out.stdout | lines | where $it != "" + } catch { [] } +} + +# `-n NAMESPACE` arguments when a namespace was given on the line. +def ns-args [namespace?: string]: nothing -> list<string> { + if ($namespace | is-empty) { [] } else { ["--namespace" $namespace] } +} + +# Name/value rows from `kubectl get KIND` with one descriptive column. +def kubectl-named [kind: string, column: string, namespace?: string]: nothing -> list<record<value: string, description: string>> { + kubectl-lines ([get $kind --no-headers -o $"custom-columns=NAME:.metadata.name,INFO:($column)"] ++ (ns-args $namespace)) + | parse -r '^(?<value>\S+)\s+(?<description>.*)$' + | update description {|r| $r.description | str trim } +} + +# Contexts from the active kubeconfig, marking the current one. +@non-destructive +export def "nu-complete kubectl contexts" []: nothing -> list<record<value: string, description: string>> { + try { + let current = kubectl-lines [config current-context] | get 0? | default "" + kubectl-lines [config get-contexts -o name] + | each {|c| { value: $c, description: (if $c == $current { "current context" } else { "context" }) } } + } catch { [] } +} + +# Namespaces with their phase. +@non-destructive +export def "nu-complete kubectl namespaces" []: nothing -> list<record<value: string, description: string>> { + try { kubectl-named namespaces ".status.phase" } catch { [] } +} + +# Resource types served by the cluster, or the common built-in types when it is unreachable. +@non-destructive +export def "nu-complete kubectl resources" []: nothing -> list<record<value: string, description: string>> { + try { + let live = kubectl-lines [api-resources --no-headers -o wide] + | parse -r '^(?<name>\S+)\s+(?:(?<short>[a-z0-9,]+)\s+)?(?<api>\S+)\s+(?<namespaced>true|false)\s+(?<kind>\S+)' + | each {|r| + let scope = if $r.namespaced == "true" { "namespaced" } else { "cluster" } + [{ value: $r.name, description: $"($r.kind) \(($r.api), ($scope))" }] ++ ( + $r.short | default "" | split row "," | where $it != "" | each {|s| { value: $s, description: $"short for ($r.name)" } } + ) + } + | flatten + if ($live | is-not-empty) { return $live } + [ + [value description]; + [pods "Pod"] [deployments "Deployment"] [services "Service"] [configmaps "ConfigMap"] + [secrets "Secret"] [namespaces "Namespace"] [nodes "Node"] [ingresses "Ingress"] + [statefulsets "StatefulSet"] [daemonsets "DaemonSet"] [replicasets "ReplicaSet"] + [jobs "Job"] [cronjobs "CronJob"] [persistentvolumeclaims "PersistentVolumeClaim"] + [persistentvolumes "PersistentVolume"] [serviceaccounts "ServiceAccount"] [events "Event"] + [endpoints "Endpoints"] [roles "Role"] [rolebindings "RoleBinding"] + [clusterroles "ClusterRole"] [clusterrolebindings "ClusterRoleBinding"] + [horizontalpodautoscalers "HorizontalPodAutoscaler"] [networkpolicies "NetworkPolicy"] + [storageclasses "StorageClass"] [customresourcedefinitions "CustomResourceDefinition"] + ] + } catch { [] } +} + +# Names of objects of the resource type given earlier on the line (`get pods <name>`). +@non-destructive +export def "nu-complete kubectl resource-names" [resource?: string]: nothing -> list<string> { + try { + if ($resource | is-empty) or ($resource | str contains "/") { return [] } + kubectl-lines [get $resource -o name] | each {|n| $n | split row "/" | last } + } catch { [] } +} + +# Pods with their phase, in the namespace given with --namespace (or the context default). +@non-destructive +export def "nu-complete kubectl pods" [namespace?: string]: nothing -> list<record<value: string, description: string>> { + try { kubectl-named pods ".status.phase" $namespace } catch { [] } +} + +# Containers of a pod (for `-c`). +@non-destructive +export def "nu-complete kubectl containers" [pod?: string]: nothing -> list<string> { + try { + if ($pod | is-empty) { return [] } + let name = $pod | split row "/" | last + kubectl-lines [get pod $name -o "jsonpath={range .spec.initContainers[*]}{.name}{'\\n'}{end}{range .spec.containers[*]}{.name}{'\\n'}{end}"] + } catch { [] } +} + +# Deployments with ready/desired replica counts. +@non-destructive +export def "nu-complete kubectl deployments" [namespace?: string]: nothing -> list<record<value: string, description: string>> { + try { kubectl-named deployments ".status.readyReplicas" $namespace | update description {|r| $"ready: ($r.description)" } } catch { [] } +} + +# Services with their type. +@non-destructive +export def "nu-complete kubectl services" [namespace?: string]: nothing -> list<record<value: string, description: string>> { + try { kubectl-named services ".spec.type" $namespace } catch { [] } +} + +# Nodes with their kubelet version. +@non-destructive +export def "nu-complete kubectl nodes" []: nothing -> list<record<value: string, description: string>> { + try { kubectl-named nodes ".status.nodeInfo.kubeletVersion" } catch { [] } +} + +# `kubectl rollout` operand: `TYPE/NAME` for the rollout-capable workload types. +export syntax kubectl.rollout-ref over chars { + root = kind: words ["deployment" "deployments" "deploy" "daemonset" "daemonsets" "ds" "statefulset" "statefulsets" "sts"] "/" name: until "/" +} + +# `kubectl port-forward` operand: a pod name, or `TYPE/NAME` for a pod, service or workload. +export syntax kubectl.forward-ref over chars { + root = (kind: words ["pod" "pods" "po" "service" "services" "svc" "deployment" "deploy" "replicaset" "rs" "statefulset" "sts"] "/")? name: until "/" +} + +# A `kubectl cp` operand: `[NAMESPACE/]POD:PATH` on the cluster, or a local path. +export syntax kubectl.cp over chars { + root = (pod: until ":" ":" remote: until ":") | local: until ":" +} + +# `kubectl explain` field paths: `RESOURCE[.FIELD...]`. +export syntax kubectl.field over chars { + root = resource: until "." ("." field: until ".")* +} + +# Root: global flags accepted before any subcommand. +export complete [kubectl] [ + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + --help(-h) # Help for kubectl + --version # Print the client version (deprecated; use `kubectl version`) +] where { + terminal [--help --version] +} + +export complete [kubectl get] [ + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --all-namespaces(-A) # Across all namespaces + --field-selector: text # Field selector, e.g. status.phase=Running + --watch(-w) # Watch for changes after listing + --watch-only # Watch without listing first + --show-labels # Show all labels as the last column + --label-columns(-L): text # Labels to present as columns + --sort-by: text # Sort by a JSONPath expression + --no-headers # Do not print headers + --chunk-size: text # Return large lists in chunks + --ignore-not-found # Treat "not found" as success + --raw: text # Raw URI to request from the server + --subresource: words [status scale] # Subresource to fetch + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + resource?: by "nu-complete kubectl resources" # Resource type (or TYPE/NAME) + ...names: by "nu-complete kubectl resource-names" [resource: resource] # Resource names +] where { + at-most-one [--all-namespaces --namespace] + at-most-one [--filename --kustomize] + at-most-one [--watch --watch-only] + excludes --raw --selector +} + +export complete [kubectl describe] [ + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --all-namespaces(-A) # Across all namespaces + --show-events # Show related events (default true) + --chunk-size: text # Return large lists in chunks + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + resource?: by "nu-complete kubectl resources" # Resource type (or TYPE/NAME) + ...names: by "nu-complete kubectl resource-names" [resource: resource] # Resource names +] where { + at-most-one [--all-namespaces --namespace] + at-most-one [--filename --kustomize] +} + +export complete [kubectl logs] [ + --container(-c): by "nu-complete kubectl containers" [pod: pod] # Container name + --all-containers # Logs of all containers in the pod + --follow(-f) # Stream the logs + --previous(-p) # Logs of the previous terminated container + --since: text # Only logs newer than a duration (5s, 2m, 3h) + --since-time: text # Only logs after an RFC3339 timestamp + --tail: text # Number of recent lines to show + --timestamps # Prefix each line with a timestamp + --prefix # Prefix each line with pod/container name + --limit-bytes: text # Maximum bytes of logs to return + --max-log-requests: text # Max concurrent streams with --selector + --ignore-errors # With --follow, keep going on errors + --pod-running-timeout: text # Wait for at least one running pod + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + pod?: by "nu-complete kubectl pods" [namespace: --namespace] # Pod (or TYPE/NAME, e.g. deploy/web) +] where { + at-most-one [--since --since-time] + at-most-one [--container --all-containers] + at-most-one [--previous --follow] +} + +export complete [kubectl exec] [ + --container(-c): by "nu-complete kubectl containers" [pod: pod] # Container name + --stdin(-i) # Pass stdin to the container + --tty(-t) # Allocate a TTY + --quiet(-q) # Only print output from the remote session + --pod-running-timeout: text # Wait for at least one running pod + --filename(-f): path # File, directory or URL with the manifests + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + pod: by "nu-complete kubectl pods" [namespace: --namespace] # Pod (or TYPE/NAME, e.g. deploy/web) + ...command: command # Command to run after `--` +] + +export complete [kubectl apply] [ + --all # With --prune, select all resources + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --prune # Delete objects not in the applied set + --server-side # Use server-side apply + --force-conflicts # With --server-side, take ownership of conflicts + --field-manager: text # Name of the field manager + --overwrite # Overwrite on annotation differences + --force # Delete and re-create on conflict + --wait # Wait for deleted resources to be gone + --validate: words [strict warn ignore true false] # Schema validation mode + --prune-allowlist: text # GVKs eligible for --prune + --dry-run: words [none: "submit the request" client: "only print what would be sent" server: "submit without persisting"] # Dry-run strategy + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity +] where { + exactly-one [--filename --kustomize] + requires --force-conflicts --server-side +} + +export complete [kubectl create] [ + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --save-config # Record config in an annotation + --edit # Edit the API resource before creating + --validate: words [strict warn ignore true false] # Schema validation mode + --field-manager: text # Name of the field manager + --raw: text # Raw URI to POST to the server + --dry-run: words [none: "submit the request" client: "only print what would be sent" server: "submit without persisting"] # Dry-run strategy + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity +] where { + at-most-one [--filename --kustomize] +} + +export complete [kubectl delete] [ + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --all-namespaces(-A) # Across all namespaces + --all # Delete all resources of the given type + --field-selector: text # Field selector + --force # Immediately remove from the API (with --grace-period=0) + --grace-period: text # Seconds given to terminate gracefully + --now # Signal for immediate shutdown (grace period 1) + --ignore-not-found # Treat "not found" as success + --wait # Wait for resources to be gone + --cascade: words [background foreground orphan] # Dependent deletion strategy + --interactive(-i) # Confirm each deletion + --timeout: text # Time to wait before giving up + --dry-run: words [none: "submit the request" client: "only print what would be sent" server: "submit without persisting"] # Dry-run strategy + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + resource?: by "nu-complete kubectl resources" # Resource type (or TYPE/NAME) + ...names: by "nu-complete kubectl resource-names" [resource: resource] # Resource names +] where { + at-most-one [--filename --kustomize] + at-most-one [--all-namespaces --namespace] + at-most-one [--all --selector] + excludes --now --grace-period +} + +export complete [kubectl edit] [ + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --output-patch # Print the patch if the resource is edited + --windows-line-endings # Use CRLF line endings + --save-config # Record config in an annotation + --subresource: words [status] # Subresource to edit + --validate: words [strict warn ignore true false] # Schema validation mode + --field-manager: text # Name of the field manager + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + resource?: by "nu-complete kubectl resources" # Resource type (or TYPE/NAME) + name?: by "nu-complete kubectl resource-names" [resource: resource] # Resource name +] where { + at-most-one [--filename --kustomize] +} + +export complete [kubectl scale] [ + --replicas: text # New desired number of replicas + --current-replicas: text # Precondition on the current replica count + --resource-version: text # Precondition on the resource version + --all # Scale all resources of the given type + --timeout: text # Wait for the scale to complete + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --dry-run: words [none: "submit the request" client: "only print what would be sent" server: "submit without persisting"] # Dry-run strategy + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + resource?: words [deployment deploy replicaset rs statefulset sts replicationcontroller rc] # Scalable resource type (or TYPE/NAME) + ...names: by "nu-complete kubectl resource-names" [resource: resource] # Resource names +] where { + exactly-one [--replicas] + at-most-one [--all --selector] + at-most-one [--filename --kustomize] +} + +# `rollout` only dispatches; each verb below owns its flags. +export complete [kubectl rollout] [ + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity +] + +export complete [kubectl rollout status] [ + --revision: text # Pin to a revision + --timeout: text # Time to wait before giving up + --watch(-w) # Watch until the rollout finishes (default true) + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + ref: kubectl.rollout-ref with { root.name: by "nu-complete kubectl deployments" } # TYPE/NAME, e.g. deployment/web +] + +export complete [kubectl rollout restart] [ + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --dry-run: words [none: "submit the request" client: "only print what would be sent" server: "submit without persisting"] # Dry-run strategy + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --field-manager: text # Name of the field manager + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + ref: kubectl.rollout-ref with { root.name: by "nu-complete kubectl deployments" } # TYPE/NAME, e.g. deployment/web +] where { + at-most-one [--filename --kustomize] +} + +export complete [kubectl rollout undo] [ + --to-revision: text # Revision to roll back to (0 = previous) + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --dry-run: words [none: "submit the request" client: "only print what would be sent" server: "submit without persisting"] # Dry-run strategy + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + ref: kubectl.rollout-ref with { root.name: by "nu-complete kubectl deployments" } # TYPE/NAME, e.g. deployment/web +] where { + at-most-one [--filename --kustomize] +} + +export complete [kubectl rollout history] [ + --revision: text # Show details of this revision + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + ref: kubectl.rollout-ref with { root.name: by "nu-complete kubectl deployments" } # TYPE/NAME, e.g. deployment/web +] + +export complete [kubectl rollout pause] [ + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + ref: kubectl.rollout-ref with { root.name: by "nu-complete kubectl deployments" } # TYPE/NAME, e.g. deployment/web +] + +export complete [kubectl rollout resume] [ + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + ref: kubectl.rollout-ref with { root.name: by "nu-complete kubectl deployments" } # TYPE/NAME, e.g. deployment/web +] + +export complete [kubectl port-forward] [ + --address: words [localhost 0.0.0.0 127.0.0.1 "::1"] # Addresses to listen on (comma-separated) + --pod-running-timeout: text # Wait for at least one running pod + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + target: kubectl.forward-ref with { root.name: by "nu-complete kubectl pods" } # Pod or TYPE/NAME, e.g. svc/web + ...ports: text # [LOCAL:]REMOTE port pairs, e.g. 8080:80 +] + +export complete [kubectl cp] [ + --container(-c): text # Container name + --no-preserve # Do not preserve ownership and permissions + --retries: text # Retries on copy failure + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + src: kubectl.cp with { root.pod: by "nu-complete kubectl pods" } # Local path or POD:PATH + dest: kubectl.cp with { root.pod: by "nu-complete kubectl pods" } # Local path or POD:PATH +] + +# `top` dispatches to `pods` and `nodes`. +export complete [kubectl top] [ + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity +] + +export complete [kubectl top pods] [ + --containers # Show metrics per container + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --all-namespaces(-A) # Across all namespaces + --field-selector: text # Field selector + --sort-by: words [cpu memory] # Sort by usage + --no-headers # Do not print headers + --sum # Print the sum of usage + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + pod?: by "nu-complete kubectl pods" [namespace: --namespace] # Pod name +] where { + at-most-one [--all-namespaces --namespace] +} + +export complete [kubectl top nodes] [ + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --sort-by: words [cpu memory] # Sort by usage + --no-headers # Do not print headers + --show-capacity # Show capacity instead of allocatable + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + node?: by "nu-complete kubectl nodes" # Node name +] + +export complete [kubectl run] [ + --image: text # Container image to run + --port: text # Port the container exposes + --env: env-assign # Environment variable (KEY=value) + --labels(-l): text # Labels to apply, e.g. app=web + --annotations: text # Annotations to apply + --restart: words [Always OnFailure Never] # Pod restart policy + --image-pull-policy: words [Always IfNotPresent Never] # Image pull policy + --rm # Delete the pod after it exits (attached only) + --stdin(-i) # Keep stdin open + --tty(-t) # Allocate a TTY + --attach # Wait for the pod and attach + --command # Use the extra arguments as the command, not args + --expose # Create a ClusterIP service for the pod + --privileged # Run the container privileged + --overrides: text # Inline JSON override for the generated object + --pod-running-timeout: text # Wait for the pod to be running + --dry-run: words [none: "submit the request" client: "only print what would be sent" server: "submit without persisting"] # Dry-run strategy + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + name: text # Pod name + ...command: command # Arguments (or with --command, the command) after `--` +] where { + exactly-one [--image] + requires --expose --port +} + +export complete [kubectl patch] [ + --patch(-p): text # The patch (JSON or YAML) + --patch-file: path # File containing the patch + --type: words [json: "RFC 6902 JSON patch" merge: "RFC 7386 merge patch" strategic: "strategic merge patch (default)"] # Patch type + --local # Patch the -f file locally, not on the server + --subresource: words [status scale] # Subresource to patch + --field-manager: text # Name of the field manager + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --dry-run: words [none: "submit the request" client: "only print what would be sent" server: "submit without persisting"] # Dry-run strategy + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + resource?: by "nu-complete kubectl resources" # Resource type (or TYPE/NAME) + name?: by "nu-complete kubectl resource-names" [resource: resource] # Resource name +] where { + exactly-one [--patch --patch-file] + at-most-one [--filename --kustomize] + requires --local --filename +} + +export complete [kubectl label] [ + --overwrite # Allow overwriting an existing label + --list # List the current labels + --all # Select all resources of the type + --local # Do not contact the server + --resource-version: text # Only update if this is the current version + --field-selector: text # Field selector + --field-manager: text # Name of the field manager + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --all-namespaces(-A) # Across all namespaces + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --dry-run: words [none: "submit the request" client: "only print what would be sent" server: "submit without persisting"] # Dry-run strategy + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + resource?: by "nu-complete kubectl resources" # Resource type (or TYPE/NAME) + ...changes: text # NAME and KEY=VAL / KEY- label changes +] where { + at-most-one [--all --selector] + at-most-one [--all-namespaces --namespace] + at-most-one [--filename --kustomize] + excludes --list --overwrite +} + +export complete [kubectl annotate] [ + --overwrite # Allow overwriting an existing annotation + --list # List the current annotations + --all # Select all resources of the type + --local # Do not contact the server + --resource-version: text # Only update if this is the current version + --field-selector: text # Field selector + --field-manager: text # Name of the field manager + --selector(-l): text # Label selector, e.g. app=web,tier!=db + --all-namespaces(-A) # Across all namespaces + --filename(-f): path # File, directory or URL with the manifests + --kustomize(-k): dir # Process a kustomization directory + --recursive(-R) # Process the -f directory recursively + --dry-run: words [none: "submit the request" client: "only print what would be sent" server: "submit without persisting"] # Dry-run strategy + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + resource?: by "nu-complete kubectl resources" # Resource type (or TYPE/NAME) + ...changes: text # NAME and KEY=VAL / KEY- annotation changes +] where { + at-most-one [--all --selector] + at-most-one [--all-namespaces --namespace] + at-most-one [--filename --kustomize] + excludes --list --overwrite +} + +export complete [kubectl explain] [ + --recursive # Print all fields recursively + --api-version: text # Group/version of the resource + --output: words [plaintext plaintext-openapiv2] # Output format + --namespace(-n): by "nu-complete kubectl namespaces" # Namespace scope for this request + --context: by "nu-complete kubectl contexts" # Kubeconfig context to use + --kubeconfig: path # Path to the kubeconfig file + --cluster: text # Kubeconfig cluster to use + --user: text # Kubeconfig user to use + --server(-s): text # Address of the Kubernetes API server + --token: text # Bearer token for API authentication + --as: text # Username to impersonate + --as-group: text # Group to impersonate + --request-timeout: text # Time to wait for a single request (e.g. 30s) + --insecure-skip-tls-verify # Do not verify the server certificate + --v(-v): words [0 1 2 3 4 5 6 7 8 9] # Log level verbosity + field: kubectl.field with { root.resource: by "nu-complete kubectl resources" } # RESOURCE[.FIELD...], e.g. pods.spec.containers +] + +# `config` dispatches to its verbs. +export complete [kubectl config] [ + --kubeconfig: path # Path to the kubeconfig file +] + +export complete [kubectl config use-context] [ + --kubeconfig: path # Path to the kubeconfig file + context: by "nu-complete kubectl contexts" # Context to switch to +] + +export complete [kubectl config get-contexts] [ + --kubeconfig: path # Path to the kubeconfig file + --no-headers # Do not print headers + --output(-o): words [name] # Output format + context?: by "nu-complete kubectl contexts" # Only this context +] + +export complete [kubectl config current-context] [ + --kubeconfig: path # Path to the kubeconfig file +] + +export complete [kubectl config set-context] [ + --kubeconfig: path # Path to the kubeconfig file + --current # Modify the current context + --cluster: text # Cluster entry for the context + --user: text # User entry for the context + --namespace: by "nu-complete kubectl namespaces" # Default namespace for the context + context?: by "nu-complete kubectl contexts" # Context to create or modify +] + +export complete [kubectl config view] [ + --kubeconfig: path # Path to the kubeconfig file + --minify # Only the current context + --flatten # Inline certificates and keys + --raw # Show raw certificate data and secrets + --output(-o): words [json yaml wide name custom-columns= custom-columns-file= go-template= go-template-file= jsonpath= jsonpath-file= jsonpath-as-json=] # Output format +] + +export complete [kubectl config delete-context] [ + --kubeconfig: path # Path to the kubeconfig file + context: by "nu-complete kubectl contexts" # Context to delete +] + +export complete [kubectl config rename-context] [ + --kubeconfig: path # Path to the kubeconfig file + context: by "nu-complete kubectl contexts" # Context to rename + new_name: text # New context name +] diff --git a/custom-completions/kw/kw-completions.nu b/custom-completions/kw/kw-completions.nu index 2964d69ed..3a3fc3c1a 100644 --- a/custom-completions/kw/kw-completions.nu +++ b/custom-completions/kw/kw-completions.nu @@ -1,395 +1,646 @@ -def "nu-complete kw subcommands" [] { - [ - [value description]; - ["init" "Initialize kworkflow config file"] - ["build" "Build kernel"] - ["deploy" "Deploy a new kernel image to a target machine"] - ["bd" "Build and install kernel image/modules"] - ["diff" "Diff files"] - ["ssh" "SSH support"] - ["codestyle" "Apply checkpatch on directory or file"] - ["self-update" "kw self-update mechanism"] - ["maintainers" "Get maintainers and mailing list"] - ["kernel-config-manager" "Manage kernel .config files"] - ["config" "Set kw config options"] - ["remote" "Manage machines available via ssh"] - ["explore" "Explore string patterns"] - ["pomodoro" "kw pomodoro support"] - ["report" "Show kw pomodoro reports and kw usage statistics"] - ["device" "Show basic hardware information"] - ["backup" "Save or restore kw data"] - ["debug" "Linux kernel debug utilities"] - ["mail" "Send patches via email"] - ["env" "Handle kw envs"] - ["patch-hub" "Interface to lore kernel"] - ["clear-cache" "Clear files generated by kw"] - ["drm" "Set of commands to work with DRM drivers"] - ["vm" "Basic support for QEMU image"] - ["version" "Show kw version"] - ["man" "Show manual pages"] - ["h" "Displays this help message"] - ["help" "Show kw man page"] - ] -} - -def "nu-complete kw man pages" [] { - nu-complete kw subcommands | where value != "bd" and value != "h" and value != "help" and value != "man" -} - -def "nu-complete kw warnings" [] { - [ - [value description]; - ["1" "not too often, may be relevant"] - ["2" "quite often, may still be relevant"] - ["3" "more obscure, likely ignorable"] - ["12" "warns 1 and 2"] - ["13" "warns 1 and 3"] - ["23" "warns 2 and 3"] - ["123" "all warnings"] - ] -} - -def "nu-complete kw target" [] { - ["local", "remote"] -} - -def "nu-complete kw init template" [] { - ["x86-64", "rpi4-raspbian-32-cross-x86-arm", "rpi4-raspbian-64-cross-x86-arm"] -} - -def "nu-complete kw init arch" [] { - if ("arch" | path exists) { - ls arch - | where type == "dir" - | get name - | each {|el| $el | str replace 'arch/' ''} - } else { +# Declarative completions for kw (kworkflow), the inglorious kernel developer workflow tool. +# +# kw accepts short aliases for many subcommands (`kw b` for `kw build`, ...); each alias gets +# the same spec as the subcommand it stands for. + +# kw subcommands, with their descriptions. +@non-destructive +export def "nu-complete kw subcommands" []: nothing -> list<record<value: string, description: string>> { + try { + [ + {value: init, description: "Initialize the kworkflow config file"} + {value: build, description: "Build the kernel"} + {value: b, description: "Alias of build"} + {value: deploy, description: "Deploy a new kernel image to a target machine"} + {value: d, description: "Alias of deploy"} + {value: bd, description: "Build and install the kernel image and modules"} + {value: diff, description: "Diff files"} + {value: df, description: "Alias of diff"} + {value: ssh, description: "SSH support"} + {value: s, description: "Alias of ssh"} + {value: codestyle, description: "Apply checkpatch on a directory or file"} + {value: c, description: "Alias of codestyle"} + {value: self-update, description: "Update kw itself"} + {value: u, description: "Alias of self-update"} + {value: maintainers, description: "Get the maintainers and mailing list"} + {value: m, description: "Alias of maintainers"} + {value: kernel-config-manager, description: "Manage kernel .config files"} + {value: k, description: "Alias of kernel-config-manager"} + {value: config, description: "Set kw config options"} + {value: g, description: "Alias of config"} + {value: remote, description: "Manage machines available via ssh"} + {value: explore, description: "Explore string patterns"} + {value: e, description: "Alias of explore"} + {value: pomodoro, description: "Pomodoro-style time management"} + {value: p, description: "Alias of pomodoro"} + {value: report, description: "Show pomodoro reports and kw usage statistics"} + {value: r, description: "Alias of report"} + {value: device, description: "Show basic hardware information"} + {value: backup, description: "Save or restore kw data"} + {value: debug, description: "Linux kernel debug utilities"} + {value: mail, description: "Send patches via email"} + {value: env, description: "Handle kw envs"} + {value: patch-hub, description: "Interface to the lore.kernel.org archives"} + {value: clear-cache, description: "Clear files generated by kw"} + {value: drm, description: "Commands to work with DRM drivers"} + {value: vm, description: "Basic support for QEMU images"} + {value: version, description: "Show the kw version"} + {value: man, description: "Show manual pages"} + {value: help, description: "Show the kw help"} + {value: h, description: "Alias of help"} + ] + } catch { [] } } -def "nu-complete kw deploy alert" [] { - ["s", "v", "sv", "vs", "n"] +# Manual pages available through `kw man`. +@non-destructive +export def "nu-complete kw man pages" []: nothing -> list<record<value: string, description: string>> { + try { + nu-complete kw subcommands + | where {|it| not ($it.description | str starts-with "Alias of") } + | where value not-in [bd help man] + } catch { + [] + } } -def "nu-complete kw cores" [] { - 1..(sys cpu | length) +# Architectures under arch/ in the current kernel tree. +@non-destructive +export def "nu-complete kw arches" []: nothing -> list<string> { + try { + ls arch | where type == dir | get name | path basename + } catch { + [] + } } -def "nu-complete kw configs" [] { - ^kw config -s - | lines - | parse --regex '\[.*\] (?<value>[a-z_.]+)=(?<description>.+)$' +# Config options known to kw, with their current values. +@non-destructive +export def "nu-complete kw configs" []: nothing -> list<record<value: string, description: string>> { + try { + ^kw config --show + | lines + | parse --regex '\[.*\] (?<value>[a-z_.]+)=(?<description>.+)$' + } catch { + [] + } } -def "nu-complete kw remotes" [] { - ^kw remote --list - | lines - | where {|line| not ($line | str contains " ")} +# Remotes tracked by `kw remote`. +@non-destructive +export def "nu-complete kw remotes" []: nothing -> list<string> { + try { + ^kw remote --list + | lines + | where {|line| ($line | is-not-empty) and not ($line | str contains " ") } + } catch { + [] + } } -# The inglorious kernel developer workflow tool -export extern "kw" [ - subcommand?: string@"nu-complete kw subcommands" # Subcommand to run - --help(-h) # Shows help page - --version(-v) # Shows version -] - -# Show kw manual pages -export extern "kw man" [ - page?: string@"nu-complete kw man pages" # Manual page to show -] +export complete [kw] [ + subcommand?: by "nu-complete kw subcommands" # Subcommand to run + --help(-h) # Show the help page + --version(-v) # Show the version +] where { + terminal [--help --version] +} -# Show kw version -export extern "kw version" [ - ...args: string +# Show the kw manual pages. +export complete [kw man] [ + page?: by "nu-complete kw man pages" # Manual page to show ] -# Initialize kworkflow config file -export extern "kw init" [ - --template: string@"nu-complete kw init template" # Uses a template as the kworkflow.config - --arch: string@"nu-complete kw init arch" # Sets the variable arch from the newly created kworkflow.config - --remote: string # <user>@<host>:<port> set the variables ssh_user, ssh_ip, and ssh_port to <user>, <ip>, and <port>, respectively. - --target: string@"nu-complete kw target" # Sets default_deploy_target from kworkflow.config - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Show the kw version. +export complete [kw version] [] + +# Initialize the kworkflow config file. +export complete [kw init] [ + --template: words [x86-64 rpi4-raspbian-32-cross-x86-arm rpi4-raspbian-64-cross-x86-arm] # Template for kworkflow.config + --arch: by "nu-complete kw arches" cwd # Set arch in the new kworkflow.config + --remote: text # <user>@<host>:<port> of the deploy target + --target: words [local remote] # Set default_deploy_target + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + terminal [--help] +} -# Builds the kernel -export extern "kw build" [ - ...flags: string - --info(-i) # Displays build information - --menu(-n) # Invokes the kernel menuconfig - --doc(-d) # Builds the documentation - --cpu-scaling(-S): int@"nu-complete kw cores" # Sets the number of jobs to use for building the kernel (the -j flag) - --ccache # Enable ccache - --warnings(-w): string@"nu-complete kw warnings" # Sets the warning level for the kernel build - --save-log-to(-s): string # Saves the build log to a file - --llvm # Uses LLVM toolchain during compilation and linking - --clean(-c) # Removes build files (keeps the configuration) - --full-cleanup(-f) # Runs make distclean to reset the tree to the default state - --cflags # Allow passing of flags to the compiler - --alert: string@"nu-complete kw deploy alert" # set alert behaviour upon command completion - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Build the kernel. +export complete [kw build] [ + --info(-i) # Display build information + --menu(-n) # Invoke the kernel menuconfig + --doc(-d) # Build the documentation + --cpu-scaling(-S): text # Percentage of CPU cores to use for building + --ccache # Enable ccache + --warnings(-w): words [1: "not too often, may be relevant" 2: "quite often, may still be relevant" 3: "more obscure, likely ignorable" 12: "levels 1 and 2" 13: "levels 1 and 3" 23: "levels 2 and 3" 123: "all warnings"] # Warning level of the build + --save-log-to(-s): path # Save the build log to a file + --llvm # Use the LLVM toolchain + --clean(-c) # Remove build files, keeping the configuration + --full-cleanup(-f) # Run make distclean + --cflags: text # Flags passed to the compiler + --alert: words [s: "sound" v: "visual" sv: "sound and visual" vs: "visual and sound" n: "none"] # Alert on completion + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + excludes --clean --full-cleanup + terminal [--help --info] +} -export alias "kw b" = kw build - - -# Deploy the kernel -export extern "kw deploy" [ - --remote: string, # deploy to a machine in the network - --local # deploy to the host machine - --reboot(-r) # reboot machine after deploy - --no-reboot # do not reboot machine after deploy - --setup # run basic setup in the target machine - --modules(-m) # only install/update modules - --list(-l) # list available kernels in a single column - --list-all(-a) # list all available kernels - --ls-line(-s) # list available kernels separated by comma - --uninstall(-u): string # remove a single or multiple kernels - --force(-f) # remove kernels not installed by kw - --create-package(-p) # create a kw package without deploying - --from-package(-F) # deploy a custom kernel from kw package - --alert: string@"nu-complete kw deploy alert" # set alert behaviour upon command completion - --help(-h) # Shows help page -] +# Alias of `kw build`. +export complete [kw b] [ + --info(-i) # Display build information + --menu(-n) # Invoke the kernel menuconfig + --doc(-d) # Build the documentation + --cpu-scaling(-S): text # Percentage of CPU cores to use for building + --ccache # Enable ccache + --warnings(-w): words [1: "not too often, may be relevant" 2: "quite often, may still be relevant" 3: "more obscure, likely ignorable" 12: "levels 1 and 2" 13: "levels 1 and 3" 23: "levels 2 and 3" 123: "all warnings"] # Warning level of the build + --save-log-to(-s): path # Save the build log to a file + --llvm # Use the LLVM toolchain + --clean(-c) # Remove build files, keeping the configuration + --full-cleanup(-f) # Run make distclean + --cflags: text # Flags passed to the compiler + --alert: words [s: "sound" v: "visual" sv: "sound and visual" vs: "visual and sound" n: "none"] # Alert on completion + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + excludes --clean --full-cleanup + terminal [--help --info] +} +# Deploy a kernel image to a target machine. +export complete [kw deploy] [ + --remote: text # Deploy to a machine on the network (<user>@<host>:<port>) + --local # Deploy to the host machine + --reboot(-r) # Reboot the machine after deploying + --no-reboot # Do not reboot the machine after deploying + --setup # Run the basic setup on the target machine + --modules(-m) # Only install or update modules + --list(-l) # List the available kernels in one column + --list-all(-a) # List all available kernels + --ls-line(-s) # List the available kernels, comma-separated + --uninstall(-u): text # Remove one or more kernels (comma-separated) + --force(-f) # Remove kernels not installed by kw + --create-package(-p) # Create a kw package without deploying + --from-package(-F): path # Deploy a custom kernel from a kw package + --alert: words [s: "sound" v: "visual" sv: "sound and visual" vs: "visual and sound" n: "none"] # Alert on completion + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + excludes --remote --local + excludes --reboot --no-reboot + terminal [--help] +} -export alias "kw d" = kw deploy +# Alias of `kw deploy`. +export complete [kw d] [ + --remote: text # Deploy to a machine on the network (<user>@<host>:<port>) + --local # Deploy to the host machine + --reboot(-r) # Reboot the machine after deploying + --no-reboot # Do not reboot the machine after deploying + --setup # Run the basic setup on the target machine + --modules(-m) # Only install or update modules + --list(-l) # List the available kernels in one column + --list-all(-a) # List all available kernels + --ls-line(-s) # List the available kernels, comma-separated + --uninstall(-u): text # Remove one or more kernels (comma-separated) + --force(-f) # Remove kernels not installed by kw + --create-package(-p) # Create a kw package without deploying + --from-package(-F): path # Deploy a custom kernel from a kw package + --alert: words [s: "sound" v: "visual" sv: "sound and visual" vs: "visual and sound" n: "none"] # Alert on completion + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + excludes --remote --local + excludes --reboot --no-reboot + terminal [--help] +} -# Useful wrapper to the diff command to compare files or directories -export extern "kw diff" [ - ...files: string - --no-interactive # Displays all diff in two columns at once - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Build and install the kernel image and modules. +export complete [kw bd] [ + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + terminal [--help] +} -export alias "kw df" = kw diff - -# Ssh access into any network accessible machine -export extern "kw ssh" [ - --command(-c): string # Bash command to run on the remote machine - --script(-s): string # Bash script to run on the remote machine - --remote(-r): string # <user>@<host>:<port> parameters to ssh into the target machine - --send: string # Sends a local file to the remote. Needs to use --to after it - --get: string # Gets a remote file to the local. Needs to use --to after it - --to: string # The destination path. On the remote if --send. On the local if --get - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Compare files or directories with diff. +export complete [kw diff] [ + ...files: path # Files or directories to compare + --no-interactive # Show the whole diff in two columns at once + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + terminal [--help] +} -export alias "kw s" = kw ssh +# Alias of `kw diff`. +export complete [kw df] [ + ...files: path # Files or directories to compare + --no-interactive # Show the whole diff in two columns at once + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + terminal [--help] +} -export extern "kw codestyle" [ - path?: string # Which files to run checkpatch on. Defaults to the cwd - --help(-h) # Shows help page - --verbose # Verbose mode -] +# SSH into a machine accessible on the network. +export complete [kw ssh] [ + --command(-c): text # Bash command to run on the remote machine + --script(-s): path # Bash script to run on the remote machine + --remote(-r): text # <user>@<host>:<port> of the target machine + --send: path # Send a local file to the remote (use with --to) + --get: text # Get a remote file to the local machine (use with --to) + --to: text # Destination path: remote with --send, local with --get + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + excludes --command --script + excludes --send --get + terminal [--help] +} -export alias "kw c" = kw codestyle +# Alias of `kw ssh`. +export complete [kw s] [ + --command(-c): text # Bash command to run on the remote machine + --script(-s): path # Bash script to run on the remote machine + --remote(-r): text # <user>@<host>:<port> of the target machine + --send: path # Send a local file to the remote (use with --to) + --get: text # Get a remote file to the local machine (use with --to) + --to: text # Destination path: remote with --send, local with --get + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + excludes --command --script + excludes --send --get + terminal [--help] +} -export extern "kw self-update" [ - --unstable(-u) # Update kw based on the unstable branch - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Run checkpatch on a directory or file. +export complete [kw codestyle] [ + path?: path # Files to run checkpatch on (default: the cwd) + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + terminal [--help] +} -export alias "kw u" = kw self-update +# Alias of `kw codestyle`. +export complete [kw c] [ + path?: path # Files to run checkpatch on (default: the cwd) + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + terminal [--help] +} -export extern "kw maintainers" [ - path?: string # Path to the folder to show the maintainers of - --authors(-a) # Prints (non-recursively) the authors of the top-level target files - --update-patch(-u) # Include a `To:` field in the patch header - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Update kw itself. +export complete [kw self-update] [ + --unstable(-u) # Update from the unstable branch + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + terminal [--help] +} -export alias "kw m" = kw maintainers - -export extern "kw kernel-config-manager" [ - --save: string # Creates a snapshot of the .config file with the given name - -d: string # Sets the description when using --save - --force(-f) # Suppress warnings - --get: string # Gets the config with the given name and overwrites the current .config file - --remove(-r): string # Removes the config with the given name - --list(-l) # Lists all the configs being managed - --fetch # Fetches a .config from a target machine - --output(-o): string # Sets the output file when using --fetch - --optimize # Runs make localmodconfig to procude a config optimized for the target machine when using --fetch - --remove: string # Sets the remote <user>@<host>:<port> when using --fetch - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Alias of `kw self-update`. +export complete [kw u] [ + --unstable(-u) # Update from the unstable branch + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + terminal [--help] +} -export alias "kw k" = kw kernel-config-manager - -#config manager -export extern "kw config" [ - option?: string@"nu-complete kw configs" # Config options to set - value?: string # Value to set the option to - --global(-g) # Set the option globally - --local(-l) # Set the option locally - --show(-s) # Show the current configurations for a given target - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Get the maintainers and mailing list of a path. +export complete [kw maintainers] [ + path?: path # Folder to show the maintainers of + --authors(-a) # Print the authors of the top-level target files + --update-patch(-u) # Add a `To:` field to the patch header + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + terminal [--help] +} -export alias "kw g" = kw config - -# Manage set of tracked test machines -export extern "kw remote" [ - --global # Force use global config file instead of the local one - --add: string # Adds a remote named <name> for the machine at <remote-address> - --remove: string@"nu-complete kw remotes" # Remove the remote named <name> - --rename: string@"nu-complete kw remotes" # Rename the remote named <old-name> to <new-name> - --list # List all available remotes. - --set-default(-s) # Set the default remote - --help(-h) # Shows help page - --verbose(-v) # Verbose mode -] +# Alias of `kw maintainers`. +export complete [kw m] [ + path?: path # Folder to show the maintainers of + --authors(-a) # Print the authors of the top-level target files + --update-patch(-u) # Add a `To:` field to the patch header + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + terminal [--help] +} -# Git grep wrapper -export extern "kw explore" [ - expr?: string # Expression to search for - --log(-l) # Search using git log with the given string - --grep(-g) # Search using grep with the given string - --all(-a) # Search using git grep with the given string - --only-source(-c) # Show only results from source code - --only-header(-H) # Show only results from header - -p: string # Path to where to start the search - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Manage kernel .config files. +export complete [kw kernel-config-manager] [ + --save: text # Snapshot the .config file under this name + -d: text # Description of the snapshot (with --save) + --force(-f) # Suppress warnings + --get: text # Restore the named config over the current .config + --remove(-r): text # Remove the named config + --list(-l) # List the managed configs + --fetch # Fetch a .config from a target machine + --output(-o): path # Output file (with --fetch) + --optimize # Run make localmodconfig (with --fetch) + --remote: text # <user>@<host>:<port> of the target (with --fetch) + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + at-most-one [--save --get --remove --list --fetch] + requires -d --save + requires --output --fetch + requires --optimize --fetch + terminal [--help] +} -export alias "kw e" = kw explore - -#pomodoro style time management -export extern "kw pomodoro" [ - --set-timer(-t): string # Define a timer for the pomodoro (h | m | s) - --tag(-g): string # Tag the pomodoro - --description(-d): string # Describe the pomodoro task - --check-timer(-c) # Check the current timer - --show-tags(-s) # Show all tags used in pomodoros - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Alias of `kw kernel-config-manager`. +export complete [kw k] [ + --save: text # Snapshot the .config file under this name + -d: text # Description of the snapshot (with --save) + --force(-f) # Suppress warnings + --get: text # Restore the named config over the current .config + --remove(-r): text # Remove the named config + --list(-l) # List the managed configs + --fetch # Fetch a .config from a target machine + --output(-o): path # Output file (with --fetch) + --optimize # Run make localmodconfig (with --fetch) + --remote: text # <user>@<host>:<port> of the target (with --fetch) + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + at-most-one [--save --get --remove --list --fetch] + requires -d --save + requires --output --fetch + requires --optimize --fetch + terminal [--help] +} -export alias "kw p" = kw pomodoro - -# User data report support -export extern "kw report" [ - --year: string="" # Shows the report for the current year if not specified <year> - --month: string="" # Shows the report for the current month if not specified <year>/<month> - --week: string="" # Shows the report for the current week if not specified <year>/<week> - --day: string="" # Shows the report for the current day if not specified <year>/<month>/<day> - --all # Shows all the data in the report - --statistics(-s) # Shows the statistics of the report - --pomodoro # Shows the pomodoro data in the report - --output: string # Output the report to a file - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Set kw config options. +export complete [kw config] [ + option?: by "nu-complete kw configs" # Config option to set + value?: text # Value to set the option to + --global(-g) # Set the option globally + --local(-l) # Set the option locally + --show(-s) # Show the current configuration + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + excludes --global --local + terminal [--help] +} -export alias "kw r" = kw report +# Alias of `kw config`. +export complete [kw g] [ + option?: by "nu-complete kw configs" # Config option to set + value?: text # Value to set the option to + --global(-g) # Set the option globally + --local(-l) # Set the option locally + --show(-s) # Show the current configuration + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + excludes --global --local + terminal [--help] +} -# Retrieve basic hardware information from a target machine -export extern "kw device" [ - --local # Show local device information - --remote: string # Show remote device information <remote>:<port> - --help(-h) # Shows help page - --verbose # Verbose mode -] +# Manage the set of tracked test machines. +export complete [kw remote] [ + --global # Use the global config file instead of the local one + --add: text # Add a remote: <name> <user>@<host>:<port> + --remove: by "nu-complete kw remotes" # Remove the named remote + --rename: by "nu-complete kw remotes" # Rename a remote: <old-name> <new-name> + --list # List all remotes + --set-default(-s): by "nu-complete kw remotes" # Set the default remote + --help(-h) # Show the help page + --verbose(-v) # Verbose mode +] where { + at-most-one [--add --remove --rename --list --set-default] + terminal [--help] +} -# kernel debug -export extern "kw debug" [ - --dmesg(-g) # Collect dmesg log. - --event(-e): string="" # Enable specific events to be traced. If no event is specified, all events will be enabled. - --ftrace(-t) # Enable ftrace. - --reset - --disable(-d) # Disable all events specified inside --event "" and --ftrace. - --list(-l): string="" # List all available events. If a specific event is informed via --events "<event>", this option will only list specific events related to the "<event>". This feature does not apply to --dmesg option. - --history(-k) # Create a debug directory that keeps track of all debugs made by the users. It creates a directory and organizes it based on an ID and date. - --follow(-f) # Real time output. - --cmd(-c) # If this parameter is used combined with --event or --ftrace, the following sequence will happen: (1) Enable specific trace, (2) collect trace in background, (3) run the command, (4) disable traces. When used with --dmesg, kw will (1) clean the dmesg log, (2) run the command, (3) and collect the log. - --verbose # Verbose mode is an option that causes the kw program to display debug messages to track its steps. This functionality is very useful during the debugging process, allowing you to identify possible errors more easily. - --help(-h) # Shows help page -] +# Search the tree with git grep, grep or git log. +export complete [kw explore] [ + expr?: text # Expression to search for + path?: path # Path to search in + --log(-l) # Search the git log + --grep(-g) # Search with grep + --all(-a) # Search with git grep, including untracked files + --only-source(-c) # Show only results from source files + --only-header(-H) # Show only results from header files + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + at-most-one [--log --grep --all] + excludes --only-source --only-header + terminal [--help] +} +# Alias of `kw explore`. +export complete [kw e] [ + expr?: text # Expression to search for + path?: path # Path to search in + --log(-l) # Search the git log + --grep(-g) # Search with grep + --all(-a) # Search with git grep, including untracked files + --only-source(-c) # Show only results from source files + --only-header(-H) # Show only results from header files + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + at-most-one [--log --grep --all] + excludes --only-source --only-header + terminal [--help] +} +# Pomodoro-style time management. +export complete [kw pomodoro] [ + --set-timer(-t): text # Timer for the pomodoro, e.g. 25m (h, m or s) + --tag(-g): text # Tag the pomodoro + --description(-d): text # Describe the pomodoro task + --check-timer(-c) # Check the current timer + --show-tags(-s) # Show all tags used in pomodoros + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + requires --description --tag + terminal [--help] +} +# Alias of `kw pomodoro`. +export complete [kw p] [ + --set-timer(-t): text # Timer for the pomodoro, e.g. 25m (h, m or s) + --tag(-g): text # Tag the pomodoro + --description(-d): text # Describe the pomodoro task + --check-timer(-c) # Check the current timer + --show-tags(-s) # Show all tags used in pomodoros + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + requires --description --tag + terminal [--help] +} -# git send-email wrapper -export extern "kw mail" [ - ...args: string - --send(-s): string # Send a patch by email using git send-email to the email addresses specified with --to and --cc. - --to: string # Specify the recipients that will receive the patch via e-mail. - --cc: string # Specify the recipients that will receive a copy of the patch via e-mail. - --simulate # Do everything without actually sending the e-mail. - --private # Suppress auto generation of recipients. - --rfc # Add a request for comment prefix to the e-mail's subject. - --setup(-t): string # Initialize and configure mail functionality. Each argument specifies a <config> to be set with the corresponding <value>. - --interactive(-i) # Interactively prompt the user for the values of the options. - --no-interactive(-n) # Inhibits interactive properties, particularly from the template option. - --local # Forces the commands to be run at a local scope. If nothing is passed all changes will be applied locally, but the listing and verification will happen in all scopes. - --global # Same as --local but in the global scope. - --force(-f) # Forces the configurations to be added, regardless of conflicts with the current values already set in the system. - --verify # Verify that all the settings needed are set and valid. - --template: string # Loads the default configuration values based on the given <template>. If no template is given the user will be shown the available templates to choose from. - --list(-l) # Lists the settings that mail uses. - --verbose # Verbose mode is an option that causes the kw program to display debug messages to track its progress. - --help(-h) # Shows help page -] +# Show pomodoro reports and kw usage statistics. +export complete [kw report] [ + --year?: text # Report for a <year> (default: this year) + --month?: text # Report for a <year>/<month> (default: this month) + --week?: text # Report for a <year>/<week> (default: this week) + --day?: text # Report for a <year>/<month>/<day> (default: today) + --all # Show all the data in the report + --statistics(-s) # Show the statistics + --pomodoro # Show the pomodoro data + --output: path # Write the report to a file + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + at-most-one [--year --month --week --day --all] + terminal [--help] +} +# Alias of `kw report`. +export complete [kw r] [ + --year?: text # Report for a <year> (default: this year) + --month?: text # Report for a <year>/<month> (default: this month) + --week?: text # Report for a <year>/<week> (default: this week) + --day?: text # Report for a <year>/<month>/<day> (default: today) + --all # Show all the data in the report + --statistics(-s) # Show the statistics + --pomodoro # Show the pomodoro data + --output: path # Write the report to a file + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + at-most-one [--year --month --week --day --all] + terminal [--help] +} +# Retrieve basic hardware information from a target machine. +export complete [kw device] [ + --local # Show local device information + --remote: text # Show remote device information (<remote>:<port>) + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + excludes --local --remote + terminal [--help] +} -# kw env manager -export extern "kw env" [ - --create(-c): string # The create parameter expects a string to be used as an env name. When kw creates a new env it instantiates the current kw configurations to the new env. - --use(-u): string # Change from one env to another previously created. - --destroy(-d): string # The destroy parameter expects a string with the name of the env you want to destroy. - --list(-l) # It shows all envs created via --create option. - --exit-env(-e) # Allow users to "exit" the env feature. If the user is using a specific env and doesn't want to use it anymore, the --exit-env option will remove all symbolic links and copy the current env's configuration files to the .kw. - --verbose # Verbose mode is an option that causes the kw program to display debug messages to track its progress. - --help(-h) # Shows help page -] +# Save or restore kw data. +export complete [kw backup] [ + path?: path # Directory to save the backup in + --restore(-r): path # Restore data from this backup archive + --force(-f) # Overwrite existing data when restoring + --help(-h) # Show the help page + --verbose # Verbose mode +] where { + requires --force --restore + terminal [--help] +} +# Linux kernel debug utilities. +export complete [kw debug] [ + --dmesg(-g) # Collect the dmesg log + --event(-e)?: text # Trace these events (all events when empty) + --ftrace(-t)?: text # Enable ftrace, optionally with a tracer and filter + --reset # Reset the debug state of the target + --disable(-d) # Disable the events from --event and --ftrace + --list(-l)?: text # List the available events, optionally filtered + --history(-k) # Keep a history directory of the debug runs + --follow(-f) # Follow the output in real time + --cmd(-c): text # Command to run while tracing or collecting dmesg + --verbose # Verbose mode + --help(-h) # Show the help page +] where { + terminal [--help] +} +# Send patches via git send-email. +export complete [kw mail] [ + ...args: path # Patches or revisions passed to git send-email + --send(-s) # Send the patches to the --to and --cc addresses + --to: text # Recipients of the patch + --cc: text # Recipients of a copy of the patch + --simulate # Do everything except actually sending + --private # Do not generate recipients automatically + --rfc # Add a request-for-comment prefix to the subject + --setup(-t) # Initialize and configure mail + --interactive(-i) # Prompt for the option values interactively + --no-interactive(-n) # Do not prompt, even for the template option + --local # Apply the settings at the local scope + --global # Apply the settings at the global scope + --force(-f) # Overwrite conflicting settings + --verify # Verify that the needed settings are valid + --template?: text # Load default settings from a template + --list(-l) # List the settings that mail uses + --verbose # Verbose mode + --help(-h) # Show the help page +] where { + excludes --interactive --no-interactive + excludes --local --global + terminal [--help] +} -# UI with lore.kernel.org archives -export extern "kw patch-hub" [ - --help(-h) # Shows help page -] +# Manage kw envs. +export complete [kw env] [ + --create(-c): text # Create an env with this name from the current config + --use(-u): text # Switch to a previously created env + --destroy(-d): text # Destroy the named env + --list(-l) # List the created envs + --exit-env(-e) # Leave the current env and restore the .kw config + --verbose # Verbose mode + --help(-h) # Show the help page +] where { + at-most-one [--create --use --destroy --list --exit-env] + terminal [--help] +} -# clear files generated by kw -export extern "kw clear-cache" [] - -# drm subsystem support -export extern "kw drm" [ - --local # Show all DRM drivers available in the local machine. - --remote: string # Specify the target device for the drm action, can be a remote or local machine. - --load-module: string # Allow user to specify one or more modules to load with or without parameters. - --unload-module: string # Allow users to unload one or more DRM drivers. - --gui-on # Provide a mechanism for turning on the GUI. - --gui-off # Turn off the target GUI in the specified target. - --conn-available # Show all connectors available in the target machine. - --modes # Show all available modes per card. - --verbose # Verbose mode that causes the kw program to display debug messages to track its progress. - --help(-h) # Shows help page -] +# Browse the lore.kernel.org archives. +export complete [kw patch-hub] [ + --help(-h) # Show the help page +] where { + terminal [--help] +} -# commands to work with QEMU VMs -export extern "kw vm" [ - --mount(-m) # This mounts the QEMU image in a specific directory, based on the data available in the kworkflow.config file. Only run this command after you turn off your VM. - --umount(-n) # This unmounts the previously mounted QEMU image, based on the parameters available in the kworkflow.config file. - --up(-u) # This starts the QEMU VM based on parameters in the kworkflow.config file. - --alert: string@"nu-complete kw deploy alert" # set alert behaviour upon command completion -] +# Clear the files generated by kw. +export complete [kw clear-cache] [] + +# Commands to work with DRM drivers. +export complete [kw drm] [ + --local # Use the local machine as the target + --remote: text # Target machine (<user>@<host>:<port>) + --load-module: text # Load one or more modules, with optional parameters + --unload-module: text # Unload one or more DRM drivers + --gui-on # Turn the GUI on + --gui-off # Turn the GUI off + --conn-available # Show the connectors available on the target + --modes # Show the available modes per card + --verbose # Verbose mode + --help(-h) # Show the help page +] where { + excludes --local --remote + excludes --gui-on --gui-off + terminal [--help] +} +# Basic support for QEMU images. +export complete [kw vm] [ + --mount(-m) # Mount the QEMU image (run with the VM off) + --umount(-n) # Unmount the mounted QEMU image + --up(-u) # Start the QEMU VM + --alert: words [s: "sound" v: "visual" sv: "sound and visual" vs: "visual and sound" n: "none"] # Alert on completion + --help(-h) # Show the help page +] where { + at-most-one [--mount --umount --up] + terminal [--help] +} -# Show kw man page -export extern "kw help" [] +# Show the kw help. +export complete [kw help] [] -export alias "kw h" = kw help +# Alias of `kw help`. +export complete [kw h] [] diff --git a/custom-completions/less/less-completions.nu b/custom-completions/less/less-completions.nu index 4b0597cc3..af0b2a80a 100644 --- a/custom-completions/less/less-completions.nu +++ b/custom-completions/less/less-completions.nu @@ -1,43 +1,87 @@ -# Display help and exit -extern "less" [ - --help(-?) # Display help and exit - --search-skip-screen(-a) # Search after end of screen - --auto-buffers(-B) # Disable automatic buffer allocation - --clear-screen(-c) # Repaint from top - --CLEAR-SCREEN(-C) # Clear and repaint from top - --dumb(-d) # Suppress error for lacking terminal capability - --quit-at-eof(-e) # Exit on second EOF - --QUIT-AT-EOF(-E) # Exit on EOF - --force(-f) # Open non-regular files - --quit-if-one-screen(-F) # Quit if file shorter than one screen - --hilite-search(-g) # Highlight one search target - --HILITE-SEARCH(-G) # No search highlighting - --ignore-case(-i) # Search ignores lowercase case - --IGNORE-CASE(-I) # Search ignores all case - --status-column(-J) # Display status column - --no-lessopen(-L) # Ignore $LESSOPEN - --long-prompt(-m) # Prompt with percentage - --LONG-PROMPT(-M) # Verbose prompt - --line-numbers(-n) # Display line number - --LINE-NUMBERS(-N) # Display line number for each line - --quiet(-q) # Silent mode - --silent # Silent mode - --QUIET(-Q) # Completely silent mode - --SILENT # Completely silent mode - --raw-control-chars(-r) # Display control chars - --RAW-CONTROL-CHARS(-R) # Display control chars, guess screen appearance - --squeeze-blank-lines(-s) # Multiple blank lines sqeezed - --chop-long-lines(-S) # Do not fold long lines - --underline-special(-u) # Allow backspace and carriage return - --UNDERLINE-SPECIAL(-U) # Allow backspace, tab and carriage return - --version(-V) # Display version and exit - --hilite-unread(-w) # Highlight first unread line on new page - --HILITE-UNREAD(-W) # Highlight first unread line on any movement - --no-init(-X) # No termcap init - --no-keypad # No keypad init - --tilde(-~) # Lines after EOF are blank - --shift # Characters to scroll on left/right arrows - # this breaks the parser - # --shift(-#) # Characters to scroll on left/right arrows - ...args -] +# nu-version: 0.116.2 +# Declarative completions for less (flags from `man less`, less 5xx/6xx). `posix-v1` lets bundled +# short flags (`less -iRN`) and attached values (`less -x4`) count for the rules below. +# Load with `use less-completions.nu *`. + +# Read files interactively, allowing scrolling and search. +export complete [less] profile posix-v1 [ + --help # Display help and exit + --search-skip-screen(-a) # Start forward searches after the last line displayed + --SEARCH-SKIP-SCREEN(-A) # Start forward searches after the target line + --buffers(-b): text # Number of buffers (KB) to use for each file + --auto-buffers(-B) # Disable automatic buffer allocation for pipes + --clear-screen(-c) # Repaint by clearing rather than scrolling + --CLEAR-SCREEN(-C) # Same as --clear-screen (compatibility) + --dumb(-d) # Suppress errors for a dumb terminal + --color(-D): text # Set the color of a text type (e.g. --color=Nr) + --quit-at-eof(-e) # Exit the second time end-of-file is reached + --QUIT-AT-EOF(-E) # Exit the first time end-of-file is reached + --force(-f) # Open non-regular files + --quit-if-one-screen(-F) # Exit if the file fits on the first screen + --hilite-search(-g) # Highlight only the last match + --HILITE-SEARCH(-G) # Do not highlight search matches + --max-back-scroll(-h): text # Maximum number of lines to scroll backward + --ignore-case(-i) # Ignore case unless the pattern has uppercase letters + --IGNORE-CASE(-I) # Ignore case in all searches + --jump-target(-j): text # Screen line (or .N fraction) for target lines + --status-column(-J) # Display a status column on the left + --lesskey-file(-k): path # Use this lesskey file + --quit-on-intr(-K) # Exit on an interrupt character + --no-lessopen(-L) # Ignore $LESSOPEN + --long-prompt(-m) # Prompt verbosely, like more, with a percentage + --LONG-PROMPT(-M) # Prompt even more verbosely + --line-numbers(-n) # Suppress line numbers + --LINE-NUMBERS(-N) # Display a line number at the start of each line + --log-file(-o): path # Copy the input to this file (when it is a pipe) + --LOG-FILE(-O): path # Like --log-file, overwriting without asking + --pattern(-p): text # Start at the first occurrence of this pattern + --prompt(-P): text # Customize the prompt + --quiet(-q) # Ring the bell only for some errors + --silent # Same as --quiet + --QUIET(-Q) # Never ring the terminal bell + --SILENT # Same as --QUIET + --raw-control-chars(-r) # Output raw control characters + --RAW-CONTROL-CHARS(-R) # Output ANSI color escape sequences in raw form + --squeeze-blank-lines(-s) # Squeeze consecutive blank lines into one + --chop-long-lines(-S) # Chop long lines rather than wrapping them + --tag(-t): text # Edit the file containing this tag + --tag-file(-T): path # Use this tags file + --underline-special(-u) # Send backspaces and carriage returns to the terminal + --UNDERLINE-SPECIAL(-U) # Treat backspaces, tabs and carriage returns as control chars + --version(-V) # Display the version and exit + --hilite-unread(-w) # Highlight the first new line after a forward page + --HILITE-UNREAD(-W) # Highlight the first new line after any forward move + --tabs(-x): text # Set tab stops (n,...) + --no-init(-X) # Disable termcap initialization and deinitialization + --max-forw-scroll(-y): text # Maximum number of lines to scroll forward + --window(-z): text # Scrolling window size in lines + --quotes: text # Change the filename quoting characters + --tilde # Do not display tildes after end of file + --shift: text # Columns to scroll on left/right arrow + --follow-name # Follow a file that is renamed or replaced (with F) + --incsearch # Search incrementally as the pattern is typed + --line-num-width: text # Minimum width of the line number field + --mouse # Enable mouse input + --MOUSE # Like --mouse, with the wheel direction reversed + --no-keypad # Do not send keypad initialization sequences + --no-histdups # Remove duplicates from the command history + --rscroll: text # Character to mark truncated lines + --save-marks # Save marks in the history file + --status-col-width: text # Width of the status column + --use-backslash # Let backslash escape characters in option values + --use-color # Enable colored text + --wheel-lines: text # Lines to scroll per mouse wheel click + ...files: path # Files to read +] where { + at-most-one [--quit-at-eof --QUIT-AT-EOF] + at-most-one [--hilite-search --HILITE-SEARCH] + at-most-one [--ignore-case --IGNORE-CASE] + at-most-one [--line-numbers --LINE-NUMBERS] + at-most-one [--raw-control-chars --RAW-CONTROL-CHARS] + at-most-one [--quiet --QUIET --silent --SILENT] + at-most-one [--long-prompt --LONG-PROMPT] + at-most-one [--hilite-unread --HILITE-UNREAD] + at-most-one [--mouse --MOUSE] + at-most-one [--log-file --LOG-FILE] + terminal [--help --version] +} diff --git a/custom-completions/lftp/lftp-completions.nu b/custom-completions/lftp/lftp-completions.nu index 273154fc4..742010e67 100644 --- a/custom-completions/lftp/lftp-completions.nu +++ b/custom-completions/lftp/lftp-completions.nu @@ -1,6 +1,6 @@ # nu-version: 0.102.0 -module lftp-completion-utils { +export module lftp-completion-utils { def extract-host []: list<string> -> record<name: string, addr: string> { # Host is a list of lines, like: # ╭───┬──────────────────────────────╮ @@ -26,6 +26,7 @@ module lftp-completion-utils { } # Process a SSH config file + @example "The hosts of an ssh configuration" { open ~/.ssh/config | process | get hosts | first 3 } export def process []: string -> record<hosts: list<record<name: string, addr: string>>, includes: list<string>> { let lines = $in | lines # Get 'Include' lines @@ -40,6 +41,7 @@ module lftp-completion-utils { } } + @example "The hosts of the ssh configuration, as lftp sites" { get-ssh-sites | first 3 } export def get-ssh-sites []: nothing -> table<value: string, description: string> { let files = [ '/etc/ssh/ssh_config', @@ -71,6 +73,7 @@ module lftp-completion-utils { $hosts | each {|h| [$"sftp://($h.name)" $"fish://($h.name)"] | wrap value | insert description $h.addr } | flatten } + @example "The bookmarks of lftp" { get-bookmark-sites | first 3 } export def get-bookmark-sites []: nothing -> table<value: string, description: string> { const FILE_PATH = '~/.local/share/lftp/bookmarks' | path expand let sites = try { open --raw $FILE_PATH | lines } catch { [] } @@ -80,20 +83,32 @@ module lftp-completion-utils { } -def "nu-complete lftp-site" [] { - use lftp-completion-utils get-ssh-sites - use lftp-completion-utils get-bookmark-sites - get-ssh-sites | append (get-bookmark-sites) +# Sites offered for lftp: sftp:// and fish:// URLs of ssh_config hosts, plus lftp bookmarks. +@non-destructive +export def "nu-complete lftp site" []: nothing -> list<record<value: string, description: string>> { + try { + use lftp-completion-utils get-ssh-sites + use lftp-completion-utils get-bookmark-sites + get-ssh-sites | append (get-bookmark-sites) + } catch { + [] + } } -export extern 'lftp' [ - -c: string # Execute the commands and exit - -d # Switch on debugging mode - -e: string # Execute the command just after selecting - -p: int # Use the port for connection - -u: string # Use the user/password for authentication - --norc # Don't execute rc files from the home directory - --help # Print the help and exit - --version # Print lftp version and exit - site?: string@"nu-complete lftp-site" # Host name, URL or bookmark name -] +export complete [lftp] [ + -c: text # Execute the commands and exit + -d # Switch on debugging mode + -e: text # Execute the command just after selecting + -p: text # Port to connect to + --user(-u): users # User[,password] for authentication + -f: path # Execute the commands in this file and exit + --norc # Do not execute rc files from the home directory + --rcfile: path # Execute commands from this file (repeatable) + --env-password # Take the password from LFTP_PASSWORD + --help(-h) # Print the help and exit + --version(-v) # Print the lftp version and exit + site?: by "nu-complete lftp site" # Host name, URL or bookmark +] where { + excludes -c -f + terminal [--help --version] +} diff --git a/custom-completions/loco/loco-completions.nu b/custom-completions/loco/loco-completions.nu index 2722169c8..2da0b42bb 100644 --- a/custom-completions/loco/loco-completions.nu +++ b/custom-completions/loco/loco-completions.nu @@ -1,112 +1,30 @@ -def "nu-complete loco new log" [] { - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - sort: false, - }, - completions: [ - "off" - "error" - "warn" - "info" - "debug" - "trace" - ] - } -} - -def "nu-complete loco new db" [] { - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - sort: false, - }, - completions: [ - "sqlite" - "postgres" - "none" - ] - } -} - -def "nu-complete loco new bg" [] { - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - sort: false, - }, - completions: [ - "async" - "queue" - "blocking" - "none" - ] - } -} +# Declarative completions for loco, the Loco app generator. -def "nu-complete loco new os" [] { - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - sort: false, - }, - completions: [ - "windows" - "linux" - "macos" - ] - } +export complete [loco] [ + --log(-l): words [off error warn info debug trace] # Verbosity level (default error) + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help --version] } -def "nu-complete loco new assets" [] { - { - options: { - case_sensitive: false, - completion_algorithm: fuzzy, - sort: false, - }, - completions: [ - "serverside" - "clientside" - "none" - ] - } +# Create a new Loco app. +export complete [loco new] [ + --log(-l): words [off error warn info debug trace] # Verbosity level (default error) + --path(-p): dir # Local path to generate into (default .) + --name(-n): text # App name + --db: words [sqlite postgres none] # Database provider + --bg: words [async queue blocking none] # Background worker configuration + --assets: words [serverside clientside none] # Assets serving configuration + --allow-in-git-repo(-a) # Create the starter inside a git repository + --os: words [windows linux macos] # Optimize the starter for this OS (default linux) + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help --version] } -def "nu-complete loco subcommands" [] { - { - options: { - sort: false - }, - completions : [ - { value: "new", description: "Create a new Loco app" }, - { value: "help", description: "Print this message or the help of the given subcommand(s)" }, - ] - } -} - -# Loco new app generator -export extern "loco" [ - subcommand?: string@"nu-complete loco subcommands" - --log(-l): string@"nu-complete loco new log" = "error" # Verbosity level - --help(-h) # Print help - --version(-V) # Print version -] - -# Create a new Loco app -export extern "loco new" [ - --log(-l): string@"nu-complete loco new log" = "error" # Verbosity level - --path(-p): path = "." # Local path to generate into - --name(-n): string # App name - --db: string@"nu-complete loco new db" # Database provider - --bg: string@"nu-complete loco new bg" # Background worker configuration - --assets: string@"nu-complete loco new assets" # Assets serving configuration - --allow-in-git-repo(-a) # Create the starter in target git repository - --os: string@"nu-complete loco new os" = "linux" # Create a Unix (linux, mac) or Windows optimized starter - --help(-h) # Print help - --version(-V) # Print version +# Print the help of loco or of a subcommand. +export complete [loco help] [ + command?: words [new: "Create a new Loco app" help: "Print the help of loco or a subcommand"] # Subcommand to describe ] diff --git a/custom-completions/lsd/lsd-completions.nu b/custom-completions/lsd/lsd-completions.nu index 153c47176..a8ac4bdfa 100644 --- a/custom-completions/lsd/lsd-completions.nu +++ b/custom-completions/lsd/lsd-completions.nu @@ -1,90 +1,57 @@ -# From original "lsd --help" - -def "nu-complete lsd color" [] { - ["always", "auto", "never"] -} - -def "nu-complete lsd icon" [] { - ["always", "auto", "never"] -} - -def "nu-complete lsd icon-theme" [] { - ["fancy", "unicode"] -} - -def "nu-complete lsd permission" [] { - ["rwx", "octal", "attributes", "disable"] -} - -def "nu-complete lsd size" [] { - ["default", "short", "bytes"] -} - -def "nu-complete lsd date" [] { - [date, locale, relative, +date-time-format] -} - -def "nu-complete lsd sort" [] { - ["size", "time", "version", "extension", "git", "none"] -} - -def "nu-complete lsd group-dirs" [] { - ["none", "first", "last"] +# lsd: an ls with colors, icons, trees and more. From `lsd --help`. + +export complete [lsd] profile posix-v1 [ + --all(-a) # Do not ignore entries starting with . + --almost-all(-A) # Do not list implied . and .. + --color: words [always auto never] # When to use terminal colours [default: auto] + --icon: words [always auto never] # When to print icons [default: auto] + --icon-theme: words [fancy unicode] # Icon theme [default: fancy] + --classify(-F) # Append an indicator (*/=>@|) to file names + --long(-l) # Display extended metadata as a table + --ignore-config # Ignore the configuration file + --config-file: path # Custom configuration file + --oneline(-1) # One entry per line + --recursive(-R) # Recurse into directories + --human-readable(-h) # For ls compatibility only (default) + --tree # Recurse and display as a tree + --depth: text # Maximum recursion depth + --directory-only(-d) # List directories themselves, not their contents + --permission: words [rwx octal attributes disable] # How to display permissions + --size: words [default short bytes] # How to display sizes [default: default] + --total-size # Display the total size of directories + --date: words [date locale relative "+date-time-format"] # How to display dates [default: date] + --timesort(-t) # Sort by modification time + --sizesort(-S) # Sort by size + --extensionsort(-X) # Sort by extension + --gitsort(-G) # Sort by git status + --versionsort(-v) # Natural sort of version numbers + --sort: words [size time version extension git none] # Sort by TYPE instead of name + --no-sort(-U) # Do not sort; directory order + --reverse(-r) # Reverse the sort order + --group-dirs: words [none first last] # Group directories before or after files + --group-directories-first # Same as --group-dirs=first + --blocks: words [permission user group context size date name inode links git] # Blocks to display, in order + --classic # Classic ls-like output + --no-symlink # Do not display symlink targets + --ignore-glob(-I): text # Hide entries matching this glob (repeatable) + --inode(-i) # Display inode numbers + --git(-g) # Show git status (with --long) + --dereference(-L) # Show info for symlink targets + --context(-Z) # Print security context + --hyperlink: words [always auto never] # Hyperlink file names [default: never] + --header # Display block headers + --truncate-owner-after: text # Truncate user/group names after N characters + --truncate-owner-marker: text # Marker appended to truncated names + --system-protected # Include Windows system-protected files + --literal(-N) # Print names without quoting + --help # Print help + --version(-V) # Print version + ...paths: path # Files and directories to list +] where { + at-most-one [--long --oneline --tree --classic] + at-most-one [--tree --recursive] + at-most-one [--timesort --sizesort --extensionsort --gitsort --versionsort --sort --no-sort] + overrides [--group-dirs --group-directories-first] + at-most-one [--all --almost-all] + terminal [--help --version] } - -def "nu-complete lsd blocks" [] { - ["permission", "user", "group", "context", "size", "date", "name", "inode", "links", "git"] -} - -def "nu-complete lsd hyperlink" [] { - ["always", "auto", "never"] -} - -# An ls command with a lot of pretty colors and some other stuff. -export extern lsd [ - --all(-a) # Do not ignore entries starting with . - --almost-all(-A) # Do not list implied . and .. - --color: string@"nu-complete lsd color" # When to use terminal colours [default: auto] - --icon: string@"nu-complete lsd icon" # When to print the icons [default: auto] - --icon-theme: string@"nu-complete lsd icon-theme" # Whether to use fancy or unicode icons [default: fancy] - --classify(-F) # Append indicator (one of */=>@|) at the end of the file names - --long(-l) # Display extended file metadata as a table - --ignore-config # Ignore the configuration file - --config-file: path # Provide a custom lsd configuration file - --oneline(-1) # Display one entry per line - --recursive(-R) # Recurse into directories - --human-readable(-h) # For ls compatibility purposes ONLY, currently set by default - --tree # Recurse into directories and present the result as a tree - --depth: number # Stop recursing into directories after reaching specified depth - --directory-only(-d) # Display directories themselves, and not their contents (recursively when used with --tree) - --permission: string@"nu-complete lsd permission" # How to display permissions [default: rwx for linux, attributes for windows] - --size: string@"nu-complete lsd size" # How to display size [default: default] - --total-size # Display the total size of directories - --date: string@"nu-complete lsd date" # How to display date [default: date] - --timesort(-t) # Sort by time modified - --sizesort(-S) # Sort by size - --extensionsort(-X) # Sort by file extension - --gitsort(-G) # Sort by git status - --versionsort(-v) # Natural sort of (version) numbers within text - --sort: string@"nu-complete lsd sort" # Sort by TYPE instead of name - --no-sort(-U) # Do not sort. List entries in directory order - --reverse(-r) # Reverse the order of the sort - --group-dirs: string@"nu-complete lsd group-dirs" # Sort the directories then the files - --group-directories-first # Groups the directories at the top before the files. Same as --group-dirs=first - --blocks: string@"nu-complete lsd blocks" # Specify the blocks that will be displayed and in what order - --classic # Enable classic mode (display output similar to ls) - --no-symlink # Do not display symlink target - --ignore-glob(-I) # Do not display files/directories with names matching the glob pattern(s). More than one can be specified by repeating the argument - --inode(-i) # Display the index number of each file - --git(-g) # Show git status on file and directory" Only when used with --long option - --dereference(-L) # When showing file information for a symbolic link, show information for the file the link references rather than for the link itself - --context(-Z) # Print security context (label) of each file - --hyperlink: string@"nu-complete lsd hyperlink" # Attach hyperlink to filenames [default: never] - --header # Display block headers - --truncate-owner-after: number # Truncate the user and group names if they exceed a certain number of characters - --truncate-owner-marker: string # Truncation marker appended to a truncated user or group name - --system-protected # Includes files with the windows system protection flag set. This is the same as --all on other platforms - --literal(-N) # Print entry names without quoting - --help # Print help information - --version(-V) # Print version -] \ No newline at end of file diff --git a/custom-completions/make/make-completions.nu b/custom-completions/make/make-completions.nu index 890c169cc..871773319 100644 --- a/custom-completions/make/make-completions.nu +++ b/custom-completions/make/make-completions.nu @@ -1,64 +1,87 @@ -def "nu-complete make" [] { - ls - | find --ignore-case makefile - | open $in.0.name - | lines - | find --regex '^[\w\.-]+\s*:' - | where ($it | str starts-with '.') == false - | split column ':' target - | get target - | str trim +# GNU make — declarative completions (`export complete`), verified against `make --help`. + +# Targets of the makefile in `dir` (default `.`), or of `makefile` when given. Reads only: it reads +# the file and never runs make. +def makefile-targets [dir?: string, makefile?: string] { + let dir = $dir | default '.' + let makefile = $makefile + | default (['GNUmakefile' 'makefile' 'Makefile'] | where {|name| $dir | path join $name | path exists } | get 0?) + if $makefile == null { return [] } + let lines = open --raw ($dir | path join $makefile) | lines + $lines | enumerate | each {|line| + let rule = $line.item | parse --regex '^(?<targets>[^\s.#=:][^:=#]*):(?:[^=]|$)' | get 0? + if $rule == null { return [] } + let recipe = $lines | skip ($line.index + 1) | take while {|text| $text starts-with "\t" } | first 1 | str trim | get 0? + $rule.targets | split row --regex '\s+' | where $it != '' | each {|target| {value: $target, description: ($recipe | default '')} } + } | flatten | uniq-by value } -def "nu-complete make jobs" [] { - seq 1 (sys cpu | length) +# The targets of the makefile of this directory, one row each: `name`. Reads only. +@non-destructive +export def make-targets []: nothing -> table<name: string> { + try { makefile-targets | select value | rename name } catch { [] } } -def "nu-complete make files" [] { - ls **/* | where type == file | get name +# Targets of the makefile given with `-f` (or of this directory's). +@non-destructive +export def "nu-complete make" [makefile?: string] { + try { makefile-targets '.' $makefile } catch { [] } } -def "nu-complete make dirs" [] { - ls **/* | where type == dir | get name +@non-destructive +export def "nu-complete make jobs" [] { + try { seq 1 (sys cpu | length) | each { into string } } catch { [] } } -export extern "make" [ - command?: string@"nu-complete make" - --always-make(-B) # Unconditionally make all targets. - --directory(-C): string@"nu-complete make dirs" # Change to DIRECTORY before doing anything. - --debug(-d) # Print various types of debugging information. - --environment-overrides(-e) # Environment variables override makefiles. - --eval(-E): string # Evaluate STRING as a makefile statement. - --file(-f) # Read FILE as a makefile. - --help(-h) # Print this message and exit. - --ignore-errors(-i) # Ignore errors from recipes. - --include-dir(-I): string@"nu-complete make dirs" # Search DIRECTORY for included makefiles. - --jobs(-j): int@"nu-complete make jobs" # Allow N jobs at once; infinite jobs with no arg. - --keep-going(-k) # Keep going when some targets can't be made. - --load-average(-l): int@"nu-complete make jobs" # Don't start multiple jobs unless load is below N. - --check-symlink-times(-L) # Use the latest mtime between symlinks and target. - --just-print(-n) # Don't actually run any recipe; just print them. - --dry-run - --recon - --assume-old: string@"nu-complete make files" # Consider FILE to be very old and don't remake it. - --old-file(-o): string@"nu-complete make files" - --output-sync(-O) # Synchronize output of parallel jobs by TYPE. - --print-data-base(-p) # Print make's internal database. - --question(-q) # Run no recipe; exit status says if up to date. - --no-builtin-rules(-r) # Disable the built-in implicit rules. - --no-builtin-variables(-R) # Disable the built-in variable settings. - --silent(-s) # Don't echo recipes. - --quiet - --no-silent # Echo recipes (disable --silent mode). - --stop(-S) # Turns off -k. - --no-keep-going - --touch(-t) # Touch targets instead of remaking them. - --trace # Print tracing information. - --version(-v) # Print the version number of make and exit. - --print-directory(-w) # Print the current directory. - --no-print-directory # Turn off -w, even if it was turned on implicitly. - --what-if(-W): string@"nu-complete make files" # Consider FILE to be infinitely new. - --new-file: string@"nu-complete make files" - --assume-new: string@"nu-complete make files" - --warn-undefined-variables # Warn when an undefined variable is referenced. -] +export complete [make] [ + ...targets: by "nu-complete make" [makefile: --file] # Targets to make (or VAR=value assignments) + --always-make(-B) # Unconditionally make all targets + --directory(-C): dir cwd # Change to DIRECTORY before doing anything + --debug(-d) # Print various types of debugging information + --environment-overrides(-e) # Environment variables override makefiles + --eval(-E): text # Evaluate STRING as a makefile statement + --file(-f): path # Read FILE as a makefile + --makefile: path # Alias of --file + --help(-h) # Print this message and exit + --ignore-errors(-i) # Ignore errors from recipes + --include-dir(-I): dir # Search DIRECTORY for included makefiles + --jobs(-j): by "nu-complete make jobs" # Allow N jobs at once; infinite jobs with no arg + --keep-going(-k) # Keep going when some targets can't be made + --stop(-S) # Turns off -k + --no-keep-going # Alias of --stop + --load-average(-l): by "nu-complete make jobs" # Don't start multiple jobs unless load is below N + --check-symlink-times(-L) # Use the latest mtime between symlinks and target + --just-print(-n) # Don't actually run any recipe; just print them + --dry-run # Alias of --just-print + --recon # Alias of --just-print + --old-file(-o): path # Consider FILE to be very old and don't remake it + --assume-old: path # Alias of --old-file + --output-sync(-O): words [none line target recurse] # Synchronize output of parallel jobs by TYPE + --print-data-base(-p) # Print make's internal database + --question(-q) # Run no recipe; exit status says if up to date + --no-builtin-rules(-r) # Disable the built-in implicit rules + --no-builtin-variables(-R) # Disable the built-in variable settings + --silent(-s) # Don't echo recipes + --quiet # Alias of --silent + --no-silent # Echo recipes (disable --silent mode) + --touch(-t) # Touch targets instead of remaking them + --trace # Print tracing information + --version(-v) # Print the version number of make and exit + --print-directory(-w) # Print the current directory + --no-print-directory # Turn off -w, even if it was turned on implicitly + --what-if(-W): path # Consider FILE to be infinitely new + --new-file: path # Alias of --what-if + --assume-new: path # Alias of --what-if + --warn-undefined-variables # Warn when an undefined variable is referenced +] where { + at-most-one [--silent --quiet --debug] + overrides [--silent --no-silent] + overrides [--quiet --no-silent] + overrides [--keep-going --stop] + overrides [--keep-going --no-keep-going] + at-most-one [--stop --no-keep-going] + overrides [--print-directory --no-print-directory] + at-most-one [--file --makefile] + at-most-one [--just-print --dry-run --recon --question --touch] + terminal [--help --version] +} diff --git a/custom-completions/man/man-completions.nu b/custom-completions/man/man-completions.nu index 3591147e1..59cbcc8a3 100644 --- a/custom-completions/man/man-completions.nu +++ b/custom-completions/man/man-completions.nu @@ -1,16 +1,101 @@ -def "manpages" [] { +# nu-version: 0.116.2 +# Declarative completions for man (man-db flags from `man --help`; most also work with BSD man). +# Load with `use man-completions.nu *`. +# The manual pages found along `man -w`, one row each: `page` (`ls.1`), `name` (`ls`) and +# `section` (`1`). Reads only. +@non-destructive +@example "The pages of section 8" { man-pages | where section == "8" | get name } +export def man-pages []: nothing -> table<page: string, name: string, section: string> { ^man -w - | str trim + | str trim | split row (char esep) - | par-each { glob $'($in)/man?' } - | flatten - | par-each { ls $in | get name } + | par-each { glob $'($in)/man?' } | flatten - | path basename - | str replace ".gz" "" + | par-each { ls $in | get name } + | flatten + | path basename + | str replace ".gz" "" + | wrap page + | insert name { $in.page | path parse | get stem } + | insert section { $in.page | path parse | get extension } +} + +# The page names to offer, described by their section. +@non-destructive +export def "nu-complete man pages" [...rest: string]: nothing -> list<record<value: string, description: string>> { + try { + man-pages | each {|p| {value: $p.name, description: $"section ($p.section)"} } | uniq-by value + } catch { [] } } -export extern "man" [ - ...targets: string@"manpages" -] +# The standard manual sections. +@non-destructive +export def "nu-complete man sections" [...rest: string]: nothing -> list<record<value: string, description: string>> { + [ + {value: "1", description: "Executable programs or shell commands"} + {value: "2", description: "System calls"} + {value: "3", description: "Library calls"} + {value: "4", description: "Special files (usually /dev)"} + {value: "5", description: "File formats and conventions"} + {value: "6", description: "Games"} + {value: "7", description: "Miscellaneous"} + {value: "8", description: "System administration commands"} + {value: "9", description: "Kernel routines"} + {value: "n", description: "Tcl/Tk"} + ] +} + +# Display the manual page of a command. +export complete [man] [ + --config-file(-C): path # Use this user configuration file + --debug(-d) # Emit debugging messages + --default(-D) # Reset all options to their default values + --warnings?: text # Enable warnings from groff + --whatis(-f) # Equivalent to whatis + --apropos(-k) # Equivalent to apropos + --global-apropos(-K) # Search for text in all pages + --local-file(-l) # Interpret PAGE arguments as local file names + --where(-w) # Print the location of the man page(s) + --path # Same as --where + --location # Same as --where + --where-cat(-W) # Print the location of the cat file(s) + --location-cat # Same as --where-cat + --catman(-c) # Used by catman to reformat out of date cat pages + --recode(-R): text # Output the page source encoded in ENCODING + --locale(-L): text # Define the locale for this man search + --systems(-m): text # Use manual pages from other systems + --manpath(-M): text # Set the search path for manual pages + --sections(-S): by "nu-complete man sections" # Colon-separated section list + -s: by "nu-complete man sections" # Same as --sections + --extension(-e): text # Limit the search to this extension type + --ignore-case(-i) # Look for pages case-insensitively (default) + --match-case(-I) # Look for pages case-sensitively + --regex # Show all pages matching a regex + --wildcard # Show all pages matching a wildcard + --names-only # Make --regex and --wildcard match page names only + --all(-a) # Find all matching manual pages + --update(-u) # Force a cache consistency check + --no-subpages # Don't try subpages (`man foo bar` => `man foo-bar`) + --pager(-P): command # Use this program to display output + --prompt(-r): text # Provide the less pager with a prompt + --ascii(-7) # Display ASCII translation of certain latin1 chars + --encoding(-E): text # Use this output encoding + --no-hyphenation # Turn off hyphenation + --no-justification # Turn off justification + --preprocessor(-p): text # Preprocessors to run (e, p, t, g, r, v) + --troff(-t) # Use groff to format pages + --troff-device(-T)?: text # Use groff with the selected device + --html(-H)?: text # Display HTML output with this browser + --gxditview(-X)?: text # Display through gxditview + --ditroff(-Z) # Use groff and force it to produce ditroff + --help # Give the help list + --usage # Give a short usage message + --version(-V) # Print the program version + ...pages: by "nu-complete man pages" # [SECTION] PAGE... +] where { + at-most-one [--whatis --apropos --global-apropos --local-file --where --where-cat] + at-most-one [--ignore-case --match-case] + at-most-one [--regex --wildcard] + terminal [--help --usage --version] +} diff --git a/custom-completions/mask/mask-completions.nu b/custom-completions/mask/mask-completions.nu index c741a26b4..8545cbe53 100644 --- a/custom-completions/mask/mask-completions.nu +++ b/custom-completions/mask/mask-completions.nu @@ -1,50 +1,39 @@ -def "nu-complete mask recipes" [] { - ^mask --introspect - | from json - | get commands - | each {|x| - { - value: $x.name, - description: ( - $x.description - ) - } - } +# mask — a CLI task runner defined by a simple markdown file (maskfile.md). +# Declarative completions (`export complete`). + +def mask-commands [maskfile?: string] { + let flags = if ($maskfile | is-empty) { [] } else { ['--maskfile' $maskfile] } + ^mask ...$flags --introspect | from json | get commands } -def "nu-complete mask args" [context: string, offset: int] { - let r = ($context | split row ' ') - let c = ^mask --introspect - | from json - | get commands - | where name == $r.1 - | get 0 - mut rt = [] - if not ($c | get required_args | is-empty) { - $rt ++= ($c | get required_args | each {|x| - {value: null, description: $"($x.name) \(positional)"} - }) - } - if not ($c | get subcommands | is-empty) { - $rt ++= ($c | get subcommands | each {|x| - {value: $x.name, description: $"($x.description) \(subcommand)"} - }) - } - if not ($c | get named_flags | is-empty) { - $rt ++= ($c | get named_flags | each {|x| - let v = if not ($x.long | is-empty) { $"`--($x.long)`" } else if not ($x.short | is-empty) { $"`-($x.short)`" } else { $"---($x.name)" } - let a = ["required", "multiple", "takes_value", "validate_as_number"] - | where {|y| ($x | get $y) == true } - | str join ',' - let d = if ($a | is-empty) { $x.description } else { $"($x.description) \(($a))" } - {value: $v , description: $d } - }) - } +# The recipes of the maskfile, with their description. +@non-destructive +export def "nu-complete mask recipes" [maskfile?: string] { + try { mask-commands $maskfile | each {|x| {value: $x.name, description: $x.description} } } catch { [] } +} - $rt +# Subcommands and flags of the recipe being run. +@non-destructive +export def "nu-complete mask args" [recipe?: string] { + try { + let c = mask-commands | where name == $recipe | get 0 + let subs = $c.subcommands | each {|x| {value: $x.name, description: $"($x.description) \(subcommand)"} } + let flags = $c.named_flags | each {|x| + let v = if ($x.long | is-not-empty) { $"--($x.long)" } else { $"-($x.short)" } + let a = [required multiple takes_value validate_as_number] | where {|y| ($x | get $y) == true } | str join ',' + {value: $v, description: (if ($a | is-empty) { $x.description } else { $"($x.description) \(($a))" })} + } + $subs ++ $flags + } catch { [] } } -export extern "mask" [ - recipes?: string@"nu-complete mask recipes" - ...args: any@"nu-complete mask args" -] +export complete [mask] [ + recipe?: by "nu-complete mask recipes" [maskfile: --maskfile] # Recipe to run + ...args: by "nu-complete mask args" [recipe: recipe] # Arguments, subcommands and flags of the recipe + --maskfile: path # Path to a different maskfile you want to use + --introspect # Print the recipes as JSON + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help --version --introspect] +} diff --git a/custom-completions/md-to-clip/md-to-clip-completions.nu b/custom-completions/md-to-clip/md-to-clip-completions.nu index 4e946ab23..687f2d28d 100644 --- a/custom-completions/md-to-clip/md-to-clip-completions.nu +++ b/custom-completions/md-to-clip/md-to-clip-completions.nu @@ -1,22 +1,17 @@ -# Converter from TlDr format to Command Line Interface Pages format. -# https://github.com/command-line-interface-pages/v2-tooling/tree/main/md-to-clip -export extern "md-to-clip" [ - file: path@"nu-complete md-to-clip mdfiles" # Source tldr page to convert - --help (-h) # Display help - --version (-v) # Display version - --author (-a) # Display author - --email (-e) # Display author email - --no-file-save # Whether to display conversion result in stdout instead of writing it to a file - --output-directory : path@"nu-complete md-to-clip dirs" # Directory where conversion result will be written - --special-placeholder-config: path # Config with special placeholders -] -# "old-style long switch" flags are not covered because Nushell does not currently support them https://github.com/nushell/nushell/issues/5959 -# `-nfs`, `-od`, `-spc` - -def "nu-complete md-to-clip dirs" [] { - ls | where type == 'dir' | get name -} - -def "nu-complete md-to-clip mdfiles" [] { - ls | where type == 'dir' or name ends-with '.md' | get name -} +# Converter from TlDr format to Command Line Interface Pages format. +# https://github.com/command-line-interface-pages/v2-tooling/tree/main/md-to-clip +# Old-style long switches (`-nfs`, `-od`, `-spc`) are not covered. + +export complete [md-to-clip] [ + --help(-h) # Display help + --version(-v) # Display version + --author(-a) # Display author + --email(-e) # Display author email + --no-file-save # Print the conversion to stdout instead of writing a file + --output-directory: dir # Directory to write the conversion to + --special-placeholder-config: path # Config with special placeholders + ...files: path # tldr pages (.md) to convert +] where { + excludes --no-file-save --output-directory + terminal [--help --version --author --email] +} diff --git a/custom-completions/mix/mix-completions.nu b/custom-completions/mix/mix-completions.nu index 1f29144eb..284f7c226 100644 --- a/custom-completions/mix/mix-completions.nu +++ b/custom-completions/mix/mix-completions.nu @@ -1,185 +1,238 @@ -# Starts all registered apps -extern "mix app.start" [ +# Declarative completions for mix, the Elixir build tool. + +# Dependencies locked in mix.lock. +@non-destructive +export def "nu-complete mix deps" [] { + try { + open --raw mix.lock | parse --regex '(?m)^\s*"(?<value>[\w-]+)":\s*\{:(?<description>\w+)' | uniq-by value + } catch { [] } +} + +# Built-in tasks, plus the custom tasks under lib/mix/tasks. +@non-destructive +export def "nu-complete mix tasks" [] { + try { + let builtin = [app.start app.tree archive archive.build archive.install archive.uninstall clean cmd compile deps deps.clean deps.compile deps.get deps.tree deps.unlock deps.update do escript escript.build escript.install escript.uninstall format help hex loadconfig local local.hex local.rebar new profile.cprof profile.eprof profile.fprof profile.tprof release release.init run test test.coverage xref] + let custom = glob "lib/mix/tasks/**/*.ex" | each {|f| open --raw $f | parse --regex 'defmodule Mix\.Tasks\.(?<t>[\w.]+)' | get t } | flatten + | each {|t| $t | split row "." | each {|p| $p | str replace --all --regex '([a-z0-9])([A-Z])' '${1}_${2}' | str lowercase } | str join "." } + $builtin | append $custom | uniq + } catch { [] } +} + +# Tags used with @tag / @moduletag in the test suite. +@non-destructive +export def "nu-complete mix test-tags" [] { + try { + glob "test/**/*_test.exs" | each {|f| open --raw $f | parse --regex '@(?:module)?tag\s+:?(?<t>\w+)' | get t } | flatten | uniq + } catch { [] } +} + +# Installed archives. +@non-destructive +export def "nu-complete mix archives" [] { + try { ^mix archive | lines | where {|l| $l starts-with "* " } | str replace "* " "" } catch { [] } +} + +# Formats the source files of the project +export complete [mix format] [ + --check-formatted # Fail if a file is not formatted + --dot-formatter: path # Path to the file with the formatter configuration + --stdin-filename: text # The file name to use for the code read from stdin + ...files: path # Files to format (the configured ones by default) +] - ...args +# Starts all registered apps +export complete [mix app.start] [ + ...args: text ] # Lists all archives -extern "mix archive" [ - --no-compile # skip compilation - ...args +export complete [mix archive] [ + --no-compile # skip compilation + ...args: text ] # Archives this project into a .ez file -extern "mix archive.build" [ - --no-compile # skip compilation - ...args +export complete [mix archive.build] [ + --no-compile # skip compilation + ...args: text ] # Installs an archive locally -extern "mix archive.install" [ - - ...args +export complete [mix archive.install] [ + ...source: path # Path or URL of the archive (or `hex PACKAGE`, `git URL`, `github USER/REPO`) ] # Uninstalls archives -extern "mix archive.uninstall" [ - - ...args +export complete [mix archive.uninstall] [ + ...archives: by "nu-complete mix archives" # Archives to uninstall ] # Deletes generated application files -extern "mix clean" [ - --all # Clean everything, including dependencies - ...args +export complete [mix clean] [ + --all # Clean everything, including dependencies + ...args: text ] # Executes the given command -extern "mix cmd" [ - - ...args +export complete [mix cmd] [ + ...command: command # The command to run in each app ] # Compiles source files -extern "mix compile" [ - - ...args +export complete [mix compile] [ + ...args: text + --force # Force compilation + --warnings-as-errors # Treat warnings as errors + --no-deps-check # Do not check dependencies + --all-warnings # Print warnings from all files ] # Lists dependencies and their status -extern "mix deps" [ - - ...args +export complete [mix deps] [ + ...args: text ] # Deletes the given dependencies' files -extern "mix deps.clean" [ - - ...args +export complete [mix deps.clean] [ + ...deps: by "nu-complete mix deps" + --all # Clean all dependencies + --unused # Clean only unused dependencies + --unlock # Also unlock the dependencies + --build # Only remove the compiled files ] # Compiles dependencies -extern "mix deps.compile" [ - - ...args +export complete [mix deps.compile] [ + ...deps: by "nu-complete mix deps" ] # Gets all out of date dependencies -extern "mix deps.get" [ - - ...args +export complete [mix deps.get] [ + ...args: text + --only: words [dev test prod] # Only fetch dependencies for this environment + --check-locked # Raise if the lock file would change + --no-archives-check # Do not check archives ] # Unlocks the given dependencies -extern "mix deps.unlock" [ - - ...args +export complete [mix deps.unlock] [ + ...deps: by "nu-complete mix deps" + --all # Unlock all dependencies + --unused # Unlock unused dependencies + --check-unused # Fail if there are unused dependencies ] # Updates the given dependencies -extern "mix deps.update" [ - - ...args +export complete [mix deps.update] [ + ...deps: by "nu-complete mix deps" + --all # Update all dependencies + --only: words [dev test prod] # Only update dependencies for this environment ] # Executes the tasks separated by comma -extern "mix do" [ - - ...args +export complete [mix do] [ + ...tasks: by "nu-complete mix tasks" # Tasks, separated by `+` (or commas in older versions) ] # Builds an escript for the project -extern "mix escript.build" [ - --force # forces compilation regardless of modification times - --no-compile # skips compilation to .beam files - ...args +export complete [mix escript.build] [ + --force # forces compilation regardless of modification times + --no-compile # skips compilation to .beam files + ...args: text ] # Prints help information for tasks -extern "mix help" [ - - ...args +export complete [mix help] [ + task?: by "nu-complete mix tasks" # Task to show help for ] # Loads and persists the given configuration -extern "mix loadconfig" [ - - ...args +export complete [mix loadconfig] [ + ...args: text ] # Lists local tasks -extern "mix local" [ - - ...args +export complete [mix local] [ + ...args: text ] # Installs Hex locally -extern "mix local.hex" [ - - ...args +export complete [mix local.hex] [ + ...args: text ] # Manages public keys -extern "mix local.public_keys" [ - - ...args +export complete [mix local.public_keys] [ + ...args: text ] # Installs rebar locally -extern "mix local.rebar" [ - - ...args +export complete [mix local.rebar] [ + ...args: text ] # Creates a new Elixir project -extern "mix new" [ - --sup # generate an OTP application skeleton with a supervision tree - --umbrella # can be given to generate an umbrella project - --app # can be given in order to name the OTP application - --module # can be given in order to name the modules in the generated code skeleton - ...args -] +export complete [mix new] [ + --sup # generate an OTP application skeleton with a supervision tree + --umbrella # can be given to generate an umbrella project + --app: text # can be given in order to name the OTP application + --module: text # can be given in order to name the modules in the generated code skeleton + ...path: dir # Directory of the new project +] where { + excludes --sup --umbrella +} # Profiles the given file or expression with fprof -extern "mix profile.fprof" [ - - ...args +export complete [mix profile.fprof] [ + ...args: path # Script file and its arguments ] # Runs the given file or expression -extern "mix run" [ - --config(-c) # loads the given configuration file - --eval(-e) # evaluates the given code - --require(-r) # requires pattern before running the command - --parallel-require # requires pattern in parallel - --pr # requires pattern in parallel - --no-compile # does not compile even if files require compilation - --no-deps-check # does not check dependencies - --no-halt # does not halt the system after running the command - --no-start # does not start applications after compilation - ...args +export complete [mix run] [ + --config(-c): path # loads the given configuration file + --eval(-e): text # evaluates the given code + --require(-r): path # requires pattern before running the command + --parallel-require: path # requires pattern in parallel + --pr: path # requires pattern in parallel + --no-compile # does not compile even if files require compilation + --no-deps-check # does not check dependencies + --no-halt # does not halt the system after running the command + --no-start # does not start applications after compilation + ...args: path # Script file and its arguments ] # Runs a project's tests -extern "mix test" [ - --trace # run tests with detailed reporting; automatically sets `--max-cases` to 1 - --max-cases # set the maximum number of cases running async - --cover # the directory to include coverage results - --force # forces compilation regardless of modification times - --no-compile # do not compile, even if files require compilation - --no-start # do not start applications after compilation - --no-color # disable color in the output - --color # enable color in the output - --include # include tests that match the filter - --exclude # exclude tests that match the filter - --only # run only tests that match the filter - --seed # seeds the random number generator used to randomize test order - --timeout # set the timeout for the tests - ...args -] - -# specify input directory -extern "mix" [ - - ...args -] \ No newline at end of file +export complete [mix test] [ + --trace # run tests with detailed reporting; automatically sets `--max-cases` to 1 + --max-cases: text # set the maximum number of cases running async + --cover # the directory to include coverage results + --force # forces compilation regardless of modification times + --no-compile # do not compile, even if files require compilation + --no-start # do not start applications after compilation + --no-color # disable color in the output + --color # enable color in the output + --include: by "nu-complete mix test-tags" # include tests that match the filter + --exclude: by "nu-complete mix test-tags" # exclude tests that match the filter + --only: by "nu-complete mix test-tags" # run only tests that match the filter + --seed: text # seeds the random number generator used to randomize test order + --timeout: text # set the timeout for the tests + ...paths: path # Test files or directories (file:line allowed) + --failed # Only run tests that failed the last time + --stale # Only run tests that changed + --warnings-as-errors # Treat compilation warnings as errors + --max-failures: text # Stop after this many failures + --slowest: text # Show the slowest tests + --partitions: text # Number of test partitions +] where { + excludes --color --no-color + excludes --failed --stale +} + +# Run Elixir tasks +export complete [mix] [ + --help(-h) # Print help + --version(-v) # Print the Elixir version +] where { + terminal [--help --version] +} diff --git a/custom-completions/mvn/mvn-completions.nu b/custom-completions/mvn/mvn-completions.nu index edb74dd48..f45a95d4d 100644 --- a/custom-completions/mvn/mvn-completions.nu +++ b/custom-completions/mvn/mvn-completions.nu @@ -1,139 +1,127 @@ -# Display a help message -extern "mvn" [ - --also-make # If project list is specified, also build projects required by the list - --also-make-dependents # If project list is specified, also build projects that depend on projects on the list - --batch-mode(-B) # Run in non-interactive (batch) mode (disables output color) - --builder(-b) # The id of the build strategy to use - --strict-checksums(-C) # Fail the build if checksums don't match - --lax-checksums(-c) # Warn if checksums don't match - --color # Defines the color mode of the output. Supported are 'auto', 'always', 'never'. - --check-plugin-updates # Ineffective, only kept for backward compatibility - --define(-D) # Define a user property - --errors(-e) # Produce execution error messages - --encrypt-master-password # Encrypt master security password - --encrypt-password # Encrypt server password - --file(-f) # Force the use of an alternate POM file (or directory with pom.xml) - --fail-at-end # Only fail the build afterwards; allow all non-impacted builds to continue - --fail-fast # Stop at first failure in reactorized builds - --fail-never # NEVER fail the build, regardless of project result - --global-settings # Alternate path for the global settings file - --global-toolchains # Alternate path for the global toolchains file - --help(-h) # Display help information - --log-file(-l) # Log file where all build output will go (disables output color) - --legacy-local-repository # UNSUPPORTED: Use of this option will make Maven invocation fail. - --non-recursive(-N) # Do not recurse into sub-projects - --no-plugin-registry # Ineffective, only kept for backward compatibility - --no-plugin-updates # Ineffective, only kept for backward compatibility - --no-snapshot-updates # Suppress SNAPSHOT updates - --no-transfer-progress # Do not display transfer progress when downloading or uploading - --offline(-o) # Work offline - --activate-profiles(-P) # Comma-delimited list of profiles to activate - --projects # Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path - --quiet(-q) # Quiet output - only show errors - --resume-from # Resume reactor from specified project - --settings(-s) # Alternate path for the user settings file - --toolchains(-t) # Alternate path for the user toolchains file - --threads(-T) # Thread count, for instance 4 (int) or 2C/2.5C (int/float) where C is core multiplied - --update-snapshots(-U) # Forces a check for missing releases and updated snapshots on remote repositories - --update-plugins # Ineffective, only kept for backward compatibility - --version(-v) # Display version information - --show-version(-V) # Display version information WITHOUT stopping build - --debug(-X) # Produce execution debug output - ...args -] +# Declarative completions for Apache Maven (`mvn`). +# Maven goals are positional (`mvn clean install`), so they complete as one `...goals` list. -# default mvn plugins -# Clean up after the build -extern "mvn clean" [ -] +# Lifecycle phases and the most common plugin goals. +@non-destructive +export def "nu-complete mvn goals" [] { + try { + [ + {value: clean, description: "Remove the files generated by the previous build"} + {value: validate, description: "Validate the project is correct"} + {value: compile, description: "Compile the source code"} + {value: test-compile, description: "Compile the test sources"} + {value: test, description: "Run the unit tests"} + {value: package, description: "Package the compiled code (jar, war, ...)"} + {value: verify, description: "Run integration tests and checks"} + {value: install, description: "Install the package into the local repository"} + {value: deploy, description: "Copy the package to the remote repository"} + {value: site, description: "Generate the project site"} + {value: "dependency:tree", description: "Display the dependency tree"} + {value: "dependency:resolve", description: "Resolve all dependencies"} + {value: "dependency:analyze", description: "Find used-undeclared and declared-unused dependencies"} + {value: "dependency:go-offline", description: "Download everything needed to build offline"} + {value: "versions:display-dependency-updates", description: "Show newer dependency versions"} + {value: "versions:display-plugin-updates", description: "Show newer plugin versions"} + {value: "versions:set", description: "Set the project version"} + {value: "help:effective-pom", description: "Display the effective POM"} + {value: "help:effective-settings", description: "Display the effective settings"} + {value: "help:describe", description: "Describe a plugin or goal"} + {value: "archetype:generate", description: "Generate a project from an archetype"} + {value: "exec:java", description: "Run a Java main class"} + {value: "spring-boot:run", description: "Run a Spring Boot application"} + {value: "release:prepare", description: "Prepare a release"} + {value: "release:perform", description: "Perform a release"} + {value: "wrapper:wrapper", description: "Add the Maven wrapper to the project"} + ] + } catch { [] } +} -# Clean project and Skip test and Install the built artifact into the local repository. -extern "mvn clean install -DskipTests" [ - --debug(-X) # Produce execution debug output - --define(-D) # Define a user property - --errors(-e) # Produce execution error messages - --file(-f) # Force the use of an alternate POM file (or directory with pom.xml) - --threads(-T) # Thread count, for instance 4 (int) or 2C/2.5C (int/float) where C is core multiplied - --settings(-s) # Alternate path for the user settings file - ...args -] +# Profiles declared in pom.xml (and ~/.m2/settings.xml). +@non-destructive +export def "nu-complete mvn profiles" [] { + try { + ["pom.xml" ("~/.m2/settings.xml" | path expand)] | where {|f| $f | path exists } + | each {|f| open --raw $f | parse --regex '(?s)<profile>\s*<id>(?<id>[^<]+)</id>' | get id } + | flatten | uniq + } catch { [] } +} -# Validates the project's POMs -extern "mvn validate" [ +# Modules of a multi-module build, for `--projects`. +@non-destructive +export def "nu-complete mvn modules" [] { + try { open --raw pom.xml | parse --regex '<module>(?<m>[^<]+)</module>' | get m } catch { [] } +} - ...args -] +# Common user properties for `-D`. +@non-destructive +export def "nu-complete mvn properties" [] { + try { + [ + {value: skipTests, description: "Compile but do not run the tests"} + {value: "maven.test.skip=true", description: "Skip compiling and running the tests"} + {value: "test=", description: "Run only this test class or method"} + {value: "it.test=", description: "Run only this integration test"} + {value: "maven.javadoc.skip=true", description: "Skip Javadoc generation"} + {value: "gpg.skip", description: "Skip GPG signing"} + {value: "checkstyle.skip", description: "Skip Checkstyle"} + {value: "spotless.check.skip=true", description: "Skip Spotless checks"} + {value: "skipITs", description: "Skip integration tests"} + ] + } catch { [] } +} -# Compiles Java source -extern "mvn compile" [ - --debug(-X) # Produce execution debug output - --define(-D) # Define a user property - --errors(-e) # Produce execution error messages - --file(-f) # Force the use of an alternate POM file (or directory with pom.xml) - --threads(-T) # Thread count, for instance 4 (int) or 2C/2.5C (int/float) where C is core multiplied - --settings(-s) # Alternate path for the user settings file - ...args -] - -# Run project test class -extern "mvn test" [ - --debug(-X) # Produce execution debug output - --define(-D) # Define a user property - --errors(-e) # Produce execution error messages - --file(-f) # Force the use of an alternate POM file (or directory with pom.xml) - --threads(-T) # Thread count, for instance 4 (int) or 2C/2.5C (int/float) where C is core multiplied - --settings(-s) # Alternate path for the user settings file - ...args -] - -# Build and package the project -extern "mvn package" [ - --debug(-X) # Produce execution debug output - --define(-D) # Define a user property - --errors(-e) # Produce execution error messages - --file(-f) # Force the use of an alternate POM file (or directory with pom.xml) - --threads(-T) # Thread count, for instance 4 (int) or 2C/2.5C (int/float) where C is core multiplied - --settings(-s) # Alternate path for the user settings file - ...args -] - -# Useful for integration tests - verifies the existence of certain conditions. -extern "mvn verify" [ - - ...args -] - -# Install the built artifact into the local repository. -extern "mvn install" [ - --debug(-X) # Produce execution debug output - --define(-D) # Define a user property - --errors(-e) # Produce execution error messages - --file(-f) # Force the use of an alternate POM file (or directory with pom.xml) - --threads(-T) # Thread count, for instance 4 (int) or 2C/2.5C (int/float) where C is core multiplied - --settings(-s) # Alternate path for the user settings file - ...args -] - -# Skip test and Install the built artifact into the local repository. -extern "mvn install -DskipTests" [ - --debug(-X) # Produce execution debug output - --define(-D) # Define a user property - --errors(-e) # Produce execution error messages - --file(-f) # Force the use of an alternate POM file (or directory with pom.xml) - --threads(-T) # Thread count, for instance 4 (int) or 2C/2.5C (int/float) where C is core multiplied - --settings(-s) # Alternate path for the user settings file - ...args -] - -# Generate a site for the current project. -extern "mvn site" [ - - ...args -] - -# Deploy the build artifacts to the remote repository. -extern "mvn deploy" [ - --non-recursive(-N) # Do not recurse into sub-projects - --projects # Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path - ...args -] \ No newline at end of file +# Build and manage Java projects +export complete [mvn] [ + --also-make # Also build the projects required by the --projects list + -am # Short for --also-make + --also-make-dependents # Also build the projects that depend on the --projects list + -amd # Short for --also-make-dependents + --batch-mode(-B) # Run in non-interactive (batch) mode (disables output color) + --builder(-b): words [singlethreaded multithreaded] # Build strategy to use + --strict-checksums(-C) # Fail the build if checksums don't match + --lax-checksums(-c) # Warn if checksums don't match + --color: words [auto always never] # Color mode of the output + --define(-D): by "nu-complete mvn properties" # Define a user property (name=value) + --errors(-e) # Produce execution error messages + --encrypt-master-password: text # Encrypt the master security password + --encrypt-password: text # Encrypt a server password + --file(-f): path # Alternate POM file (or directory with pom.xml) + --fail-at-end # Only fail the build afterwards + --fail-fast # Stop at the first failure (default) + --fail-never # Never fail the build + --global-settings: path # Alternate global settings file + --global-toolchains: path # Alternate global toolchains file + --help(-h) # Display help information + --log-file(-l): path # Log file for all build output (disables output color) + --non-recursive(-N) # Do not recurse into sub-projects + --no-snapshot-updates # Suppress SNAPSHOT updates + --no-transfer-progress # Do not display transfer progress + -ntp # Short for --no-transfer-progress + --offline(-o) # Work offline + --activate-profiles(-P): by "nu-complete mvn profiles" # Comma-delimited list of profiles to activate + --projects: by "nu-complete mvn modules" # Comma-delimited list of reactor projects to build + -pl: by "nu-complete mvn modules" # Short for --projects + --quiet(-q) # Quiet output: only show errors + --resume-from: by "nu-complete mvn modules" # Resume the reactor from this project + -rf: by "nu-complete mvn modules" # Short for --resume-from + --resume(-r) # Resume from the project that failed in the previous build + --settings(-s): path # Alternate user settings file + --toolchains(-t): path # Alternate user toolchains file + --threads(-T): words [1 2 4 8 1C 2C] # Thread count (n or nC per core) + --update-snapshots(-U) # Force a check for updated releases and snapshots + --version(-v) # Display version information + --show-version(-V) # Display version information without stopping the build + --debug(-X) # Produce execution debug output + ...goals: by "nu-complete mvn goals" # Lifecycle phases and plugin:goal pairs +] where { + at-most-one [--fail-at-end --fail-fast --fail-never] + excludes --strict-checksums --lax-checksums + excludes --quiet --debug + excludes --offline --update-snapshots + at-most-one [--also-make -am] + at-most-one [--also-make-dependents -amd] + at-most-one [--no-transfer-progress -ntp] + at-most-one [--projects -pl] + at-most-one [--resume-from -rf --resume] + terminal [--help --version --encrypt-master-password --encrypt-password] +} diff --git a/custom-completions/mysql/mysql-completions.nu b/custom-completions/mysql/mysql-completions.nu index 455711920..6af1c0bf4 100644 --- a/custom-completions/mysql/mysql-completions.nu +++ b/custom-completions/mysql/mysql-completions.nu @@ -1,119 +1,107 @@ -# Display a help message -extern "mysql" [ - --help(-?) # Display a help message - --abort-source-on-error # Abort source filename operations in case of errors - --auto-rehash # Enable automatic rehashing - --auto-vertical-output # Automatically switch to vertical output - --batch(-B) # Batch mode results - --binary-mode # Binary input mode - --column-names # Write column names in results - --column-type-info(-m) # Display result set metadata - --comments(-c) # Preserve comments in statements - --skip-comments # Discard comments in statements - --compress(-C) # Compress all information - --debug # Write a debugging log - # --debug(-#) # (the short flag breaks the nu parser) Write a debugging log - --debug-check # Print some debugging information - --debug-info(-T) # Prints debugging information and memory and CPU usage - --disable-named-commands # Disable named commands - --force(-f) # Continue even if an SQL error occurs - --html(-H) # Produce HTML output - --ignore-spaces(-i) # Ignore spaces after function names - --line-numbers # Write line numbers for errors - --local-infile # Enable or disable LOCAL capability for LOAD DATA INFILE - --named-commands(-G) # Enable named mysql commands - --skip-named-commands # Disable named commands - --disable-auto-rehash(-A) # Disable automatic rehashing - --no-beep(-b) # Do not beep when errors occur - --no-defaults # Do not read default options from any option file - --one-database(-o) # Ignore statements for other databases than the chosen one - --pager # Use the given command for paging query output - --skip-pager # Disable paging - --password(-p) # Password to use when connecting (empty for prompt) - --pipe(-W) # Connect to the server via a named pipe - --print-defaults # Print the program argument list - --progress-reports # Get progress reports for long running commands - --skip-progress-reports # Disable progress reports for long running commands - --quick(-q) # Print each row as it is received - --raw(-r) # Disables character escaping - --reconnect # Try to reconnect when connection gets lost - --disable-reconnect # Do not try to reconnect when connection gets lost - --i-am-a-dummy(-U) # Allow only those statements that specify which rows to modify - --secure-auth # Do not send passwords to the server in old format - --show-warnings # Cause warnings to be shown - --sigint-ignore # Ignore SIGINT signals - --silent(-s) # Silent mode - --skip-column-names(-N) # Do not write column names in results - --skip-line-numbers(-L) # Do not write line numbers for errors - --ssl # Enable SSL for connection - --skip-ssl # Disable SSL for connection - --ssl-verify-server-cert # Verify servers "Common Name - --table(-t) # Display output in table format - --unbuffered(-n) # Flush the buffer after each query - --verbose(-v) # Verbose mode - --version(-V) # Display version information - --vertical(-E) # Print query output rows vertically - --wait(-w) # If the connection cannot be established, wait and retry - --xml(-X) # Produce XML output - ...args -] +# Declarative completions for the MySQL / MariaDB command-line client. -# Enable or disable LOCAL capability for LOAD DATA INFILE -extern "mysql 0 1" [ - --help(-?) # Display a help message - --abort-source-on-error # Abort source filename operations in case of errors - --auto-rehash # Enable automatic rehashing - --auto-vertical-output # Automatically switch to vertical output - --batch(-B) # Batch mode results - --binary-mode # Binary input mode - --column-names # Write column names in results - --column-type-info(-m) # Display result set metadata - --comments(-c) # Preserve comments in statements - --skip-comments # Discard comments in statements - --compress(-C) # Compress all information - --debug # Write a debugging log - # --debug(-#) # (the short flag breaks the nu parser) Write a debugging log - --debug-check # Print some debugging information - --debug-info(-T) # Prints debugging information and memory and CPU usage - --disable-named-commands # Disable named commands - --force(-f) # Continue even if an SQL error occurs - --html(-H) # Produce HTML output - --ignore-spaces(-i) # Ignore spaces after function names - --line-numbers # Write line numbers for errors - --local-infile # Enable or disable LOCAL capability for LOAD DATA INFILE - --named-commands(-G) # Enable named mysql commands - --skip-named-commands # Disable named commands - --disable-auto-rehash(-A) # Disable automatic rehashing - --no-beep(-b) # Do not beep when errors occur - --no-defaults # Do not read default options from any option file - --one-database(-o) # Ignore statements for other databases than the chosen one - --pager # Use the given command for paging query output - --skip-pager # Disable paging - --password(-p) # Password to use when connecting (empty for prompt) - --pipe(-W) # Connect to the server via a named pipe - --print-defaults # Print the program argument list - --progress-reports # Get progress reports for long running commands - --skip-progress-reports # Disable progress reports for long running commands - --quick(-q) # Print each row as it is received - --raw(-r) # Disables character escaping - --reconnect # Try to reconnect when connection gets lost - --disable-reconnect # Do not try to reconnect when connection gets lost - --i-am-a-dummy(-U) # Allow only those statements that specify which rows to modify - --secure-auth # Do not send passwords to the server in old format - --show-warnings # Cause warnings to be shown - --sigint-ignore # Ignore SIGINT signals - --silent(-s) # Silent mode - --skip-column-names(-N) # Do not write column names in results - --skip-line-numbers(-L) # Do not write line numbers for errors - --ssl # Enable SSL for connection - --skip-ssl # Disable SSL for connection - --ssl-verify-server-cert # Verify servers "Common Name - --table(-t) # Display output in table format - --unbuffered(-n) # Flush the buffer after each query - --verbose(-v) # Verbose mode - --version(-V) # Display version information - --vertical(-E) # Print query output rows vertically - --wait(-w) # If the connection cannot be established, wait and retry - --xml(-X) # Produce XML output - ...args -] \ No newline at end of file +# Databases visible with the default credentials (~/.my.cnf); nothing if a password prompt would be needed. +@non-destructive +export def "nu-complete mysql databases" [] { + try { ^mysql --batch --skip-column-names --connect-timeout=1 -e 'show databases' | lines } catch { [] } +} + +# Character sets the client knows about. +@non-destructive +export def "nu-complete mysql charsets" [] { + try { [utf8mb4 utf8mb3 utf8 latin1 ascii binary utf16 utf32 ucs2 cp1250 cp1251 gbk big5 sjis euckr] } catch { [] } +} + +# Run SQL statements on a MySQL server +export complete [mysql] [ + --host(-h): hosts # Connect to this host + --user(-u): users # Log in as this user + --port(-P): text # Port to connect to + --database(-D): by "nu-complete mysql databases" # Database to use + --execute(-e): text # Run one statement and exit + --socket(-S): path # Socket to connect through + --protocol: words [tcp socket pipe memory] # Protocol to use + --default-character-set: by "nu-complete mysql charsets" # Character set to use + --connect-timeout: text # Seconds to wait for the connection + --defaults-file: path # Only read default options from this file + --defaults-extra-file: path # Read this file after the global option files + --login-path: text # Read this path from the login file + --init-command: text # SQL to run after connecting + --ssl-ca: path # CA file in PEM format + --ssl-cert: path # X509 certificate in PEM format + --ssl-key: path # X509 key in PEM format + --ssl-mode: words [DISABLED PREFERRED REQUIRED VERIFY_CA VERIFY_IDENTITY] # SSL connection mode (MySQL) + --tee: path # Append everything into this outfile + --help # Display a help message + --abort-source-on-error # Abort source filename operations in case of errors + --auto-rehash # Enable automatic rehashing + --disable-auto-rehash(-A) # Disable automatic rehashing + --auto-vertical-output # Automatically switch to vertical output + --batch(-B) # Batch mode results + --binary-mode # Binary input mode + --column-names # Write column names in results + --skip-column-names(-N) # Do not write column names in results + --column-type-info(-m) # Display result set metadata + --comments(-c) # Preserve comments in statements + --skip-comments # Discard comments in statements + --compress(-C) # Compress all information + --debug # Write a debugging log + --debug-check # Print some debugging information + --debug-info(-T) # Print debugging information and memory and CPU usage + --named-commands(-G) # Enable named mysql commands + --skip-named-commands # Disable named commands + --disable-named-commands # Disable named commands + --force(-f) # Continue even if an SQL error occurs + --html(-H) # Produce HTML output + --xml(-X) # Produce XML output + --ignore-spaces(-i) # Ignore spaces after function names + --line-numbers # Write line numbers for errors + --skip-line-numbers(-L) # Do not write line numbers for errors + --local-infile # Enable LOCAL capability for LOAD DATA INFILE + --no-beep(-b) # Do not beep when errors occur + --no-defaults # Do not read default options from any option file + --one-database(-o) # Ignore statements for other databases + --pager?: command # Use this command for paging query output + --skip-pager # Disable paging + --password(-p)?: text # Password (prompted for if no value is attached) + --pipe(-W) # Connect via a named pipe + --print-defaults # Print the program argument list and exit + --progress-reports # Get progress reports for long running commands + --skip-progress-reports # Disable progress reports + --quick(-q) # Print each row as it is received + --raw(-r) # Disable character escaping + --reconnect # Reconnect when the connection is lost + --disable-reconnect # Do not reconnect when the connection is lost + --i-am-a-dummy(-U) # Only allow statements that specify which rows to modify + --secure-auth # Do not send passwords in the old format + --show-warnings # Show warnings after every statement + --sigint-ignore # Ignore SIGINT signals + --silent(-s) # Silent mode + --ssl # Enable SSL for the connection + --skip-ssl # Disable SSL for the connection + --ssl-verify-server-cert # Verify the server's Common Name against its hostname + --table(-t) # Display output in table format + --unbuffered(-n) # Flush the buffer after each query + --verbose(-v) # Verbose mode + --version(-V) # Display version information + --vertical(-E) # Print query output rows vertically + --wait(-w) # Wait and retry if the connection cannot be established + database?: by "nu-complete mysql databases" # Database to use when --database is not given +] where { + excludes --auto-rehash --disable-auto-rehash + excludes --column-names --skip-column-names + excludes --comments --skip-comments + at-most-one [--named-commands --skip-named-commands --disable-named-commands] + excludes --line-numbers --skip-line-numbers + excludes --pager --skip-pager + excludes --progress-reports --skip-progress-reports + excludes --reconnect --disable-reconnect + excludes --ssl --skip-ssl + excludes --skip-ssl --ssl-mode + at-most-one [--html --xml --table --vertical] + excludes --socket --pipe + excludes --no-defaults --defaults-file + excludes --no-defaults --defaults-extra-file + excludes --silent --verbose + terminal [--help --version --print-defaults] +} diff --git a/custom-completions/nano/nano-completions.nu b/custom-completions/nano/nano-completions.nu index 73e35af0d..8005b4442 100644 --- a/custom-completions/nano/nano-completions.nu +++ b/custom-completions/nano/nano-completions.nu @@ -1,56 +1,82 @@ -export extern nano [ - --smarthome (-A) # Enable smart home key - --backup (-B) # Save backups of existing files - --backupdir (-C) # Directory for saving unique backup files - --boldtext (-D) # Use bold instead of reverse video text - --tabstospaces (-E) # Convert typed tabs to spaces - --multibuffer (-F) # Read a file into a new buffer by default - --locking (-G) # Use (vim-style) lock files - --historylog (-H) # Save & reload old search/replace strings - --ignorercfiles (-I) # Don't look at nanorc files - --guidestripe (-J) # Show a guiding bar at this column - --rawsequences (-K) # Fix numeric keypad key confusion problem - --nonewlines (-L) # Don't add an automatic newline - --trimblanks (-M) # Trim tail spaces when hard-wrapping - --noconvert (-N) # Don't convert files from DOS/Mac format - --bookstyle (-O) # Leading whitespace means new paragraph - --positionlog (-P) # Save & restore position of the cursor - --quotestr (-Q) # Regular expression to match quoting - --restricted (-R) # Restrict access to the filesystem - --softwrap (-S) # Display overlong lines on multiple rows - --tabsize (-T) # Make a tab this number of columns wide - --quickblank (-U) # Wipe status bar upon next keystroke - --version (-V) # Print version information and exit - --wordbounds (-W) # Detect word boundaries more accurately - --wordchars (-X) # Which other characters are word parts - --syntax (-Y) # Syntax definition to use for coloring - --zap (-Z) # Let Bsp and Del erase a marked region - --atblanks (-a) # When soft-wrapping, do it at whitespace - --breaklonglines (-b) # Automatically hard-wrap overlong lines - --constantshow (-c) # Constantly show cursor position - --rebinddelete (-d) # Fix Backspace/Delete confusion problem - --emptyline (-e) # Keep the line below the title bar empty - --rcfile (-f) # Use only this file for configuring nano - --showcursor (-g) # Show cursor in file browser & help text - --help (-h) # Show this help text and exit - --autoindent (-i) # Automatically indent new lines - --jumpyscrolling (-j) # Scroll per half-screen, not per line - --cutfromcursor (-k) # Cut from cursor to end of line - --linenumbers (-l) # Show line numbers in front of the text - --mouse (-m) # Enable the use of the mouse - --noread (-n) # Do not read the file (only write it) - --operatingdir (-o) # Set operating directory - --preserve (-p) # Preserve XON (^Q) and XOFF (^S) keys - --indicator (-q) # Show a position+portion indicator - --fill (-r) # Set width for hard-wrap and justify - --speller (-s) # Use this alternative spell checker - --saveonexit (-t) # Save changes on exit, don't prompt - --unix (-u) # Save a file by default in Unix format - --view (-v) # View mode (read-only) - --nowrap (-w) # Don't hard-wrap long lines [default] - --nohelp (-x) # Don't show the two help lines - --afterends (-y) # Make Ctrl+Right stop at word ends - --stateflags (-%) # Show some states on the title bar - --minibar (-_) # Show a feedback bar at the bottom - --zero (-0) # Hide all bars, use whole terminal -] +# nu-version: 0.116.2 +# Declarative completions for GNU nano 7/8 (flags from `nano --help`). Note: macOS's `/usr/bin/nano` +# is UW Pico, which takes different flags. Load with `use nano-completions.nu *`. + +# The syntax definitions nano can color with: the `*.nanorc` files in the usual data directories. +@non-destructive +export def "nu-complete nano syntaxes" [...rest: string]: nothing -> list<string> { + try { + [/usr/share/nano /usr/local/share/nano /opt/homebrew/share/nano ($nu.home-dir | path join .nix-profile/share/nano)] + | where {|dir| $dir | path exists } + | each {|dir| glob ($dir | path join '*.nanorc') } + | flatten + | each {|file| $file | path parse | get stem } + | append [none] + | uniq + | sort + } catch { [none] } +} + +# A small and friendly text editor. +export complete [nano] profile posix-v1 [ + --smarthome(-A) # Enable smart home key + --backup(-B) # Save backups of existing files + --backupdir(-C): dir # Directory for saving unique backup files + --boldtext(-D) # Use bold instead of reverse video text + --tabstospaces(-E) # Convert typed tabs to spaces + --multibuffer(-F) # Read a file into a new buffer by default + --locking(-G) # Use (vim-style) lock files + --historylog(-H) # Save & reload old search/replace strings + --ignorercfiles(-I) # Don't look at nanorc files + --guidestripe(-J): text # Show a guiding bar at this column + --rawsequences(-K) # Fix numeric keypad key confusion problem + --nonewlines(-L) # Don't add an automatic newline + --trimblanks(-M) # Trim tail spaces when hard-wrapping + --noconvert(-N) # Don't convert files from DOS/Mac format + --bookstyle(-O) # Leading whitespace means new paragraph + --positionlog(-P) # Save & restore position of the cursor + --quotestr(-Q): text # Regular expression to match quoting + --restricted(-R) # Restrict access to the filesystem + --softwrap(-S) # Display overlong lines on multiple rows + --tabsize(-T): text # Make a tab this number of columns wide + --quickblank(-U) # Wipe status bar upon next keystroke + --version(-V) # Print version information and exit + --wordbounds(-W) # Detect word boundaries more accurately + --wordchars(-X): text # Which other characters are word parts + --syntax(-Y): by "nu-complete nano syntaxes" # Syntax definition to use for coloring + --zap(-Z) # Let Bsp and Del erase a marked region + --atblanks(-a) # When soft-wrapping, do it at whitespace + --breaklonglines(-b) # Automatically hard-wrap overlong lines + --constantshow(-c) # Constantly show cursor position + --rebinddelete(-d) # Fix Backspace/Delete confusion problem + --emptyline(-e) # Keep the line below the title bar empty + --rcfile(-f): path # Use only this file for configuring nano + --showcursor(-g) # Show cursor in file browser & help text + --help(-h) # Show this help text and exit + --autoindent(-i) # Automatically indent new lines + --jumpyscrolling(-j) # Scroll per half-screen, not per line + --cutfromcursor(-k) # Cut from cursor to end of line + --linenumbers(-l) # Show line numbers in front of the text + --mouse(-m) # Enable the use of the mouse + --noread(-n) # Do not read the file (only write it) + --operatingdir(-o): dir # Set operating directory + --preserve(-p) # Preserve XON (^Q) and XOFF (^S) keys + --indicator(-q) # Show a position+portion indicator + --fill(-r): text # Set width for hard-wrap and justify + --speller(-s): command # Use this alternative spell checker + --saveonexit(-t) # Save changes on exit, don't prompt + --unix(-u) # Save a file by default in Unix format + --view(-v) # View mode (read-only) + --nowrap(-w) # Don't hard-wrap long lines [default] + --nohelp(-x) # Don't show the two help lines + --afterends(-y) # Make Ctrl+Right stop at word ends + --listsyntaxes(-z) # List the names of available syntaxes + --stateflags # Show some states on the title bar + --minibar # Show a feedback bar at the bottom + --zero(-0) # Hide all bars, use whole terminal + ...files: path # Files to edit (`+LINE[,COLUMN] file` jumps to a position) +] where { + at-most-one [--breaklonglines --nowrap] + at-most-one [--zero --minibar] + terminal [--help --version --listsyntaxes] +} diff --git a/custom-completions/nix/nix-completions.nu b/custom-completions/nix/nix-completions.nu index fa8c8df7d..404916c36 100644 --- a/custom-completions/nix/nix-completions.nu +++ b/custom-completions/nix/nix-completions.nu @@ -2,1347 +2,1535 @@ def "nu-complete nix log-format" [] { ['raw', 'internal-json', 'bar', 'bar-with-logs'] } -#a tool for reproducible and declarative configuration management -export extern "nix" [ - --help #Show usage information. - --offline #Disable substituters and consider all previously downloaded files up-to-date. - --option #Set the Nix configuration setting name to value (overriding nix.conf). - --refresh #Consider all previously downloaded files out-of-date. - --version #Show version information. - --debug #Set the logging verbosity level to 'debug'. - --log-format: string@'nu-complete nix log-format' #Set the format of log output; one of raw, internal-json, bar or bar-with-logs. - --print-build-logs(-L) #Print full build logs on standard error. - --quiet #Decrease the logging verbosity level. - --verbose(-v) #Increase the logging verbosity level. - --accept-flake-config #Enable the accept-flake-config setting. - --access-tokens: string #Set the access-tokens setting. - --allow-dirty #Enable the allow-dirty setting. - --allow-import-from-derivation #Enable the allow-import-from-derivation setting. - --allow-new-privileges #Enable the allow-new-privileges setting. - --allow-symlinked-store #Enable the allow-symlinked-store setting. - --allow-unsafe-native-code-during-evaluation #Enable the allow-unsafe-native-code-during-evaluation setting. - --allowed-impure-host-deps: string #Set the allowed-impure-host-deps setting. - --allowed-uris: string #Set the allowed-uris setting. - --allowed-users: string #Set the allowed-users setting. - --auto-optimise-store #Enable the auto-optimise-store setting. - --bash-prompt: string #Set the bash-prompt setting. - --bash-prompt-suffix: string #Set the bash-prompt-suffix setting. - --build-hook: string #Set the build-hook setting. - --build-poll-interval: string #Set the build-poll-interval setting. - --build-users-group: string #Set the build-users-group setting. - --builders: string #Set the builders setting. - --builders-use-substitutes #Enable the builders-use-substitutes setting. - --commit-lockfile-summary: string #Set the commit-lockfile-summary setting. - --compress-build-log #Enable the compress-build-log setting. - --connect-timeout: string #Set the connect-timeout setting. - --cores: string #Set the cores setting. - --diff-hook: string #Set the diff-hook setting. - --download-attempts: string #Set the download-attempts setting. - --enforce-determinism #Enable the enforce-determinism setting. - --eval-cache #Enable the eval-cache setting. - --experimental-features: string #Set the experimental-features setting. - --extra-access-tokens: string #Append to the access-tokens setting. - --extra-allowed-impure-host-deps: string #Append to the allowed-impure-host-deps setting. - --extra-allowed-uris: string #Append to the allowed-uris setting. - --extra-allowed-users: string #Append to the allowed-users setting. - --extra-experimental-features: string #Append to the experimental-features setting. - --extra-extra-platforms: string #Append to the extra-platforms setting. - --extra-hashed-mirrors: string #Append to the hashed-mirrors setting. - --extra-ignored-acls: string #Append to the ignored-acls setting. - --extra-nix-path: string #Append to the nix-path setting. - --extra-platforms: string #Set the extra-platforms setting. - --extra-plugin-files: string #Append to the plugin-files setting. - --extra-sandbox-paths: string #Append to the sandbox-paths setting. - --extra-secret-key-files: string #Append to the secret-key-files setting. - --extra-substituters: string #Append to the substituters setting. - --extra-system-features: string #Append to the system-features setting. - --extra-trusted-public-keys: string #Append to the trusted-public-keys setting. - --extra-trusted-substituters: string #Append to the trusted-substituters setting. - --extra-trusted-users: string #Append to the trusted-users setting. - --fallback #Enable the fallback setting. - --filter-syscalls #Enable the filter-syscalls setting. - --flake-registry: string #Set the flake-registry setting. - --fsync-metadata #Enable the fsync-metadata setting. - --gc-reserved-space: string #Set the gc-reserved-space setting. - --hashed-mirrors: string #Set the hashed-mirrors setting. - --http-connections: string #Set the http-connections setting. - --http2 #Enable the http2 setting. - --ignored-acls: string #Set the ignored-acls setting. - --impersonate-linux-26 #Enable the impersonate-linux-26 setting. - --keep-build-log #Enable the keep-build-log setting. - --keep-derivations #Enable the keep-derivations setting. - --keep-env-derivations #Enable the keep-env-derivations setting. - --keep-failed #Enable the keep-failed setting. - --keep-going #Enable the keep-going setting. - --keep-outputs #Enable the keep-outputs setting. - --log-lines: string #Set the log-lines setting. - --max-build-log-size: string #Set the max-build-log-size setting. - --max-free: string #Set the max-free setting. - --max-jobs: string #Set the max-jobs setting. - --max-silent-time: string #Set the max-silent-time setting. - --min-free: string #Set the min-free setting. - --min-free-check-interval: string #Set the min-free-check-interval setting. - --nar-buffer-size: string #Set the nar-buffer-size setting. - --narinfo-cache-negative-ttl: string #Set the narinfo-cache-negative-ttl setting. - --narinfo-cache-positive-ttl: string #Set the narinfo-cache-positive-ttl setting. - --netrc-file: string #Set the netrc-file setting. - --nix-path: string #Set the nix-path setting. - --no-accept-flake-config #Disable the accept-flake-config setting. - --no-allow-dirty #Disable the allow-dirty setting. - --no-allow-import-from-derivation #Disable the allow-import-from-derivation setting. - --no-allow-new-privileges #Disable the allow-new-privileges setting. - --no-allow-symlinked-store #Disable the allow-symlinked-store setting. - --no-allow-unsafe-native-code-during-evaluation #Disable the allow-unsafe-native-code-during-evaluation setting. - --no-auto-optimise-store #Disable the auto-optimise-store setting. - --no-builders-use-substitutes #Disable the builders-use-substitutes setting. - --no-compress-build-log #Disable the compress-build-log setting. - --no-enforce-determinism #Disable the enforce-determinism setting. - --no-eval-cache #Disable the eval-cache setting. - --no-fallback #Disable the fallback setting. - --no-filter-syscalls #Disable the filter-syscalls setting. - --no-fsync-metadata #Disable the fsync-metadata setting. - --no-http2 #Disable the http2 setting. - --no-impersonate-linux-26 #Disable the impersonate-linux-26 setting. - --no-keep-build-log #Disable the keep-build-log setting. - --no-keep-derivations #Disable the keep-derivations setting. - --no-keep-env-derivations #Disable the keep-env-derivations setting. - --no-keep-failed #Disable the keep-failed setting. - --no-keep-going #Disable the keep-going setting. - --no-keep-outputs #Disable the keep-outputs setting. - --no-preallocate-contents #Disable the preallocate-contents setting. - --no-print-missing #Disable the print-missing setting. - --no-pure-eval #Disable the pure-eval setting. - --no-require-sigs #Disable the require-sigs setting. - --no-restrict-eval #Disable the restrict-eval setting. - --no-run-diff-hook #Disable the run-diff-hook setting. - --no-sandbox #Disable sandboxing. - --no-sandbox-fallback #Disable the sandbox-fallback setting. - --no-show-trace #Disable the show-trace setting. - --no-substitute #Disable the substitute setting. - --no-sync-before-registering #Disable the sync-before-registering setting. - --no-trace-function-calls #Disable the trace-function-calls setting. - --no-use-case-hack #Disable the use-case-hack setting. - --no-use-registries #Disable the use-registries setting. - --no-use-sqlite-wal #Disable the use-sqlite-wal setting. - --no-warn-dirty #Disable the warn-dirty setting. - --plugin-files: string #Set the plugin-files setting. - --post-build-hook: string #Set the post-build-hook setting. - --pre-build-hook: string #Set the pre-build-hook setting. - --preallocate-contents #Enable the preallocate-contents setting. - --print-missing #Enable the print-missing setting. - --pure-eval #Enable the pure-eval setting. - --relaxed-sandbox #Enable sandboxing, but allow builds to disable it. - --repeat: string #Set the repeat setting. - --require-sigs #Enable the require-sigs setting. - --restrict-eval #Enable the restrict-eval setting. - --run-diff-hook #Enable the run-diff-hook setting. - --sandbox #Enable sandboxing. - --sandbox-build-dir: string #Set the sandbox-build-dir setting. - --sandbox-dev-shm-size: string #Set the sandbox-dev-shm-size setting. - --sandbox-fallback #Enable the sandbox-fallback setting. - --sandbox-paths: string #Set the sandbox-paths setting. - --secret-key-files: string #Set the secret-key-files setting. - --show-trace #Enable the show-trace setting. - --stalled-download-timeout: string #Set the stalled-download-timeout setting. - --store: string #Set the store setting. - --substitute #Enable the substitute setting. - --substituters: string #Set the substituters setting. - --sync-before-registering #Enable the sync-before-registering setting. - --system: string #Set the system setting. - --system-features: string #Set the system-features setting. - --tarball-ttl: string #Set the tarball-ttl setting. - --timeout: string #Set the timeout setting. - --trace-function-calls #Enable the trace-function-calls setting. - --trusted-public-keys: string #Set the trusted-public-keys setting. - --trusted-substituters: string #Set the trusted-substituters setting. - --trusted-users: string #Set the trusted-users setting. - --use-case-hack #Enable the use-case-hack setting. - --use-registries #Enable the use-registries setting. - --use-sqlite-wal #Enable the use-sqlite-wal setting. - --user-agent-suffix: string #Set the user-agent-suffix setting. - --warn-dirty #Enable the warn-dirty setting. - ...args: any -] - -#build a derivation or fetch a store path -export extern "nix build" [ - --dry-run #Show what this command would do without doing it. - --json #Produce output in JSON format, suitable for consumption by another program. - --no-link #Do not create symlinks to the build results. - --out-link(-o) #path - --profile #The profile to update. - --rebuild #Rebuild an already built package and compare the result to the existing store paths. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] - -#run a bash shell that provides the build environment of a derivation -export extern "nix develop" [ - --build #Run the build phase. - --check #Run the check phase. - --command(-c) #command args - --configure #Run the configure phase. - --ignore-environment(-i) #Clear the entire environment (except those specified with --keep). - --install #Run the install phase. - --installcheck #Run the installcheck phase. - --keep(-k) #name - --phase #The stdenv phase to run (e.g. build or configure). - --profile #The profile to update. - --redirect #Redirect a store path to a mutable location. - --unpack #Run the unpack phase. - --unset(-u) #name - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] - -#manage Nix flakes -export extern "nix flake" [ - ...args: any # Arguments to be passed to your program -] - -#copy a flake and all its inputs to a store -export extern "nix flake archive" [ - --dry-run #Show what this command would do without doing it. - --json #Produce output in JSON format, suitable for consumption by another program. - --to #URI of the destination Nix store - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - ...args: any # Arguments to be passed to your program -] - -#check whether the flake evaluates and run its tests -export extern "nix flake check" [ - --no-build #Do not build checks. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - ...args: any # Arguments to be passed to your program -] - -#clone flake repository -export extern "nix flake clone" [ - --dest(-f) #path - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - ...args: any # Arguments to be passed to your program -] - -#show flake metadata -export extern "nix flake info" [ - --json #Produce output in JSON format, suitable for consumption by another program. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - ...args: any # Arguments to be passed to your program -] - -#create a flake in the current directory from a template -export extern "nix flake init" [ - --template(-t) #template - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - ...args: any # Arguments to be passed to your program -] - -#create missing lock file entries -export extern "nix flake lock" [ - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - ...args: any # Arguments to be passed to your program -] - -#show flake metadata -export extern "nix flake metadata" [ - --json #Produce output in JSON format, suitable for consumption by another program. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - ...args: any # Arguments to be passed to your program -] - -#create a flake in the specified directory from a template -export extern "nix flake new" [ - --template(-t) #template - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - ...args: any # Arguments to be passed to your program -] - -#download the source tree denoted by a flake reference into the Nix -export extern "nix flake prefetch" [ - --json #Produce output in JSON format, suitable for consumption by another program. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - ...args: any # Arguments to be passed to your program -] - -#show the outputs provided by a flake -export extern "nix flake show" [ - --json #Produce output in JSON format, suitable for consumption by another program. - --legacy #Show the contents of the legacyPackages output. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - ...args: any # Arguments to be passed to your program -] - -#update flake lock file -export extern "nix flake update" [ - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - ...args: any # Arguments to be passed to your program -] - -#show help about nix or a particular subcommand -export extern "nix help" [ - ...args: any # Arguments to be passed to your program -] - -#manage Nix profiles -export extern "nix profile" [ - ...args: any # Arguments to be passed to your program -] - -#show the closure difference between each version of a profile -export extern "nix profile diff-closures" [ - --profile #The profile to update. - ...args: any # Arguments to be passed to your program -] - -#show all versions of a profile -export extern "nix profile history" [ - --profile #The profile to update. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - ...args: any # Arguments to be passed to your program -] - -#install a package into a profile -export extern "nix profile install" [ - --profile #The profile to update. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +# The algorithms `nix hash` and `nix store prefetch-file` accept. +def "nu-complete nix hash-type" [] { + ['md5', 'sha1', 'sha256', 'sha512'] +} -#list installed packages -export extern "nix profile list" [ - --profile #The profile to update. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - ...args: any # Arguments to be passed to your program -] -#remove packages from a profile -export extern "nix profile remove" [ - --profile #The profile to update. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - ...args: any # Arguments to be passed to your program -] +# Flake references from the user/system registries plus common reference forms. +# Reads the registry files directly (no network, unlike `nix registry list`). +@non-destructive +export def "nu-complete nix flakes" [] { + try { + let files = [($env.XDG_CONFIG_HOME? | default ($env.HOME | path join .config) | path join nix registry.json) /etc/nix/registry.json] + let registered = $files | where {|f| $f | path exists } | each {|f| + open $f | get flakes | each {|e| {value: $e.from.id, description: ($e.to | get -o url path owner | compact | first | default $e.to.type)} } + } | flatten + let local = if ('flake.nix' | path exists) { [{value: '.', description: 'the flake in this directory'}] } else { [] } + $local ++ $registered ++ [ + {value: nixpkgs, description: 'the Nix package collection'} + {value: 'github:', description: 'github:<owner>/<repo>[/<ref>]'} + {value: 'path:', description: 'path:<directory>'} + {value: 'git+https://', description: 'a git repository'} + ] | uniq-by value + } catch { [] } +} -#roll back to the previous version or a specified version of a -export extern "nix profile rollback" [ - --dry-run #Show what this command would do without doing it. - --profile #The profile to update. - --to #The profile version to roll back to. - ...args: any # Arguments to be passed to your program -] +# Attribute paths of a flake's outputs: the conventional output names for this system. +@non-destructive +export def "nu-complete nix flake attrs" [] { + try { + let arch = match $nu.os-info.arch { 'aarch64' => 'aarch64', 'arm64' => 'aarch64', _ => 'x86_64' } + let os = match $nu.os-info.name { 'macos' => 'darwin', _ => 'linux' } + let system = $"($arch)-($os)" + [ + {value: default, description: 'the default package/app'} + {value: $"packages.($system).default", description: 'default package'} + {value: $"devShells.($system).default", description: 'default development shell'} + {value: $"apps.($system).default", description: 'default app'} + {value: $"checks.($system)", description: 'checks'} + {value: $"formatter.($system)", description: 'formatter'} + {value: 'nixosConfigurations.', description: 'NixOS configurations'} + {value: 'darwinConfigurations.', description: 'nix-darwin configurations'} + {value: 'homeConfigurations.', description: 'home-manager configurations'} + {value: 'overlays.', description: 'overlays'} + {value: 'legacyPackages.', description: 'legacy packages (e.g. nixpkgs#legacyPackages.<system>.hello)'} + ] + } catch { [] } +} -#upgrade packages using their most recent flake -export extern "nix profile upgrade" [ - --profile #The profile to update. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +# Installed profile elements (for `nix profile remove/upgrade`). +@non-destructive +export def "nu-complete nix profile elements" [] { + try { ^nix profile list --json | from json | get elements | transpose value e | each {|r| {value: $r.value, description: ($r.e.originalUrl? | default '')} } } catch { [] } +} -#delete non-current versions of a profile -export extern "nix profile wipe-history" [ - --dry-run #Show what this command would do without doing it. - --older-than #Delete versions older than the specified age. age must be in the format Nd, where N denotes - --profile #The profile to update. - ...args: any # Arguments to be passed to your program -] +# Registry entries (for `nix registry remove/pin`). +@non-destructive +export def "nu-complete nix registry entries" [] { + try { + let f = $env.XDG_CONFIG_HOME? | default ($env.HOME | path join .config) | path join nix registry.json + open $f | get flakes | get from.id + } catch { [] } +} -#start an interactive environment for evaluating Nix expressions -export extern "nix repl" [ - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - ...args: any # Arguments to be passed to your program -] +# A flake reference with an optional attribute path: `<flake>#<attr>` (e.g. `nixpkgs#hello`, `.#devShells.x86_64-linux.default`). +export syntax nix.flakeref over chars { + root = flake: until "#" ("#" attr: until " ")? +} -#run a Nix application -export extern "nix run" [ - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +export complete [nix] [ + --help # Show usage information. + --offline # Disable substituters and consider all previously downloaded files up-to-date. + --option: text # Set the Nix configuration setting name to value (overriding nix.conf). + --refresh # Consider all previously downloaded files out-of-date. + --version # Show version information. + --debug # Set the logging verbosity level to 'debug'. + --log-format: words ["raw" "internal-json" "bar" "bar-with-logs"] # Set the format of log output; one of raw, internal-json, bar or bar-with-logs. + --print-build-logs(-L) # Print full build logs on standard error. + --quiet # Decrease the logging verbosity level. + --verbose(-v) # Increase the logging verbosity level. + --accept-flake-config # Enable the accept-flake-config setting. + --access-tokens: text # Set the access-tokens setting. + --allow-dirty # Enable the allow-dirty setting. + --allow-import-from-derivation # Enable the allow-import-from-derivation setting. + --allow-new-privileges # Enable the allow-new-privileges setting. + --allow-symlinked-store # Enable the allow-symlinked-store setting. + --allow-unsafe-native-code-during-evaluation # Enable the allow-unsafe-native-code-during-evaluation setting. + --allowed-impure-host-deps: text # Set the allowed-impure-host-deps setting. + --allowed-uris: text # Set the allowed-uris setting. + --allowed-users: text # Set the allowed-users setting. + --auto-optimise-store # Enable the auto-optimise-store setting. + --bash-prompt: text # Set the bash-prompt setting. + --bash-prompt-suffix: text # Set the bash-prompt-suffix setting. + --build-hook: text # Set the build-hook setting. + --build-poll-interval: text # Set the build-poll-interval setting. + --build-users-group: text # Set the build-users-group setting. + --builders: text # Set the builders setting. + --builders-use-substitutes # Enable the builders-use-substitutes setting. + --commit-lockfile-summary: text # Set the commit-lockfile-summary setting. + --compress-build-log # Enable the compress-build-log setting. + --connect-timeout: text # Set the connect-timeout setting. + --cores: text # Set the cores setting. + --diff-hook: text # Set the diff-hook setting. + --download-attempts: text # Set the download-attempts setting. + --enforce-determinism # Enable the enforce-determinism setting. + --eval-cache # Enable the eval-cache setting. + --experimental-features: text # Set the experimental-features setting. + --extra-access-tokens: text # Append to the access-tokens setting. + --extra-allowed-impure-host-deps: text # Append to the allowed-impure-host-deps setting. + --extra-allowed-uris: text # Append to the allowed-uris setting. + --extra-allowed-users: text # Append to the allowed-users setting. + --extra-experimental-features: text # Append to the experimental-features setting. + --extra-extra-platforms: text # Append to the extra-platforms setting. + --extra-hashed-mirrors: text # Append to the hashed-mirrors setting. + --extra-ignored-acls: text # Append to the ignored-acls setting. + --extra-nix-path: text # Append to the nix-path setting. + --extra-platforms: text # Set the extra-platforms setting. + --extra-plugin-files: text # Append to the plugin-files setting. + --extra-sandbox-paths: text # Append to the sandbox-paths setting. + --extra-secret-key-files: text # Append to the secret-key-files setting. + --extra-substituters: text # Append to the substituters setting. + --extra-system-features: text # Append to the system-features setting. + --extra-trusted-public-keys: text # Append to the trusted-public-keys setting. + --extra-trusted-substituters: text # Append to the trusted-substituters setting. + --extra-trusted-users: text # Append to the trusted-users setting. + --fallback # Enable the fallback setting. + --filter-syscalls # Enable the filter-syscalls setting. + --flake-registry: text # Set the flake-registry setting. + --fsync-metadata # Enable the fsync-metadata setting. + --gc-reserved-space: text # Set the gc-reserved-space setting. + --hashed-mirrors: text # Set the hashed-mirrors setting. + --http-connections: text # Set the http-connections setting. + --http2 # Enable the http2 setting. + --ignored-acls: text # Set the ignored-acls setting. + --impersonate-linux-26 # Enable the impersonate-linux-26 setting. + --keep-build-log # Enable the keep-build-log setting. + --keep-derivations # Enable the keep-derivations setting. + --keep-env-derivations # Enable the keep-env-derivations setting. + --keep-failed # Enable the keep-failed setting. + --keep-going # Enable the keep-going setting. + --keep-outputs # Enable the keep-outputs setting. + --log-lines: text # Set the log-lines setting. + --max-build-log-size: text # Set the max-build-log-size setting. + --max-free: text # Set the max-free setting. + --max-jobs: text # Set the max-jobs setting. + --max-silent-time: text # Set the max-silent-time setting. + --min-free: text # Set the min-free setting. + --min-free-check-interval: text # Set the min-free-check-interval setting. + --nar-buffer-size: text # Set the nar-buffer-size setting. + --narinfo-cache-negative-ttl: text # Set the narinfo-cache-negative-ttl setting. + --narinfo-cache-positive-ttl: text # Set the narinfo-cache-positive-ttl setting. + --netrc-file: text # Set the netrc-file setting. + --nix-path: text # Set the nix-path setting. + --no-accept-flake-config # Disable the accept-flake-config setting. + --no-allow-dirty # Disable the allow-dirty setting. + --no-allow-import-from-derivation # Disable the allow-import-from-derivation setting. + --no-allow-new-privileges # Disable the allow-new-privileges setting. + --no-allow-symlinked-store # Disable the allow-symlinked-store setting. + --no-allow-unsafe-native-code-during-evaluation # Disable the allow-unsafe-native-code-during-evaluation setting. + --no-auto-optimise-store # Disable the auto-optimise-store setting. + --no-builders-use-substitutes # Disable the builders-use-substitutes setting. + --no-compress-build-log # Disable the compress-build-log setting. + --no-enforce-determinism # Disable the enforce-determinism setting. + --no-eval-cache # Disable the eval-cache setting. + --no-fallback # Disable the fallback setting. + --no-filter-syscalls # Disable the filter-syscalls setting. + --no-fsync-metadata # Disable the fsync-metadata setting. + --no-http2 # Disable the http2 setting. + --no-impersonate-linux-26 # Disable the impersonate-linux-26 setting. + --no-keep-build-log # Disable the keep-build-log setting. + --no-keep-derivations # Disable the keep-derivations setting. + --no-keep-env-derivations # Disable the keep-env-derivations setting. + --no-keep-failed # Disable the keep-failed setting. + --no-keep-going # Disable the keep-going setting. + --no-keep-outputs # Disable the keep-outputs setting. + --no-preallocate-contents # Disable the preallocate-contents setting. + --no-print-missing # Disable the print-missing setting. + --no-pure-eval # Disable the pure-eval setting. + --no-require-sigs # Disable the require-sigs setting. + --no-restrict-eval # Disable the restrict-eval setting. + --no-run-diff-hook # Disable the run-diff-hook setting. + --no-sandbox # Disable sandboxing. + --no-sandbox-fallback # Disable the sandbox-fallback setting. + --no-show-trace # Disable the show-trace setting. + --no-substitute # Disable the substitute setting. + --no-sync-before-registering # Disable the sync-before-registering setting. + --no-trace-function-calls # Disable the trace-function-calls setting. + --no-use-case-hack # Disable the use-case-hack setting. + --no-use-registries # Disable the use-registries setting. + --no-use-sqlite-wal # Disable the use-sqlite-wal setting. + --no-warn-dirty # Disable the warn-dirty setting. + --plugin-files: text # Set the plugin-files setting. + --post-build-hook: text # Set the post-build-hook setting. + --pre-build-hook: text # Set the pre-build-hook setting. + --preallocate-contents # Enable the preallocate-contents setting. + --print-missing # Enable the print-missing setting. + --pure-eval # Enable the pure-eval setting. + --relaxed-sandbox # Enable sandboxing, but allow builds to disable it. + --repeat: text # Set the repeat setting. + --require-sigs # Enable the require-sigs setting. + --restrict-eval # Enable the restrict-eval setting. + --run-diff-hook # Enable the run-diff-hook setting. + --sandbox # Enable sandboxing. + --sandbox-build-dir: text # Set the sandbox-build-dir setting. + --sandbox-dev-shm-size: text # Set the sandbox-dev-shm-size setting. + --sandbox-fallback # Enable the sandbox-fallback setting. + --sandbox-paths: text # Set the sandbox-paths setting. + --secret-key-files: text # Set the secret-key-files setting. + --show-trace # Enable the show-trace setting. + --stalled-download-timeout: text # Set the stalled-download-timeout setting. + --store: text # Set the store setting. + --substitute # Enable the substitute setting. + --substituters: text # Set the substituters setting. + --sync-before-registering # Enable the sync-before-registering setting. + --system: text # Set the system setting. + --system-features: text # Set the system-features setting. + --tarball-ttl: text # Set the tarball-ttl setting. + --timeout: text # Set the timeout setting. + --trace-function-calls # Enable the trace-function-calls setting. + --trusted-public-keys: text # Set the trusted-public-keys setting. + --trusted-substituters: text # Set the trusted-substituters setting. + --trusted-users: text # Set the trusted-users setting. + --use-case-hack # Enable the use-case-hack setting. + --use-registries # Enable the use-registries setting. + --use-sqlite-wal # Enable the use-sqlite-wal setting. + --user-agent-suffix: text # Set the user-agent-suffix setting. + --warn-dirty # Enable the warn-dirty setting. +] where { + at-most-one [--verbose --quiet] + overrides [--accept-flake-config --no-accept-flake-config] + overrides [--allow-dirty --no-allow-dirty] + overrides [--allow-import-from-derivation --no-allow-import-from-derivation] + overrides [--allow-new-privileges --no-allow-new-privileges] + overrides [--allow-symlinked-store --no-allow-symlinked-store] + overrides [--allow-unsafe-native-code-during-evaluation --no-allow-unsafe-native-code-during-evaluation] + overrides [--auto-optimise-store --no-auto-optimise-store] + overrides [--builders-use-substitutes --no-builders-use-substitutes] + overrides [--compress-build-log --no-compress-build-log] + overrides [--enforce-determinism --no-enforce-determinism] + overrides [--eval-cache --no-eval-cache] + overrides [--fallback --no-fallback] + overrides [--filter-syscalls --no-filter-syscalls] + overrides [--fsync-metadata --no-fsync-metadata] + overrides [--http2 --no-http2] + overrides [--impersonate-linux-26 --no-impersonate-linux-26] + overrides [--keep-build-log --no-keep-build-log] + overrides [--keep-derivations --no-keep-derivations] + overrides [--keep-env-derivations --no-keep-env-derivations] + overrides [--keep-failed --no-keep-failed] + overrides [--keep-going --no-keep-going] + overrides [--keep-outputs --no-keep-outputs] + overrides [--preallocate-contents --no-preallocate-contents] + overrides [--print-missing --no-print-missing] + overrides [--pure-eval --no-pure-eval] + overrides [--require-sigs --no-require-sigs] + overrides [--restrict-eval --no-restrict-eval] + overrides [--run-diff-hook --no-run-diff-hook] + overrides [--sandbox --no-sandbox] + overrides [--sandbox-fallback --no-sandbox-fallback] + overrides [--show-trace --no-show-trace] + overrides [--substitute --no-substitute] + overrides [--sync-before-registering --no-sync-before-registering] + overrides [--trace-function-calls --no-trace-function-calls] + overrides [--use-case-hack --no-use-case-hack] + overrides [--use-registries --no-use-registries] + overrides [--use-sqlite-wal --no-use-sqlite-wal] + overrides [--warn-dirty --no-warn-dirty] + terminal [--help --version] +} -#search for packages -export extern "nix search" [ - --json #Produce output in JSON format, suitable for consumption by another program. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +export complete [nix build] [ + --dry-run # Show what this command would do without doing it. + --json # Produce output in JSON format, suitable for consumption by another program. + --no-link # Do not create symlinks to the build results. + --out-link(-o): path # path + --print-out-paths # Print the resulting output paths. + --stdin # Read installables from standard input. + --profile: path # The profile to update. + --rebuild # Rebuild an already built package and compare the result to the existing store paths. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--dry-run --rebuild] + at-most-one [--no-link --out-link] + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] + requires --print-out-paths --no-link +} -#run a shell in which the specified packages are available -export extern "nix shell" [ - --command(-c) #command args - --ignore-environment(-i) #Clear the entire environment (except those specified with --keep). - --keep(-k) #name - --unset(-u) #name - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +export complete [nix develop] [ + --build # Run the build phase. + --check # Run the check phase. + --command(-c): text # command args + --configure # Run the configure phase. + --ignore-environment(-i) # Clear the entire environment (except those specified with --keep). + --install # Run the install phase. + --installcheck # Run the installcheck phase. + --keep(-k): text # name + --phase # The stdenv phase to run (e.g. build or configure). + --profile: path # The profile to update. + --redirect # Redirect a store path to a mutable location. + --unpack # Run the unpack phase. + --unset(-u) # name + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--command --phase --build --check --configure --install --installcheck --unpack] + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#bundle an application so that it works outside of the Nix store -export extern "nix bundle" [ - --bundler #Use a custom bundler instead of the default (github:NixOS/bundlers). - --out-link(-o) #path - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +export complete [nix flake] [ + +] + +export complete [nix flake archive] [ + --dry-run # Show what this command would do without doing it. + --json # Produce output in JSON format, suitable for consumption by another program. + --to: text # URI of the destination Nix store + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#copy paths between Nix stores -export extern "nix copy" [ - --from #URL of the source Nix store. - --no-check-sigs #Do not require that paths are signed by trusted keys. - --substitute-on-destination(-s) #Whether to try substitutes on the destination store (only supported by SSH stores). - --to #URL of the destination Nix store. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --all #Apply the operation to every store path. - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - --no-recursive #Apply operation to specified paths only. - ...args: any # Arguments to be passed to your program -] +export complete [nix flake check] [ + --no-build # Do not build checks. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#open the Nix expression of a Nix package in $EDITOR -export extern "nix edit" [ - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +export complete [nix flake clone] [ + --dest(-f): path # path + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#evaluate a Nix expression -export extern "nix eval" [ - --apply #Apply the function expr to each argument. - --json #Produce output in JSON format, suitable for consumption by another program. - --raw #Print strings without quotes or escaping. - --read-only #Do not instantiate each evaluated derivation. This improves performance, but can cause - --write-to #Write a string or attrset of strings to path. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +export complete [nix flake info] [ + --json # Produce output in JSON format, suitable for consumption by another program. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#reformat your code in the standard style -export extern "nix fmt" [ - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +export complete [nix flake init] [ + --template(-t): nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # template + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + ...args: text # Arguments to be passed to your program +] + +export complete [nix flake lock] [ + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--recreate-lock-file --no-update-lock-file] +} -#show the build log of the specified packages or paths, if available -export extern "nix log" [ - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +export complete [nix flake metadata] [ + --json # Produce output in JSON format, suitable for consumption by another program. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#query information about store paths -export extern "nix path-info" [ - --closure-size(-S) #Print the sum of the sizes of the NAR serialisations of the closure of each path. - --human-readable(-h) #With -s and -S, print sizes in a human-friendly format such as 5.67G. - --json #Produce output in JSON format, suitable for consumption by another program. - --sigs #Show signatures. - --size(-s) #Print the size of the NAR serialisation of each path. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --all #Apply the operation to every store path. - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - --recursive(-r) #Apply operation to closure of the specified paths. - ...args: any # Arguments to be passed to your program -] +export complete [nix flake new] [ + --template(-t): nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # template + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + ...args: text # Arguments to be passed to your program +] + +export complete [nix flake prefetch] [ + --json # Produce output in JSON format, suitable for consumption by another program. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#manage the flake registry -export extern "nix registry" [ - ...args: any # Arguments to be passed to your program -] +export complete [nix flake show] [ + --json # Produce output in JSON format, suitable for consumption by another program. + --legacy # Show the contents of the legacyPackages output. + --all-systems # Show flake outputs for all systems, not just this one. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#add/replace flake in user flake registry -export extern "nix registry add" [ - --registry #The registry to operate on. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - ...args: any # Arguments to be passed to your program -] +export complete [nix flake update] [ + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] + +export complete [nix config] [ + +] + +export complete [nix config show] [ + --json # Produce output in JSON format, suitable for consumption by another program. + ...args: text # Arguments to be passed to your program +] + +export complete [nix help] [ + ...args: text # Arguments to be passed to your program +] + +export complete [nix profile] [ + +] + +export complete [nix profile diff-closures] [ + --profile: path # The profile to update. + ...args: text # Arguments to be passed to your program +] + +export complete [nix profile history] [ + --profile: path # The profile to update. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + ...args: text # Arguments to be passed to your program +] + +export complete [nix profile install] [ + --profile: path # The profile to update. + --priority: text # The priority of the package in the profile. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#list available Nix flakes -export extern "nix registry list" [ - ...args: any # Arguments to be passed to your program -] +export complete [nix profile list] [ + --json # Print the list as JSON. + --profile: path # The profile to update. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + ...args: text # Arguments to be passed to your program +] + +export complete [nix profile remove] [ + --profile: path # The profile to update. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + ...args: by "nu-complete nix profile elements" # Arguments to be passed to your program +] + +export complete [nix profile rollback] [ + --dry-run # Show what this command would do without doing it. + --profile: path # The profile to update. + --to: text # The profile version to roll back to. + ...args: text # Arguments to be passed to your program +] + +export complete [nix profile upgrade] [ + --profile: path # The profile to update. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: text # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: by "nu-complete nix profile elements" # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#pin a flake to its current version or to the current version of a flake -export extern "nix registry pin" [ - --registry #The registry to operate on. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - ...args: any # Arguments to be passed to your program -] +export complete [nix profile wipe-history] [ + --dry-run # Show what this command would do without doing it. + --older-than: text # Delete versions older than the specified age. age must be in the format Nd, where N denotes + --profile: path # The profile to update. + ...args: text # Arguments to be passed to your program +] + +export complete [nix repl] [ + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] + +export complete [nix run] [ + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#remove flake from user flake registry -export extern "nix registry remove" [ - --registry #The registry to operate on. - ...args: any # Arguments to be passed to your program -] +export complete [nix search] [ + --json # Produce output in JSON format, suitable for consumption by another program. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#show why a package has another package in its closure -export extern "nix why-depends" [ - --all(-a) #Show all edges in the dependency graph leading from package to dependency, rather than just - --precise #For each edge in the dependency graph, show the files in the parent that cause the - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +export complete [nix shell] [ + --command(-c): text # command args + --ignore-environment(-i) # Clear the entire environment (except those specified with --keep). + --keep(-k): text # name + --unset(-u) # name + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#daemon to perform store operations on behalf of non-root clients -export extern "nix daemon" [ - ...args: any # Arguments to be passed to your program -] +export complete [nix bundle] [ + --bundler # Use a custom bundler instead of the default (github:NixOS/bundlers). + --out-link(-o): path # path + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#show registered store types and their available options -export extern "nix describe-stores" [ - --json #Produce output in JSON format, suitable for consumption by another program. - ...args: any # Arguments to be passed to your program -] +export complete [nix copy] [ + --from: text # URL of the source Nix store. + --no-check-sigs # Do not require that paths are signed by trusted keys. + --substitute-on-destination(-s) # Whether to try substitutes on the destination store (only supported by SSH stores). + --to: text # URL of the destination Nix store. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --all # Apply the operation to every store path. + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + --no-recursive # Apply operation to specified paths only. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] + at-most-one [--to --from] +} -#compute and convert cryptographic hashes -export extern "nix hash" [ - ...args: any # Arguments to be passed to your program -] +export complete [nix edit] [ + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#print cryptographic hash of a regular file -export extern "nix hash file" [ - --base16 #Print the hash in base-16 format. - --base32 #Print the hash in base-32 (Nix-specific) format. - --base64 #Print the hash in base-64 format. - --sri #Print the hash in SRI format. - --type #hash algorithm ('md5', 'sha1', 'sha256', or 'sha512') - ...args: any # Arguments to be passed to your program -] +export complete [nix eval] [ + --apply # Apply the function expr to each argument. + --json # Produce output in JSON format, suitable for consumption by another program. + --raw # Print strings without quotes or escaping. + --read-only # Do not instantiate each evaluated derivation. This improves performance, but can cause + --write-to # Write a string or attrset of strings to path. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--json --raw --write-to] + requires --apply --expr + at-most-one [--expr --file] + at-most-one [--json --raw] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#print cryptographic hash of the NAR serialisation of a path -export extern "nix hash path" [ - --base16 #Print the hash in base-16 format. - --base32 #Print the hash in base-32 (Nix-specific) format. - --base64 #Print the hash in base-64 format. - --sri #Print the hash in SRI format. - --type #hash algorithm ('md5', 'sha1', 'sha256', or 'sha512') - ...args: any # Arguments to be passed to your program -] +export complete [nix fmt] [ + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#convert a hash to base-16 representation -export extern "nix hash to-base16" [ - --type #hash algorithm ('md5', 'sha1', 'sha256', or 'sha512'). Optional as can also be gotten from - ...args: any # Arguments to be passed to your program -] +export complete [nix log] [ + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#convert a hash to base-32 representation -export extern "nix hash to-base32" [ - --type #hash algorithm ('md5', 'sha1', 'sha256', or 'sha512'). Optional as can also be gotten from - ...args: any # Arguments to be passed to your program -] +export complete [nix path-info] [ + --closure-size(-S) # Print the sum of the sizes of the NAR serialisations of the closure of each path. + --human-readable(-h) # With -s and -S, print sizes in a human-friendly format such as 5.67G. + --json # Produce output in JSON format, suitable for consumption by another program. + --sigs # Show signatures. + --size(-s) # Print the size of the NAR serialisation of each path. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --all # Apply the operation to every store path. + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + --recursive(-r) # Apply operation to closure of the specified paths. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#convert a hash to base-64 representation -export extern "nix hash to-base64" [ - --type #hash algorithm ('md5', 'sha1', 'sha256', or 'sha512'). Optional as can also be gotten from - ...args: any # Arguments to be passed to your program -] +export complete [nix registry] [ + +] + +export complete [nix registry add] [ + --registry # The registry to operate on. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + ...args: text # Arguments to be passed to your program +] + +export complete [nix registry list] [ + ...args: text # Arguments to be passed to your program +] + +export complete [nix registry pin] [ + --registry # The registry to operate on. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] + +export complete [nix registry remove] [ + --registry # The registry to operate on. + ...args: by "nu-complete nix registry entries" # Arguments to be passed to your program +] + +export complete [nix why-depends] [ + --all(-a) # Show all edges in the dependency graph leading from package to dependency, rather than just + --precise # For each edge in the dependency graph, show the files in the parent that cause the + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#convert a hash to SRI representation -export extern "nix hash to-sri" [ - --type #hash algorithm ('md5', 'sha1', 'sha256', or 'sha512'). Optional as can also be gotten from - ...args: any # Arguments to be passed to your program +export complete [nix daemon] [ + --stdio # Attach to standard I/O instead of a Unix socket. + ...args: text # Arguments to be passed to your program ] -#generate and convert Nix signing keys -export extern "nix key" [ - ...args: any # Arguments to be passed to your program +export complete [nix describe-stores] [ + --json # Produce output in JSON format, suitable for consumption by another program. + ...args: text # Arguments to be passed to your program ] -#generate a public key for verifying store paths from a -export extern "nix key convert-secret-to-public" [ - ...args: any # Arguments to be passed to your program -] +export complete [nix hash] [ -#generate a secret key for signing store paths -export extern "nix key generate-secret" [ - --key-name #Identifier of the key (e.g. cache.example.org-1). - ...args: any # Arguments to be passed to your program ] -#create or inspect NAR files -export extern "nix nar" [ - ...args: any # Arguments to be passed to your program +export complete [nix hash file] [ + --base16 # Print the hash in base-16 format. + --base32 # Print the hash in base-32 (Nix-specific) format. + --base64 # Print the hash in base-64 format. + --sri # Print the hash in SRI format. + --type: words ["md5" "sha1" "sha256" "sha512"] # hash algorithm ('md5', 'sha1', 'sha256', or 'sha512') + ...args: text # Arguments to be passed to your program ] -#print the contents of a file inside a NAR file on stdout -export extern "nix nar cat" [ - ...args: any # Arguments to be passed to your program +export complete [nix hash path] [ + --base16 # Print the hash in base-16 format. + --base32 # Print the hash in base-32 (Nix-specific) format. + --base64 # Print the hash in base-64 format. + --sri # Print the hash in SRI format. + --type: words ["md5" "sha1" "sha256" "sha512"] # hash algorithm ('md5', 'sha1', 'sha256', or 'sha512') + ...args: text # Arguments to be passed to your program ] -#serialise a path to stdout in NAR format -export extern "nix nar dump-path" [ - ...args: any # Arguments to be passed to your program +export complete [nix hash to-base16] [ + --type: words ["md5" "sha1" "sha256" "sha512"] # hash algorithm ('md5', 'sha1', 'sha256', or 'sha512'). Optional as can also be gotten from + ...args: text # Arguments to be passed to your program ] -#show information about a path inside a NAR file -export extern "nix nar ls" [ - --directory(-d) #Show directories rather than their contents. - --json #Produce output in JSON format, suitable for consumption by another program. - --long(-l) #Show detailed file information. - --recursive(-R) #List subdirectories recursively. - ...args: any # Arguments to be passed to your program +export complete [nix hash to-base32] [ + --type: words ["md5" "sha1" "sha256" "sha512"] # hash algorithm ('md5', 'sha1', 'sha256', or 'sha512'). Optional as can also be gotten from + ...args: text # Arguments to be passed to your program ] -#print shell code that can be sourced by bash to reproduce the build -export extern "nix print-dev-env" [ - --json #Produce output in JSON format, suitable for consumption by another program. - --profile #The profile to update. - --redirect #Redirect a store path to a mutable location. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program +export complete [nix hash to-base64] [ + --type: words ["md5" "sha1" "sha256" "sha512"] # hash algorithm ('md5', 'sha1', 'sha256', or 'sha512'). Optional as can also be gotten from + ...args: text # Arguments to be passed to your program ] -#manipulate a Nix realisation -export extern "nix realisation" [ - ...args: any # Arguments to be passed to your program +export complete [nix hash to-sri] [ + --type: words ["md5" "sha1" "sha256" "sha512"] # hash algorithm ('md5', 'sha1', 'sha256', or 'sha512'). Optional as can also be gotten from + ...args: text # Arguments to be passed to your program ] -#query information about one or several realisations -export extern "nix realisation info" [ - --json #Produce output in JSON format, suitable for consumption by another program. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --all #Apply the operation to every store path. - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - --recursive(-r) #Apply operation to closure of the specified paths. - ...args: any # Arguments to be passed to your program -] +export complete [nix key] [ -#show the Nix configuration -export extern "nix show-config" [ - --json #Produce output in JSON format, suitable for consumption by another program. - ...args: any # Arguments to be passed to your program ] -#show the contents of a store derivation -export extern "nix show-derivation" [ - --recursive(-r) #Include the dependencies of the specified derivations. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program +export complete [nix key convert-secret-to-public] [ + ...args: text # Arguments to be passed to your program ] -#manipulate a Nix store -export extern "nix store" [ - ...args: any # Arguments to be passed to your program +export complete [nix key generate-secret] [ + --key-name # Identifier of the key (e.g. cache.example.org-1). + ...args: text # Arguments to be passed to your program ] -#add a regular file to the Nix store -export extern "nix store add-file" [ - --dry-run #Show what this command would do without doing it. - --name(-n) #name - ...args: any # Arguments to be passed to your program -] +export complete [nix nar] [ -#add a path to the Nix store -export extern "nix store add-path" [ - --dry-run #Show what this command would do without doing it. - --name(-n) #name - ...args: any # Arguments to be passed to your program ] -#print the contents of a file in the Nix store on stdout -export extern "nix store cat" [ - ...args: any # Arguments to be passed to your program +export complete [nix nar cat] [ + ...args: text # Arguments to be passed to your program ] -#copy store path signatures from substituters -export extern "nix store copy-sigs" [ - --substituter(-s) #store-uri - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --all #Apply the operation to every store path. - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - --recursive(-r) #Apply operation to closure of the specified paths. - ...args: any # Arguments to be passed to your program +export complete [nix nar dump-path] [ + ...args: text # Arguments to be passed to your program ] -#delete paths from the Nix store -export extern "nix store delete" [ - --ignore-liveness #Do not check whether the paths are reachable from a root. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --all #Apply the operation to every store path. - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - --recursive(-r) #Apply operation to closure of the specified paths. - ...args: any # Arguments to be passed to your program +export complete [nix nar ls] [ + --directory(-d) # Show directories rather than their contents. + --json # Produce output in JSON format, suitable for consumption by another program. + --long(-l) # Show detailed file information. + --recursive(-R) # List subdirectories recursively. + ...args: text # Arguments to be passed to your program ] -#show what packages and versions were added and removed between -export extern "nix store diff-closures" [ - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +export complete [nix print-dev-env] [ + --json # Produce output in JSON format, suitable for consumption by another program. + --profile: path # The profile to update. + --redirect # Redirect a store path to a mutable location. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#serialise a store path to stdout in NAR format -export extern "nix store dump-path" [ - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --all #Apply the operation to every store path. - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - --recursive(-r) #Apply operation to closure of the specified paths. - ...args: any # Arguments to be passed to your program -] +export complete [nix realisation] [ + +] + +export complete [nix realisation info] [ + --json # Produce output in JSON format, suitable for consumption by another program. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --all # Apply the operation to every store path. + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + --recursive(-r) # Apply operation to closure of the specified paths. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#perform garbage collection on a Nix store -export extern "nix store gc" [ - --dry-run #Show what this command would do without doing it. - --max #Stop after freeing n bytes of disk space. - ...args: any # Arguments to be passed to your program -] +export complete [nix show-config] [ + --json # Produce output in JSON format, suitable for consumption by another program. + ...args: text # Arguments to be passed to your program +] + +export complete [nix show-derivation] [ + --recursive(-r) # Include the dependencies of the specified derivations. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#show information about a path in the Nix store -export extern "nix store ls" [ - --directory(-d) #Show directories rather than their contents. - --json #Produce output in JSON format, suitable for consumption by another program. - --long(-l) #Show detailed file information. - --recursive(-R) #List subdirectories recursively. - ...args: any # Arguments to be passed to your program -] +export complete [nix store] [ + +] + +export complete [nix store add-file] [ + --dry-run # Show what this command would do without doing it. + --name(-n): text # name + ...args: text # Arguments to be passed to your program +] + +export complete [nix store add-path] [ + --dry-run # Show what this command would do without doing it. + --name(-n): text # name + ...args: text # Arguments to be passed to your program +] + +export complete [nix store cat] [ + ...args: text # Arguments to be passed to your program +] + +export complete [nix store copy-sigs] [ + --substituter(-s): text # store-uri + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --all # Apply the operation to every store path. + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + --recursive(-r) # Apply operation to closure of the specified paths. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#rewrite a path or closure to content-addressed form -export extern "nix store make-content-addressed" [ - --from #URL of the source Nix store. - --json #Produce output in JSON format, suitable for consumption by another program. - --to #URL of the destination Nix store. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --all #Apply the operation to every store path. - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - --recursive(-r) #Apply operation to closure of the specified paths. - ...args: any # Arguments to be passed to your program -] +export complete [nix store delete] [ + --ignore-liveness # Do not check whether the paths are reachable from a root. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --all # Apply the operation to every store path. + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + --recursive(-r) # Apply operation to closure of the specified paths. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#replace identical files in the store by hard links -export extern "nix store optimise" [ - ...args: any # Arguments to be passed to your program -] +export complete [nix store diff-closures] [ + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: text # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: text # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#test whether a store can be accessed -export extern "nix store ping" [ - ...args: any # Arguments to be passed to your program -] +export complete [nix store dump-path] [ + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --all # Apply the operation to every store path. + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + --recursive(-r) # Apply operation to closure of the specified paths. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#download a file into the Nix store -export extern "nix store prefetch-file" [ - --executable #Make the resulting file executable. Note that this causes the resulting hash to be a NAR - --expected-hash #The expected hash of the file. - --hash-type #hash algorithm ('md5', 'sha1', 'sha256', or 'sha512') - --json #Produce output in JSON format, suitable for consumption by another program. - --name #Override the name component of the resulting store path. It defaults to the base name of - ...args: any # Arguments to be passed to your program -] +export complete [nix store gc] [ + --dry-run # Show what this command would do without doing it. + --max: text # Stop after freeing n bytes of disk space. + ...args: text # Arguments to be passed to your program +] + +export complete [nix store ls] [ + --directory(-d) # Show directories rather than their contents. + --json # Produce output in JSON format, suitable for consumption by another program. + --long(-l) # Show detailed file information. + --recursive(-R) # List subdirectories recursively. + ...args: text # Arguments to be passed to your program +] + +export complete [nix store make-content-addressed] [ + --from: text # URL of the source Nix store. + --json # Produce output in JSON format, suitable for consumption by another program. + --to: text # URL of the destination Nix store. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --all # Apply the operation to every store path. + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + --recursive(-r) # Apply operation to closure of the specified paths. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] + at-most-one [--to --from] +} -#repair store paths -export extern "nix store repair" [ - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --all #Apply the operation to every store path. - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - --recursive(-r) #Apply operation to closure of the specified paths. - ...args: any # Arguments to be passed to your program -] +export complete [nix store optimise] [ + ...args: text # Arguments to be passed to your program +] + +export complete [nix store ping] [ + --json # Print the result as JSON + ...args: text # Arguments to be passed to your program +] + +export complete [nix store path-from-hash-part] [ + hash_part: text # The hash part of the store path + --store: text # The store to query +] + +export complete [nix store prefetch-file] [ + --executable # Make the resulting file executable. Note that this causes the resulting hash to be a NAR + --expected-hash # The expected hash of the file. + --hash-type: words ["md5" "sha1" "sha256" "sha512"] # hash algorithm ('md5', 'sha1', 'sha256', or 'sha512') + --json # Produce output in JSON format, suitable for consumption by another program. + --name: text # Override the name component of the resulting store path. It defaults to the base name of the file. + --unpack # Unpack the archive into the store. + ...args: text # Arguments to be passed to your program +] + +export complete [nix store repair] [ + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --all # Apply the operation to every store path. + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + --recursive(-r) # Apply operation to closure of the specified paths. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#sign store paths -export extern "nix store sign" [ - --key-file(-k) #file - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --all #Apply the operation to every store path. - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - --recursive(-r) #Apply operation to closure of the specified paths. - ...args: any # Arguments to be passed to your program -] +export complete [nix store sign] [ + --key-file(-k): path # file + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --all # Apply the operation to every store path. + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + --recursive(-r) # Apply operation to closure of the specified paths. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#verify the integrity of store paths -export extern "nix store verify" [ - --no-contents #Do not verify the contents of each store path. - --no-trust #Do not verify whether each store path is trusted. - --sigs-needed(-n) #n - --substituter(-s) #store-uri - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --all #Apply the operation to every store path. - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - --recursive(-r) #Apply operation to closure of the specified paths. - ...args: any # Arguments to be passed to your program -] +export complete [nix store verify] [ + --no-contents # Do not verify the contents of each store path. + --no-trust # Do not verify whether each store path is trusted. + --sigs-needed(-n) # n + --substituter(-s): text # store-uri + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --all # Apply the operation to every store path. + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + --recursive(-r) # Apply operation to closure of the specified paths. + ...args: nix.flakeref with { root.flake: by "nu-complete nix flakes" root.attr: by "nu-complete nix flake attrs" } # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] +} -#copy build logs between Nix stores -export extern "nix store copy-log" [ - --from #URL of the source Nix store. - --to #URL of the destination Nix store. - --arg #Pass the value expr as the argument name to Nix functions. - --argstr #Pass the string string as the argument name to Nix functions. - --eval-store #The Nix store to use for evaluations. - --impure #Allow access to mutable paths and repositories. - --include(-I) #path - --override-flake #Override the flake registries, redirecting original-ref to resolved-ref. - --commit-lock-file #Commit changes to the flake's lock file. - --inputs-from #Use the inputs of the specified flake as registry entries. - --no-registries #Don't allow lookups in the flake registries. This option is deprecated; use - --no-update-lock-file #Do not allow any updates to the flake's lock file. - --no-write-lock-file #Do not write the flake's newly generated lock file. - --override-input #Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. - --recreate-lock-file #Recreate the flake's lock file from scratch. - --update-input #Update a specific flake input (ignoring its previous entry in the lock file). - --derivation #Operate on the store derivation rather than its outputs. - --expr #Interpret installables as attribute paths relative to the Nix expression expr. - --file(-f) #file - ...args: any # Arguments to be passed to your program -] +export complete [nix store copy-log] [ + --from: text # URL of the source Nix store. + --to: text # URL of the destination Nix store. + --arg: text # Pass the value expr as the argument name to Nix functions. + --argstr: text # Pass the string string as the argument name to Nix functions. + --eval-store: text # The Nix store to use for evaluations. + --impure # Allow access to mutable paths and repositories. + --include(-I): path # path + --override-flake: text # Override the flake registries, redirecting original-ref to resolved-ref. + --commit-lock-file # Commit changes to the flake's lock file. + --inputs-from: text # Use the inputs of the specified flake as registry entries. + --no-registries # Don't allow lookups in the flake registries. This option is deprecated; use + --no-update-lock-file # Do not allow any updates to the flake's lock file. + --no-write-lock-file # Do not write the flake's newly generated lock file. + --override-input: text # Override a specific flake input (e.g. dwarffs/nixpkgs). This implies --no-write-lock-file. + --recreate-lock-file # Recreate the flake's lock file from scratch. + --update-input: text # Update a specific flake input (ignoring its previous entry in the lock file). + --derivation # Operate on the store derivation rather than its outputs. + --expr: text # Interpret installables as attribute paths relative to the Nix expression expr. + --file(-f): path # file + ...args: text # Arguments to be passed to your program +] where { + at-most-one [--expr --file] + at-most-one [--recreate-lock-file --no-update-lock-file] + at-most-one [--no-write-lock-file --commit-lock-file] + at-most-one [--to --from] +} -#check your system for potential problems and print a PASS or FAIL for each -export extern "nix doctor" [ - ...args: any # Arguments to be passed to your program +export complete [nix doctor] [ + ...args: text # Arguments to be passed to your program ] -#upgrade Nix to the latest stable version -export extern "nix upgrade-nix" [ - --dry-run #Show what this command would do without doing it. - --nix-store-paths-url #The URL of the file that contains the store paths of the latest Nix release. - --profile(-p) #profile-dir - ...args: any # Arguments to be passed to your program +export complete [nix upgrade-nix] [ + --dry-run # Show what this command would do without doing it. + --nix-store-paths-url # The URL of the file that contains the store paths of the latest Nix release. + --profile(-p): text # profile-dir + ...args: text # Arguments to be passed to your program ] diff --git a/custom-completions/npm/npm-completions.nu b/custom-completions/npm/npm-completions.nu index 41d61cf53..34f8ce6e9 100644 --- a/custom-completions/npm/npm-completions.nu +++ b/custom-completions/npm/npm-completions.nu @@ -1,40 +1,336 @@ -def "nu-complete npm" [] { - let db = stor open +# npm — the Node.js package manager. Declarative completions (`export complete`). +# The scripts of ./package.json, one row each: `name` and `command`. Reads only. +@non-destructive +export def npm-scripts []: nothing -> table<name: string, command: string> { + try { open ./package.json | get scripts | transpose name command } catch { [] } +} + +# The dependencies of ./package.json, one row each: `name`, `version` (the range asked for) and +# `kind` (`dependencies`, `devDependencies`, ...). Reads only. +@non-destructive +export def npm-dependencies []: nothing -> table<name: string, version: string, kind: string> { try { - # query commanders from in-mem db - $db | query db "SELECT * FROM npm_commanders_table" - } catch { - # if catched error, create table and insert all data - stor create --table-name npm_commanders_table --columns { value: str, description: str } - - let npm_commanders = ^npm -l - | lines - | where $it =~ '\s{4}[a-z\-]+.*\s{4,}' - | parse -r '\s*(?P<value>[^ ]+)\s*(?P<description>\w.*)' - - $npm_commanders | stor insert --table-name npm_commanders_table - - $npm_commanders - } -} - -export extern "npm" [ - command?: string@"nu-complete npm" -] - -def "nu-complete npm run" [] { - open ./package.json - | get scripts - | transpose - | rename value description -} - -export extern "npm run" [ - command?: string@"nu-complete npm run" - --workspace(-w) - --include-workspace-root - --if-present - --ignore-scripts - --script-shell -] + let manifest = open ./package.json + ['dependencies' 'devDependencies' 'peerDependencies' 'optionalDependencies'] + | where {|kind| $kind in ($manifest | columns) } + | each {|kind| $manifest | get $kind | transpose name version | insert kind $kind } + | flatten + } catch { [] } +} + +# Scripts of package.json, with the command they run. +@non-destructive +export def "nu-complete npm run" [] { + try { npm-scripts | each {|s| {value: $s.name, description: $s.command} } } catch { [] } +} + +# Dependencies of package.json, with their range and kind. +@non-destructive +export def "nu-complete npm dependencies" [] { + try { npm-dependencies | each {|d| {value: $d.name, description: $"($d.version) · ($d.kind)"} } } catch { [] } +} + +# Workspaces declared in package.json (names of the packages they contain, or their globs). +@non-destructive +export def "nu-complete npm workspaces" [] { + try { + open ./package.json | get -o workspaces | default [] | each {|w| glob $w } | flatten + | each {|dir| try { open ($dir | path join package.json) | get name } catch { $dir | path relative-to $env.PWD } } + } catch { [] } +} + +# Binaries of node_modules/.bin, for `npm exec`. +@non-destructive +export def "nu-complete npm bins" [] { + try { ls node_modules/.bin | get name | path basename } catch { [] } +} + +# Configuration keys known to `npm config list`. +@non-destructive +export def "nu-complete npm config keys" [] { + try { ^npm config list --json | from json | columns } catch { [registry prefix cache init-author-name init-license save-exact] } +} + +export complete [npm] [ + --version(-v) # Print npm's version + --help(-h) # Print usage + --loglevel: words [silent error warn notice http info verbose silly] # Log level + --silent # Alias for --loglevel silent + --prefix: dir cwd # Location to install global items / run in + --workspace(-w): by "nu-complete npm workspaces" # Run the command in the given workspace + --workspaces # Run the command in all configured workspaces + --registry: text # The base URL of the npm registry + --userconfig: path # Location of the user-level configuration file + --color: words [always true false] # Use colors in output +] where { + at-most-one [--loglevel --silent] + at-most-one [--workspace --workspaces] + terminal [--help --version] +} + +export complete [npm install] [ + ...package: text # <pkg>[@<version>|@<tag>], a folder, tarball or git url + --save(-S) # Save to dependencies (default) + --no-save # Don't save to package.json + --save-prod(-P) # Save to dependencies + --save-dev(-D) # Save to devDependencies + --save-optional(-O) # Save to optionalDependencies + --save-peer # Save to peerDependencies + --save-exact(-E) # Save an exact version + --save-bundle(-B) # Also save to bundleDependencies + --global(-g) # Install globally + --omit: words [dev optional peer] # Dependency types to omit from the installation tree + --include: words [prod dev optional peer] # Dependency types to include + --install-strategy: words [hoisted nested shallow linked] # How to lay out node_modules + --legacy-peer-deps # Ignore peerDependencies entirely + --strict-peer-deps # Fail on conflicting peerDependencies + --prefer-offline # Prefer cached data over the network + --prefer-online # Force staleness checks for cached data + --offline # Never hit the network + --ignore-scripts # Don't run package.json scripts + --no-package-lock # Ignore package-lock.json + --package-lock-only # Only update package-lock.json + --dry-run # Report what would be done + --force(-f) # Override safety checks + --workspace(-w): by "nu-complete npm workspaces" # Install into the given workspace + --workspaces # Install into all workspaces + --audit # Submit audit reports + --no-audit # Don't submit audit reports + --fund # Show funding notice + --no-fund # Hide funding notice + --help(-h) # Print usage +] where { + at-most-one [--save --no-save --save-prod --save-dev --save-optional --save-peer] + at-most-one [--legacy-peer-deps --strict-peer-deps] + at-most-one [--prefer-offline --prefer-online --offline] + at-most-one [--no-package-lock --package-lock-only] + at-most-one [--global --workspace --workspaces] + overrides [--audit --no-audit] + overrides [--fund --no-fund] + terminal [--help] +} + +export complete [npm ci] [ + --omit: words [dev optional peer] # Dependency types to omit + --include: words [prod dev optional peer] # Dependency types to include + --ignore-scripts # Don't run package.json scripts + --legacy-peer-deps # Ignore peerDependencies entirely + --strict-peer-deps # Fail on conflicting peerDependencies + --workspace(-w): by "nu-complete npm workspaces" + --workspaces # Install into all workspaces + --no-audit # Don't submit audit reports + --no-fund # Hide funding notice + --help(-h) # Print usage +] where { + at-most-one [--legacy-peer-deps --strict-peer-deps] + terminal [--help] +} + +export complete [npm uninstall] [ + ...package: by "nu-complete npm dependencies" + --save-dev(-D) # Remove from devDependencies + --save-optional(-O) # Remove from optionalDependencies + --no-save # Don't touch package.json + --global(-g) # Remove a globally installed package + --workspace(-w): by "nu-complete npm workspaces" + --workspaces # Uninstall from all workspaces + --help(-h) # Print usage +] where { + at-most-one [--global --workspace --workspaces] + terminal [--help] +} + +export complete [npm update] [ + ...package: by "nu-complete npm dependencies" + --global(-g) # Update globally installed packages + --save # Save the new versions to package.json + --omit: words [dev optional peer] # Dependency types to omit + --workspace(-w): by "nu-complete npm workspaces" + --workspaces # Update all workspaces + --dry-run # Report what would be done + --help(-h) # Print usage +] where { terminal [--help] } + +export complete [npm outdated] [ + ...package: by "nu-complete npm dependencies" + --all(-a) # Show all outdated or installed packages + --json # Output JSON + --long(-l) # Show extended information + --parseable(-p) # Output parseable results + --global(-g) # Check globally installed packages + --help(-h) # Print usage +] where { + at-most-one [--json --parseable] + terminal [--help] +} + +export complete [npm ls] [ + ...package: by "nu-complete npm dependencies" + --all(-a) # List the whole dependency tree + --depth: text # Limit the depth of the tree + --global(-g) # List the globally installed packages + --json # Output JSON + --long(-l) # Show extended information + --parseable(-p) # Output parseable results + --omit: words [dev optional peer] # Dependency types to omit + --link # Only list linked dependencies + --help(-h) # Print usage +] where { + at-most-one [--all --depth] + at-most-one [--json --parseable] + terminal [--help] +} + +export complete [npm list] [ + ...package: by "nu-complete npm dependencies" + --all(-a) # List the whole dependency tree + --depth: text # Limit the depth of the tree + --global(-g) # List the globally installed packages + --json # Output JSON + --long(-l) # Show extended information + --parseable(-p) # Output parseable results + --omit: words [dev optional peer] # Dependency types to omit + --help(-h) # Print usage +] where { + at-most-one [--all --depth] + at-most-one [--json --parseable] + terminal [--help] +} + +export complete [npm run] [ + script?: by "nu-complete npm run" # The package.json script to run + ...args: text # Arguments passed to the script (after `--`) + --workspace(-w): by "nu-complete npm workspaces" # Run in the given workspace + --workspaces # Run in all workspaces + --include-workspace-root # Include the workspace root + --if-present # Don't fail when the script is missing + --ignore-scripts # Don't run pre/post scripts + --script-shell: path # The shell to run scripts with + --silent # Don't log npm's banner + --help(-h) # Print usage +] where { + at-most-one [--workspace --workspaces] + requires --include-workspace-root --workspaces + terminal [--help] +} + +export complete [npm run-script] [ + script?: by "nu-complete npm run" # The package.json script to run + ...args: text + --workspace(-w): by "nu-complete npm workspaces" + --workspaces # Run in all workspaces + --if-present # Don't fail when the script is missing + --help(-h) # Print usage +] where { terminal [--help] } + +export complete [npm test] [ ...args: text --ignore-scripts --script-shell: path --help(-h) ] where { terminal [--help] } +export complete [npm start] [ ...args: text --ignore-scripts --script-shell: path --help(-h) ] where { terminal [--help] } +export complete [npm stop] [ ...args: text --help(-h) ] where { terminal [--help] } +export complete [npm restart] [ ...args: text --help(-h) ] where { terminal [--help] } + +export complete [npm exec] [ + ...command: by "nu-complete npm bins" # The command (and its arguments) to run + --package: text # The package(s) to install before running + --call(-c): text # A script string to run + --yes(-y) # Install missing packages without prompting + --no # Refuse to install missing packages + --workspace(-w): by "nu-complete npm workspaces" + --workspaces # Run in all workspaces + --help(-h) # Print usage +] where { + at-most-one [--yes --no] + terminal [--help] +} + +export complete [npm init] [ + initializer?: text # create-<initializer> package to use (e.g. vite) + --yes(-y) # Answer yes to every question + --force(-f) # Override safety checks + --scope: text # Scope for the new package + --workspace(-w): dir # Create the package in a new workspace + --help(-h) # Print usage +] where { terminal [--help] } + +export complete [npm publish] [ + folder?: dir # Folder or tarball to publish + --tag: text # Register the package under the given dist-tag + --access: words [public restricted] # Set the access level of the published package + --dry-run # Report what would be published without publishing + --otp: text # One-time password from a two-factor authenticator + --provenance # Link the package to its build with provenance + --workspace(-w): by "nu-complete npm workspaces" + --workspaces # Publish all workspaces + --help(-h) # Print usage +] where { terminal [--help] } + +export complete [npm pack] [ + ...package: text + --dry-run # Report what would be packed + --json # Output JSON + --pack-destination: dir # Directory in which to save the tarball + --help(-h) # Print usage +] where { terminal [--help] } + +export complete [npm audit] [ + --json # Output JSON + --audit-level: words [info low moderate high critical] # Minimum level to exit non-zero + --omit: words [dev optional peer] # Dependency types to omit + --dry-run # Report what would be fixed + --force # Allow breaking fixes + --package-lock-only # Only use package-lock.json + --help(-h) # Print usage +] where { terminal [--help] } +export complete [npm audit fix] [ --force --dry-run --package-lock-only --help(-h) ] where { terminal [--help] } +export complete [npm audit signatures] [ --json --help(-h) ] where { terminal [--help] } + +export complete [npm link] [ ...package: text --global(-g) --save --help(-h) ] where { terminal [--help] } +export complete [npm unlink] [ ...package: by "nu-complete npm dependencies" --help(-h) ] where { terminal [--help] } +export complete [npm prune] [ ...package: text --omit: words [dev optional peer] --dry-run --json --help(-h) ] where { terminal [--help] } +export complete [npm dedupe] [ --dry-run --help(-h) ] where { terminal [--help] } +export complete [npm rebuild] [ ...package: by "nu-complete npm dependencies" --help(-h) ] where { terminal [--help] } +export complete [npm explain] [ ...package: by "nu-complete npm dependencies" --json --help(-h) ] where { terminal [--help] } +export complete [npm why] [ ...package: by "nu-complete npm dependencies" --json --help(-h) ] where { terminal [--help] } +export complete [npm fund] [ package?: by "nu-complete npm dependencies" --json --browser: text --help(-h) ] where { terminal [--help] } +export complete [npm view] [ package?: by "nu-complete npm dependencies" ...field: text --json --help(-h) ] where { terminal [--help] } +export complete [npm info] [ package?: by "nu-complete npm dependencies" ...field: text --json --help(-h) ] where { terminal [--help] } +export complete [npm search] [ ...term: text --long(-l) --json --parseable(-p) --searchlimit: text --help(-h) ] where { terminal [--help] } +export complete [npm docs] [ ...package: by "nu-complete npm dependencies" --browser: text --help(-h) ] where { terminal [--help] } +export complete [npm repo] [ ...package: by "nu-complete npm dependencies" --browser: text --help(-h) ] where { terminal [--help] } +export complete [npm root] [ --global(-g) --help(-h) ] where { terminal [--help] } +export complete [npm prefix] [ --global(-g) --help(-h) ] where { terminal [--help] } +export complete [npm doctor] [ --help(-h) ] where { terminal [--help] } +export complete [npm login] [ --registry: text --scope: text --auth-type: words [web legacy] --help(-h) ] where { terminal [--help] } +export complete [npm logout] [ --registry: text --scope: text --help(-h) ] where { terminal [--help] } +export complete [npm whoami] [ --registry: text --help(-h) ] where { terminal [--help] } +export complete [npm help] [ term?: words [install ci run test exec init publish pack audit config ls outdated update uninstall link view search cache version] ] + +export complete [npm version] [ + newversion?: words [major minor patch premajor preminor prepatch prerelease from-git] + --preid: text # Prerelease identifier (e.g. beta) + --no-git-tag-version # Don't commit or tag + --allow-same-version # Allow setting the current version + --sign-git-tag # GPG-sign the tag + --message(-m): text # Commit message (%s is the version) + --workspace(-w): by "nu-complete npm workspaces" + --workspaces # Version all workspaces + --help(-h) # Print usage +] where { terminal [--help] } + +export complete [npm config] [ --help(-h) ] where { terminal [--help] } +export complete [npm config get] [ ...key: by "nu-complete npm config keys" --global(-g) --location: words [global user project] ] +export complete [npm config set] [ ...pair: text --global(-g) --location: words [global user project] ] +export complete [npm config delete] [ ...key: by "nu-complete npm config keys" --global(-g) --location: words [global user project] ] +export complete [npm config list] [ --json --long(-l) --global(-g) ] +export complete [npm config edit] [ --global(-g) --location: words [global user project] ] + +export complete [npm cache] [ --help(-h) ] where { terminal [--help] } +export complete [npm cache clean] [ --force ] +export complete [npm cache verify] [] +export complete [npm cache ls] [ ...spec: text ] + +export complete [npm pkg] [ --help(-h) ] where { terminal [--help] } +export complete [npm pkg get] [ ...field: text --json --workspace(-w): by "nu-complete npm workspaces" ] +export complete [npm pkg set] [ ...pair: text --json --workspace(-w): by "nu-complete npm workspaces" ] +export complete [npm pkg delete] [ ...field: text --workspace(-w): by "nu-complete npm workspaces" ] +export complete [npm pkg fix] [ --workspace(-w): by "nu-complete npm workspaces" ] diff --git a/custom-completions/op/op-completions.nu b/custom-completions/op/op-completions.nu index 492117d0b..eac45d710 100644 --- a/custom-completions/op/op-completions.nu +++ b/custom-completions/op/op-completions.nu @@ -1,2215 +1,1978 @@ # many of the completions run op commands in the background which may prompt additional verification/unlocks # an OP_ACCOUNT environment variable is recommended to avoid this +# `a,b,c` values: each element completes from the same provider. +export syntax op.list over chars { + root = item: until "," ("," item: until ",")* +} + +# `--vault <vault>:<permission>,<permission>` for `op connect server create` and friends. +export syntax op.vault-grant over chars { + root = vault: until ":" (":" perm: until "," ("," perm: until ",")*)? +} + +# Secret references: `op://<vault>/<item>[/<section>]/<field>`. +export syntax op.reference over chars { + root = "op://" vault: until "/" "/" item: until "/" "/" field: until "?" ("?" attr: until "")? +} + +def op-json [...args: string] { + ^op ...$args --format json | from json +} + +@non-destructive +export def "nu-complete op account" [] { + try { op-json account list | each {|a| {value: ($a.shorthand? | default $a.account_uuid), description: $a.email} } } catch { [] } +} + +@non-destructive +export def "nu-complete op vault" [] { + try { op-json vault list | each {|v| {value: $v.name, description: $v.id} } } catch { [] } +} + +@non-destructive +export def "nu-complete op group" [] { + try { op-json group list | each {|g| {value: $g.name, description: $"($g.state?) ($g.description? | default '')"} } } catch { [] } +} + +@non-destructive +export def "nu-complete op server" [] { + try { op-json connect server list | each {|s| {value: $s.name, description: $s.id} } } catch { [] } +} + +@non-destructive +export def "nu-complete op user" [] { + try { op-json user list | each {|u| {value: $u.email, description: $"($u.name) \(($u.type) - ($u.state)\)"} } } catch { [] } +} + +@non-destructive +export def "nu-complete op item" [] { + try { op-json item list | each {|i| {value: $i.title, description: $"($i.category) in ($i.vault.name? | default '')"} } } catch { [] } +} + +@non-destructive +export def "nu-complete op document" [] { + try { op-json document list | each {|i| {value: $i.title, description: $i.id} } } catch { [] } +} + +@non-destructive +export def "nu-complete op tag" [] { + try { op-json item list | get -o tags | flatten | compact | uniq | sort } catch { [] } +} + +@non-destructive +export def "nu-complete op plugin-name" [] { + try { op-json plugin list | get plugin_name | uniq } catch { [] } +} + +@non-destructive +export def "nu-complete op plugin-executable" [] { + try { op-json plugin list | get executable | uniq } catch { [] } +} + +@non-destructive +export def "nu-complete op categories" [] { + try { + ["API Credential" "Bank Account" "Credit Card" Database Document "Driver License" "Email Account" Identity Login + Membership "Outdoor License" Passport Password "Reward Program" "Secure Note" Server "Social Security Number" + "Software License" "SSH Key" "Wireless Router"] + } catch { [] } +} + +@non-destructive +export def "nu-complete op vault-permission" [] { + try { + [ + {value: read_items, description: "READ"} + {value: write_items, description: "WRITE: requires read_items"} + {value: share_items, description: "SHARE: requires read_items"} + ] + } catch { [] } +} + +@non-destructive +export def "nu-complete op permission" [] { + try { + [ + {value: allow_viewing, description: "View, copy and see history"} + {value: allow_editing, description: "Create, edit, archive, delete, import, export, share and print"} + {value: allow_managing, description: "Manage the vault"} + {value: view_items, description: "ALLOW_VIEWING: 1Password Business only"} + {value: view_and_copy_passwords, description: "ALLOW_VIEWING: 1Password Business only"} + {value: view_item_history, description: "ALLOW_VIEWING: 1Password Business only"} + {value: create_items, description: "ALLOW_EDITING: 1Password Business only"} + {value: edit_items, description: "ALLOW_EDITING: 1Password Business only"} + {value: archive_items, description: "ALLOW_EDITING: 1Password Business only"} + {value: delete_items, description: "ALLOW_EDITING: 1Password Business only"} + {value: import_items, description: "ALLOW_EDITING: 1Password Business only"} + {value: export_items, description: "ALLOW_EDITING: 1Password Business only"} + {value: copy_and_share_items, description: "ALLOW_EDITING: 1Password Business only"} + {value: print_items, description: "ALLOW_EDITING: 1Password Business only"} + {value: manage_vault, description: "ALLOW_MANAGING: 1Password Business only"} + ] + } catch { [] } +} + +@non-destructive +export def "nu-complete op feature" [] { + try { [signinattempts itemusages auditevents] } catch { [] } +} + +@non-destructive +export def "nu-complete op password-recipe" [] { + try { [letters digits symbols] | append (seq 1 64 | each { into string }) } catch { [] } +} + +@non-destructive +export def "nu-complete op duration-units" [] { + try { + [ + {value: 30m, description: "30 minutes"} {value: 1h, description: "1 hour"} {value: 12h, description: "12 hours"} + {value: 1d, description: "1 day"} {value: 7d, description: "7 days"} {value: 2w, description: "2 weeks"} + {value: 30d, description: "30 days"} + ] + } catch { [] } +} + # commented out aliases work when imported with `use` but not `source` # 1Password CLI brings 1Password to your terminal. -export extern op [ - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --help(-h) # Get help for op. - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op -] +export complete [op] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --help(-h) # Get help for op. + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op +] where { + terminal [--help --version] +} # Manage your locally configured 1Password accounts -export extern "op account" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for account -] +export complete [op account] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for account +] where { + terminal [--help --version] +} # Add an account to sign in to for the first time -export extern "op account add" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - +export complete [op account add] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op --help(-h) # help for add - --address=string: string # The sign-in address for your account. - --email: string # The email address associated with your account. - --raw # Only return the session token. - --shorthand=string: string # Set a custom account shorthand for your account. - --signin # Immediately sign in to the added account. -] + --address: text # The sign-in address for your account. + --email: text # The email address associated with your account. + --raw # Only return the session token. + --shorthand: text # Set a custom account shorthand for your account. + --signin # Immediately sign in to the added account. +] where { + terminal [--help --version] +} # Get details about your account -export extern "op account get" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for get -] +export complete [op account get] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for get +] where { + terminal [--help --version] +} # List users and accounts set up on this device -export extern "op account list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for list -] -export alias "account ls" = account list +export complete [op account list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for list +] where { + terminal [--help --version] +} # Remove a 1Password account from this device -export extern "op account forget" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for forget - --all # Forget all authenticated accounts. - - account?: string@"nu completion account" # The account to forget. -] +export complete [op account forget] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for forget + --all # Forget all authenticated accounts. + account?: by "nu-complete op account" # The account to forget. +] where { + terminal [--help --version] +} # Manage Connect server instances and tokens in your 1Password account -export extern "op connect" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for connect -] +export complete [op connect] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for connect +] where { + terminal [--help --version] +} # Manage group access to Secrets Automation -export extern "op connect group" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for group -] +export complete [op connect group] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for group +] where { + terminal [--help --version] +} # Grant a group access to manage Secrets Automation -export extern "op connect group grant" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for grant - --all-servers # Grant access to all current and future servers in the authenticated account. - --group=group: string@"nu completion group" # The group to receive access. - --server=server: string@"nu completion server" # The server to grant access to. -] +export complete [op connect group grant] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for grant + --all-servers # Grant access to all current and future servers in the authenticated account. + --group: by "nu-complete op group" # The group to receive access. + --server: by "nu-complete op server" # The server to grant access to. +] where { + excludes --server --all-servers + terminal [--help --version] +} # Revoke a group's access to manage Secrets Automation -export extern "op connect group revoke" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for revoke - --all-servers # Revoke access to all current and future servers in the authenticated account. - --group=group: string@"nu completion group" # The group to revoke access from. - --server=server: string@"nu completion server" # The server to revoke access to. -] +export complete [op connect group revoke] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for revoke + --all-servers # Revoke access to all current and future servers in the authenticated account. + --group: by "nu-complete op group" # The group to revoke access from. + --server: by "nu-complete op server" # The server to revoke access to. +] where { + excludes --server --all-servers + terminal [--help --version] +} # Manage Connect servers -export extern "op connect server" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for server -] +export complete [op connect server] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for server +] where { + terminal [--help --version] +} # Set up a Connect server -export extern "op connect server create" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --force(-f) # Do not prompt for confirmation when overwriting credential files. - --help(-h) # help for create - --vaults=strings: string@"nu completion vaults" # Grant the Connect server access to these vaults. - - name: string -] +export complete [op connect server create] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --force(-f) # Do not prompt for confirmation when overwriting credential files. + --help(-h) # help for create + --vaults: op.list with { root.item: by "nu-complete op vault" } # Grant the Connect server access to these vaults. + name: text +] where { + terminal [--help --version] +} # Get a Connect server -export extern "op connect server get" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for get - - server?: string@"nu completion server" # [{ <serverName> | <serverID> | - }] -] +export complete [op connect server get] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for get + server?: by "nu-complete op server" # [{ <serverName> | <serverID> | - }] +] where { + terminal [--help --version] +} # Rename a Connect server -export extern "op connect server edit" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help # help for edit - --name=name: string # Change the server's name. - - server: string@"nu completion server" # [{ <serverName> | <serverID> } -] - +export complete [op connect server edit] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help # help for edit + --name: text # Change the server's name. + server: by "nu-complete op server" # [{ <serverName> | <serverID> } +] where { + terminal [--help --version] +} # Remove a Connect server -export extern "op connect server delete" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for delete - - server?: string@"nu completion server" # [{ <serverName> | <serverID> | - }] -] -export alias "connect server rm" = connect server delete -export alias "connect server remove" = connect server delete - +export complete [op connect server delete] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for delete + server?: by "nu-complete op server" # [{ <serverName> | <serverID> | - }] +] where { + terminal [--help --version] +} # List Connect servers -export extern "op connect server list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for list -] -export alias "connect server ls" = connect server list +export complete [op connect server list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for list +] where { + terminal [--help --version] +} # Manage Connect server tokens -export extern "op connect token" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for token -] +export complete [op connect token] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for token +] where { + terminal [--help --version] +} # Issue a token for a 1Password Connect server -export extern "op connect token create" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --expires-in=duration: string@"nu completion duration" # Set how long the Connect token is valid for in (s)econds, (m)inutes, (h)ours, (d)ays, and/or (w)eeks. - --help(-h) # help for create - --server=string: string@"nu completion server" # Issue a token for this server. - --vault=stringArray: string@"nu completion vaults" # Issue a token on these vaults. - - tokenName: string -] +export complete [op connect token create] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --expires-in: by "nu-complete op duration-units" # Set how long the Connect token is valid for in (s)econds, (m)inutes, (h)ours, (d)ays, and/or (w)eeks. + --help(-h) # help for create + --server: by "nu-complete op server" # Issue a token for this server. + --vault: op.list with { root.item: by "nu-complete op vault" } # Issue a token on these vaults. + tokenName: text +] where { + terminal [--help --version] +} # Rename a Connect server token -export extern "op connect token edit" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for edit - --name=string: string # Change the token's name. - --server=string: string@"nu completion server" # Only look for tokens for this 1Password Connect server. - - token: string -] +export complete [op connect token edit] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for edit + --name: text # Change the token's name. + --server: by "nu-complete op server" # Only look for tokens for this 1Password Connect server. + token: text +] where { + terminal [--help --version] +} # Revoke a token for a Connect server -export extern "op connect token delete" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for delete - --server=string: string@"nu completion server" # Only look for tokens for this 1Password Connect server. - - token: string -] +export complete [op connect token delete] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for delete + --server: by "nu-complete op server" # Only look for tokens for this 1Password Connect server. + token: text +] where { + terminal [--help --version] +} # export alias "connect token rm" = connect token delete # export alias "connect token remove" = connect token delete # Get a list of tokens -export extern "op connect token list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for list - --server=server: string@"nu completion server" # Only list tokens for this Connect server. -] +export complete [op connect token list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for list + --server: by "nu-complete op server" # Only list tokens for this Connect server. +] where { + terminal [--help --version] +} # Manage Connect server vault access -export extern "op connect vault" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for vault -] +export complete [op connect vault] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for vault +] where { + terminal [--help --version] +} # Grant a Connect server access to a vault -export extern "op connect vault grant" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help # help for grant - --server=string: string@"nu completion server" # The server to be granted access. - --vault=string: string@"nu completion vault" # The vault to grant access to. -] +export complete [op connect vault grant] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help # help for grant + --server: by "nu-complete op server" # The server to be granted access. + --vault: by "nu-complete op vault" # The vault to grant access to. +] where { + terminal [--help --version] +} # Revoke a Connect server's access to a vault -export extern "op connect vault revoke" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help # help for revoke - --server=server: string@"nu completion server" # The server to revoke access from. - --vault=vault: string@"nu completion vault" # The vault to revoke a server's access to. -] +export complete [op connect vault revoke] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help # help for revoke + --server: by "nu-complete op server" # The server to revoke access from. + --vault: by "nu-complete op vault" # The vault to revoke a server's access to. +] where { + terminal [--help --version] +} # Perform CRUD operations on Document items in your vaults -export extern "op document" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for document -] +export complete [op document] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for document +] where { + terminal [--help --version] +} # Create a document item -export extern "op document create" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --file-name=name: string # Set the file's name. - --help(-h) # help for create - --tags=tags: string@"nu completion tag" # Set the tags to the specified (comma-separated) values. - --title=title: string # Set the document item's title. - --vault=vault: string@"nu completion vault" # Save the document in this vault. Default: Private. - - file?: path # [{ <file> | - }] -] +export complete [op document create] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --file-name: text # Set the file's name. + --help(-h) # help for create + --tags: op.list with { root.item: by "nu-complete op tag" } # Set the tags to the specified (comma-separated) values. + --title: text # Set the document item's title. + --vault: by "nu-complete op vault" # Save the document in this vault. Default: Private. + file?: path # [{ <file> | - }] +] where { + terminal [--help --version] +} # Download a document -export extern "op document get" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --file-mode=filemode: int # Set filemode for the output file. It is ignored without the --out-file flag. (default 0600) - --force # Forcibly print an unintelligible document to an interactive terminal. If --out-file is specified, save the document to a file without prompting for confirmation. - --help # help for get - --include-archive # Include document items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable. - --out-file(-o)=path: path # Save the document to the file path instead of stdout. - --vault=vault: string@"nu completion vault" # Look for the document in this vault. - - item: string@"nu completion document_item" # { <itemName> | <itemID> } - -] +export complete [op document get] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --file-mode: words [0600 0640 0644 0400] # Set filemode for the output file. It is ignored without the --out-file flag. (default 0600) + --force # Forcibly print an unintelligible document to an interactive terminal. If --out-file is specified, save the document to a file without prompting for confirmation. + --help # help for get + --include-archive # Include document items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable. + --out-file(-o): path # Save the document to the file path instead of stdout. + --vault: by "nu-complete op vault" # Look for the document in this vault. + item: by "nu-complete op document" # { <itemName> | <itemID> } +] where { + requires --file-mode --out-file + terminal [--help --version] +} # Edit a document item -export extern "op document edit" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --file-name=name: string # Set the file's name. - --help(-h) # help for edit - --tags=tags: string@"nu completion tags" # Set the tags to the specified (comma-separated) values. An empty value removes all tags. - --title=title: string # Set the document item's title. - --vault=vault: string@"nu completion vault" # Look up document in this vault. - - item: string@"nu completion document_item" # { <itemName> | <itemID> } - file?: path # [{ <file> | - }] -] +export complete [op document edit] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --file-name: text # Set the file's name. + --help(-h) # help for edit + --tags: op.list with { root.item: by "nu-complete op tag" } # Set the tags to the specified (comma-separated) values. An empty value removes all tags. + --title: text # Set the document item's title. + --vault: by "nu-complete op vault" # Look up document in this vault. + item: by "nu-complete op document" # { <itemName> | <itemID> } + file?: path # [{ <file> | - }] +] where { + terminal [--help --version] +} # Delete or archive a document item -export extern "op document delete" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --archive # Move the document to the Archive. - --help(-h) # help for delete - --vault=vault: string@"nu completion vault" # Delete the document in this vault. - - item?: string@"nu completion document_item" # [{ <itemName> | <itemID> | - }] -] -export alias "document rm" = document delete -export alias "document remove" = document delete +export complete [op document delete] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --archive # Move the document to the Archive. + --help(-h) # help for delete + --vault: by "nu-complete op vault" # Delete the document in this vault. + item?: by "nu-complete op document" # [{ <itemName> | <itemID> | - }] +] where { + terminal [--help --version] +} # Get a list of documents -export extern "op document list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help # help for list - --include-archive # Include document items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable. - --vault=vault: string@"nu completion vault" # Only list documents in this vault. -] -export alias "document ls" = document list +export complete [op document list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help # help for list + --include-archive # Include document items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable. + --vault: by "nu-complete op vault" # Only list documents in this vault. +] where { + terminal [--help --version] +} # Manage Events API integrations in your 1Password connect -export extern "op events-api" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for events-api -] +export complete [op events-api] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for events-api +] where { + terminal [--help --version] +} # Create an Events API integration token. -export extern "op events-api create" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --expires-in=duration: string@"nu completion duration" # Set how the long the events-api token is valid for in (s)econds, (m)inutes, (h)ours, (d)ays, and/or (w)eeks. - --features=features: string@"nu completion feature" # Set the comma-separated list of features the integration token can be used for. Options: 'signinattempts', 'itemusages', 'auditevents'. - --help(-h) # help for create - - name: string -] +export complete [op events-api create] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --expires-in: by "nu-complete op duration-units" # Set how the long the events-api token is valid for in (s)econds, (m)inutes, (h)ours, (d)ays, and/or (w)eeks. + --features: op.list with { root.item: by "nu-complete op feature" } # Set the comma-separated list of features the integration token can be used for. Options: 'signinattempts', 'itemusages', 'auditevents'. + --help(-h) # help for create + name: text +] where { + terminal [--help --version] +} # Manage the groups in your 1Password account -export extern "op group" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for group -] - +export complete [op group] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for group +] where { + terminal [--help --version] +} # Create a group -export extern "op group create" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --description=string: string # Set the group's description. - --help # help for create - - name: string -] +export complete [op group create] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --description: text # Set the group's description. + --help # help for create + name: text +] where { + terminal [--help --version] +} # Get details about a group -export extern "op group get" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for get - - group?: string@"nu completion group" # [{ <groupName> | <groupID> | - }] -] +export complete [op group get] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for get + group?: by "nu-complete op group" # [{ <groupName> | <groupID> | - }] +] where { + terminal [--help --version] +} # Edit a group's name or description -export extern "op group edit" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --description=description: string # Change the group's description. - --help # help for edit - --name=name: string # Change the group's name. - - group?: string@"nu completion group" # [{ <groupName> | <groupID> | - }] -] +export complete [op group edit] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --description: text # Change the group's description. + --help # help for edit + --name: text # Change the group's name. + group?: by "nu-complete op group" # [{ <groupName> | <groupID> | - }] +] where { + terminal [--help --version] +} # Remove a group -export extern "op group delete" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for delete - - group?: string@"nu completion group" # [{ <groupName> | <groupID> | - }] -] -export alias "group rm" = op group delete -export alias "group remove" = op group delete +export complete [op group delete] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for delete + group?: by "nu-complete op group" # [{ <groupName> | <groupID> | - }] +] where { + terminal [--help --version] +} # List groups -export extern "op group list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for list - --user=user: string@"nu completion user" # List groups that a user belongs to. - --vault=vault: string@"nu completion vault" # List groups that have direct access to a vault. -] +export complete [op group list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for list + --user: by "nu-complete op user" # List groups that a user belongs to. + --vault: by "nu-complete op vault" # List groups that have direct access to a vault. +] where { + terminal [--help --version] +} # Manage group membership -export extern "op group user" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for user -] +export complete [op group user] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for user +] where { + terminal [--help --version] +} # Add a user to a group -export extern "op group user grant" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --group=string: string@"nu completion group" # Specify the group to add the user to. - --help(-h) # help for grant - --role=string: string@"nu completion role" # Specify the user's role as a member or manager. Default: member. - --user=string: string@"nu completion user" # Specify the user to add to the group. -] +export complete [op group user grant] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --group: by "nu-complete op group" # Specify the group to add the user to. + --help(-h) # help for grant + --role: words [member manager] # Specify the user's role as a member or manager. Default: member. + --user: by "nu-complete op user" # Specify the user to add to the group. +] where { + terminal [--help --version] +} # Remove a user from a group -export extern "op group user revoke" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --group=string: string@"nu completion group" # Specify the group to remove the user from. - --help(-h) # help for revoke - --user=string: string@"nu completion user" # Specify the user to remove from the group. -] +export complete [op group user revoke] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --group: by "nu-complete op group" # Specify the group to remove the user from. + --help(-h) # help for revoke + --user: by "nu-complete op user" # Specify the user to remove from the group. +] where { + terminal [--help --version] +} # Retrieve users that belong to a group -export extern "op group user list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for list - - group: string@"nu completion group" -] +export complete [op group user list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for list + group: by "nu-complete op group" +] where { + terminal [--help --version] +} # export alias "group user ls" = op group user list # Perform CRUD operations on the 1Password items in your vaults -export extern "op item" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for item -] +export complete [op item] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for item +] where { + terminal [--help --version] +} # Create an item -export extern "op item create" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --category=category: string@"nu completion category" # Set the item's category. - --dry-run # Test the command and output a preview of the resulting item. - --favorite # Add item to favorites. - --generate-password=recipe: string@"nu completion generate-password" # Add a randomly-generated password to a Login or Password item. - --help(-h) # help for create - --ssh-generate-key: string@"nu completion ssh-generate-key" # The type of SSH key to create: Ed25519 or RSA. For RSA, specify 2048, 3072, or 4096 (default) bits. Possible values: 'ed25519', 'rsa', 'rsa2048', 'rsa3072', 'rsa4096'. (default Ed25519) - --tags tags # Set the tags to the specified (comma-separated) values. - --template=string: path # Specify the file path to read an item template from. - --title=title: string # Set the item's title. - --url=URL: string # Set the URL associated with the item - --vault=vault: string@"nu completion vault" # Save the item in this vault. Default: Private. - - ...assignments -] +export complete [op item create] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --category: words ["API Credential" "Bank Account" "Credit Card" Database Document "Driver License" "Email Account" Identity Login Membership "Outdoor License" Passport Password "Reward Program" "Secure Note" Server "Social Security Number" "Software License" "SSH Key" "Wireless Router"] # Set the item's category. + --dry-run # Test the command and output a preview of the resulting item. + --favorite # Add item to favorites. + --generate-password: op.list with { root.item: by "nu-complete op password-recipe" } # Add a randomly-generated password to a Login or Password item. + --help(-h) # help for create + --ssh-generate-key: words [ed25519 rsa rsa2048 rsa3072 rsa4096] # The type of SSH key to create: Ed25519 or RSA. For RSA, specify 2048, 3072, or 4096 (default) bits. Possible values: 'ed25519', 'rsa', 'rsa2048', 'rsa3072', 'rsa4096'. (default Ed25519) + --tags: op.list with { root.item: by "nu-complete op tag" } # Set the tags to the specified (comma-separated) values. + --template: path # Specify the file path to read an item template from. + --title: text # Set the item's title. + --url: text # Set the URL associated with the item + --vault: by "nu-complete op vault" # Save the item in this vault. Default: Private. + ...assignments: text +] where { + excludes --generate-password --template + terminal [--help --version] +} # Get an item's details -export extern "op item get" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --fields=strings: string # Return data from specific fields. Use 'label=' to get the field by name or 'type=' to filter fields by type. Specify multiple in a comma-separated list. - --help(-h) # help for get - --include-archive # Include items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable. - --otp # Output the primary one-time password for this item. - --reveal # Don't conceal the private SSH key when using human-readable output. - --share-link # Get a shareable link for the item. - --vault=string: string@"nu completion vault" # Look for the item in this vault. - - items?: string@"nu completion item" # [{ <itemName> | <itemID> | <shareLink> | - }] -] +export complete [op item get] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --fields: text # Return data from specific fields. Use 'label=' to get the field by name or 'type=' to filter fields by type. Specify multiple in a comma-separated list. + --help(-h) # help for get + --include-archive # Include items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable. + --otp # Output the primary one-time password for this item. + --reveal # Don't conceal the private SSH key when using human-readable output. + --share-link # Get a shareable link for the item. + --vault: by "nu-complete op vault" # Look for the item in this vault. + items?: by "nu-complete op item" # [{ <itemName> | <itemID> | <shareLink> | - }] +] where { + at-most-one [--otp --share-link --fields] + terminal [--help --version] +} # Edit an item's details -export extern "op item edit" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --dry-run # Perform a dry run of the command and output a preview of the resulting item. - --favorite: string@"nu completion bool" # Whether this item is a favorite item. Options: true, false - --generate-password=recipe: string@"nu completion generate-password" # Give the item a randomly generated password. - --help(-h) # help for edit - --tags=tags: string@"nu completion tags" # Set the tags to the specified (comma-separated) values. An empty value will remove all tags. - --template: path # Specify the filepath to read an item template from. - --title=title: string # Set the item's title. - --url=URL: string # Set the URL associated with the item - --vault=vault: string@"nu completion vault" # Edit the item in this vault. - - item: string@"nu completion item" # { <itemName> | <itemID> | <shareLink> } - ...assignments # [ <assignment> ... ] -] +export complete [op item edit] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --dry-run # Perform a dry run of the command and output a preview of the resulting item. + --favorite: words [true false] # Whether this item is a favorite item. Options: true, false + --generate-password: op.list with { root.item: by "nu-complete op password-recipe" } # Give the item a randomly generated password. + --help(-h) # help for edit + --tags: op.list with { root.item: by "nu-complete op tag" } # Set the tags to the specified (comma-separated) values. An empty value will remove all tags. + --template: path # Specify the filepath to read an item template from. + --title: text # Set the item's title. + --url: text # Set the URL associated with the item + --vault: by "nu-complete op vault" # Edit the item in this vault. + item: by "nu-complete op item" # { <itemName> | <itemID> | <shareLink> } + ...assignments: text # [ <assignment> ... ] +] where { + excludes --generate-password --template + terminal [--help --version] +} # Delete or archive an item -export extern "op item delete" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --archive # Move the item to the Archive. - --help # help for delete - --vault: string@"nu completion vault" # Look for the item in this vault. - - items?: string@"nu completion item" # [{ <itemName> | <itemID> | <shareLink> | - }] -] -export alias "item rm" = op item delete -export alias "item remove" = op item delete +export complete [op item delete] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --archive # Move the item to the Archive. + --help # help for delete + --vault: by "nu-complete op vault" # Look for the item in this vault. + items?: by "nu-complete op item" # [{ <itemName> | <itemID> | <shareLink> | - }] +] where { + terminal [--help --version] +} # List items -export extern "op item list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --categories=categories: string@"nu completion category" # Only list items in these categories (comma-separated). - --favorite # Only list favorite items - --help(-h) # help for list - --include-archive # Include items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable. - --long # Output a more detailed item list. - --tags=tags: string@"nu completion tag" # Only list items with these tags (comma-separated). - --vault=vault: string@"nu completion vault" # Only list items in this vault. -] -export alias "item ls" = op item list +export complete [op item list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --categories: op.list with { root.item: by "nu-complete op categories" } # Only list items in these categories (comma-separated). + --favorite # Only list favorite items + --help(-h) # help for list + --include-archive # Include items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable. + --long # Output a more detailed item list. + --tags: op.list with { root.item: by "nu-complete op tag" } # Only list items with these tags (comma-separated). + --vault: by "nu-complete op vault" # Only list items in this vault. +] where { + terminal [--help --version] +} # Move an item between vaults -export extern "op item move" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --current-vault=string: string@"nu completion vault" # Vault where the item is currently saved. - --destination-vault=string: string@"nu completion vault" # The vault you want to move the item to. - --help # help for move - - items?: string@"nu completion item" # [{ <itemName> | <itemID> | <shareLink> | - }] -] -export alias "item mv" = op item move +export complete [op item move] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --current-vault: by "nu-complete op vault" # Vault where the item is currently saved. + --destination-vault: by "nu-complete op vault" # The vault you want to move the item to. + --help # help for move + items?: by "nu-complete op item" # [{ <itemName> | <itemID> | <shareLink> | - }] +] where { + terminal [--help --version] +} # Share an item -export extern "op item share" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --emails=strings: string # Email addresses to share with. - --expires-in=duration: string@"nu completion duration" # Expire link after the duration specified in (s)econds, (m)inutes, (h)ours, (d)ays, and/or (w)eeks. (default 7d) - --help # help for share - --vault=string: string@"nu completion vault" # Look for the item in this vault. - --view-once # Expire link after a single view. - - item: string@"nu completion item" # { <itemName> | <itemID> } -] - -# Manage templates -export extern "op template" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for template -] +export complete [op item share] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --emails: text # Email addresses to share with. + --expires-in: by "nu-complete op duration-units" # Expire link after the duration specified in (s)econds, (m)inutes, (h)ours, (d)ays, and/or (w)eeks. (default 7d) + --help # help for share + --vault: by "nu-complete op vault" # Look for the item in this vault. + --view-once # Expire link after a single view. + item: by "nu-complete op item" # { <itemName> | <itemID> } +] where { + excludes --view-once --expires-in + terminal [--help --version] +} + +# Manage templates for item categories +export complete [op item template] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for template + ...args: text # The subcommand and its arguments. +] where { + terminal [--help --version] +} # Get an item template -export extern "op item template get" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --file-mode=filemode: int # Set filemode for the output file. It is ignored without the --out-file flag. (default 0600) - --force(-f) # Do not prompt for confirmation. - --help(-h) # help for get - --out-file(-o)=string: path # Write the template to a file instead of stdout. - - category?: string@"nu completion category" # [{ <category> | - }] -] +export complete [op item template get] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --file-mode: words [0600 0640 0644 0400] # Set filemode for the output file. It is ignored without the --out-file flag. (default 0600) + --force(-f) # Do not prompt for confirmation. + --help(-h) # help for get + --out-file(-o): path # Write the template to a file instead of stdout. + category?: words ["API Credential" "Bank Account" "Credit Card" Database Document "Driver License" "Email Account" Identity Login Membership "Outdoor License" Passport Password "Reward Program" "Secure Note" Server "Social Security Number" "Software License" "SSH Key" "Wireless Router"] # [{ <category> | - }] +] where { + requires --file-mode --out-file + terminal [--help --version] +} # Get a list of templates -export extern "op item template list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for list -] -export alias "item template ls" = op item template list +export complete [op item template list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for list +] where { + terminal [--help --version] +} # Manage the shell plugins you use to authenticate third-party CLIs -export extern "op plugin" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for plugin -] - +export complete [op plugin] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for plugin +] where { + terminal [--help --version] +} # List all available shell plugins -export extern "op plugin list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for list -] -export alias "plugin ls" = op plugin list +export complete [op plugin list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for list +] where { + terminal [--help --version] +} # Clear shell plugin configuration -export extern "op plugin clear" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --all # Clear all configurations for this plugin that apply to this directory and/or terminal session, including the global default. - --force(-f) # Apply immediately without asking for confirmation. - --help(-h) # help for clear - - plugin_name: string@"nu completion plugin_name" -] +export complete [op plugin clear] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --all # Clear all configurations for this plugin that apply to this directory and/or terminal session, including the global default. + --force(-f) # Apply immediately without asking for confirmation. + --help(-h) # help for clear + plugin_name: by "nu-complete op plugin-name" +] where { + terminal [--help --version] +} # export alias "plugin reset" = op plugin clear # Configure a shell plugin -export extern "op plugin init" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for init - - executable: string@"nu completion plugin_executable" # [ <plugin-executable> ] -] +export complete [op plugin init] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for init + executable: by "nu-complete op plugin-executable" # [ <plugin-executable> ] +] where { + terminal [--help --version] +} # Inspect your existing shell plugin configurations -export extern "op plugin inspect" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for inspect - - plugin_name: string@"nu completion plugin_name" -] +export complete [op plugin inspect] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for inspect + plugin_name: by "nu-complete op plugin-name" +] where { + terminal [--help --version] +} # export alias "plugin info" = op plugin inspect # Provision credentials from 1Password and run this command -export extern "op plugin run" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for run - - ...command -] +export complete [op plugin run] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for run + ...command: command +] where { + terminal [--help --version] +} # Manage credentials for shell plugins -export extern "op plugin credential" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for credential -] +export complete [op plugin credential] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for credential +] where { + terminal [--help --version] +} # Import credentials for a shell plugin -export extern "op plugin credential import" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for import - - plugin_name: string@"nu completion plugin_name" -] +export complete [op plugin credential import] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for import + plugin_name: by "nu-complete op plugin-name" +] where { + terminal [--help --version] +} # Manage service accounts -export extern "op service-account" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for service-account -] +export complete [op service-account] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for service-account +] where { + terminal [--help --version] +} # Create a service account -export extern "op service-account create" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --can-create-vaults # Allow the service account to create new vaults. - --expires-in=duration: string@"nu completion duration" # Set how long the service account is valid for in (s)econds, (m)inutes, (h)ours, (d)ays, or (w)eeks. - --help(-h) # help for create - --raw # Only return the service account token. - --vault=stringArray: string@"nu completion vault permissions" # Give access to this vault with a set of permissions. Has syntax <vault-name>:<permission>[,<permission>] - - serviceAccountName: string -] +export complete [op service-account create] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --can-create-vaults # Allow the service account to create new vaults. + --expires-in: by "nu-complete op duration-units" # Set how long the service account is valid for in (s)econds, (m)inutes, (h)ours, (d)ays, or (w)eeks. + --help(-h) # help for create + --raw # Only return the service account token. + --vault: op.vault-grant with { root.vault: by "nu-complete op vault" root.perm: by "nu-complete op vault-permission" } # Give access to this vault with a set of permissions. Has syntax <vault-name>:<permission>[,<permission>] + serviceAccountName: text +] where { + terminal [--help --version] +} # Retrieve rate limit usage for a service account -export extern "op service-account ratelimit" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for ratelimit - - account: string # [{ <serviceAccountName> | <serviceAccountID> }] -] +export complete [op service-account ratelimit] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for ratelimit + account: text # [{ <serviceAccountName> | <serviceAccountID> }] +] where { + terminal [--help --version] +} # export alias "service-account ratelimits" = op service-account ratelimit # Manage users within this 1Password account -export extern "op user" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for user -] +export complete [op user] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for user +] where { + terminal [--help --version] +} # Provision a user in the authenticated account -export extern "op user provision" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --email=string: string # Provide the user's email address. - --help(-h) # help for provision - --language=string: string # Provide the user's account language. (default "en") - --name=string: string # Provide the user's name. -] +export complete [op user provision] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --email: text # Provide the user's email address. + --help(-h) # help for provision + --language: text # Provide the user's account language. (default "en") + --name: text # Provide the user's name. +] where { + terminal [--help --version] +} # Confirm a user -export extern "op user confirm" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --all # Confirm all unconfirmed users. - --help(-h) # help for confirm - - user?: string@"nu completion user" # [{ <email> | <name> | <userID> | - }] -] +export complete [op user confirm] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --all # Confirm all unconfirmed users. + --help(-h) # help for confirm + user?: by "nu-complete op user" # [{ <email> | <name> | <userID> | - }] +] where { + terminal [--help --version] +} # Get details about a user -export extern "op user get" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --fingerprint # Get the user's public key fingerprint. - --help(-h) # help for get - --me # Get the authenticated user's details. - --public-key # Get the user's public key. - - user?: string@"nu completion user" # [{ <email> | <name> | <userID> | --me | - }] -] +export complete [op user get] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --fingerprint # Get the user's public key fingerprint. + --help(-h) # help for get + --me # Get the authenticated user's details. + --public-key # Get the user's public key. + user?: by "nu-complete op user" # [{ <email> | <name> | <userID> | --me | - }] +] where { + terminal [--help --version] +} # Edit a user's name or Travel Mode status -export extern "op user edit" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help # help for edit - --name=string: string # Set the user's name. - --travel-mode: string@"nu completion onoff" # Turn Travel Mode on or off for the user. (default off) - - user?: string@"nu completion user" # [{ <email> | <name> | <userID> | - }] -] +export complete [op user edit] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help # help for edit + --name: text # Set the user's name. + --travel-mode: words [on off] # Turn Travel Mode on or off for the user. (default off) + user?: by "nu-complete op user" # [{ <email> | <name> | <userID> | - }] +] where { + terminal [--help --version] +} # Suspend a user -export extern "op user suspend" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --deauthorize-devices-after=duration: string@"nu completion duration" # Deauthorize the user's devices after a time (rounded down to seconds). - --help(-h) # help for suspend - - user?: string@"nu completion user" # [{ <email> | <name> | <userID> | - }] -] +export complete [op user suspend] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --deauthorize-devices-after: by "nu-complete op duration-units" # Deauthorize the user's devices after a time (rounded down to seconds). + --help(-h) # help for suspend + user?: by "nu-complete op user" # [{ <email> | <name> | <userID> | - }] +] where { + terminal [--help --version] +} # Reactivate a suspended user -export extern "op user reactivate" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for reactivate - - user?: string@"nu completion user" # [{ <email> | <name> | <userID> | - }] -] +export complete [op user reactivate] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for reactivate + user?: by "nu-complete op user" # [{ <email> | <name> | <userID> | - }] +] where { + terminal [--help --version] +} # Remove a user and all their data from the account -export extern "op user delete" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for delete - - user?: string@"nu completion user" # [{ <email> | <name> | <userID> | - }] -] -export alias "user rm" = op user delete -export alias "user remove" = op user delete +export complete [op user delete] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for delete + user?: by "nu-complete op user" # [{ <email> | <name> | <userID> | - }] +] where { + terminal [--help --version] +} # List users -export extern "op user list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --group=group: string@"nu completion group" # List users who belong to a group. - --help(-h) # help for list - --vault=vault: string@"nu completion vault" # List users who have direct access to vault. -] -export alias "user ls" = op user list +export complete [op user list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --group: by "nu-complete op group" # List users who belong to a group. + --help(-h) # help for list + --vault: by "nu-complete op vault" # List users who have direct access to vault. +] where { + terminal [--help --version] +} # Manage permissions and perform CRUD operations on your 1Password vaults -export extern "op vault" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for vault -] - +export complete [op vault] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for vault +] where { + terminal [--help --version] +} # Create a new vault -export extern "op vault create" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --allow-admins-to-manage: string@"nu completion bool" # Set whether administrators can manage the vault. If not provided, the default policy for the account applies. - --description=description: string # Set the group's description. - --help(-h) # help for create - --icon=string: string@"nu completion vault_icon" # Set the vault icon. - - name: string -] +export complete [op vault create] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --allow-admins-to-manage: words [true false] # Set whether administrators can manage the vault. If not provided, the default policy for the account applies. + --description: text # Set the group's description. + --help(-h) # help for create + --icon: words [airplane application art-supplies bankers-box brown-briefcase brown-gate buildings cabin castle circle-of-dots coffee color-wheel curtained-window document doughnut fence galaxy gears globe green-backpack green-gem handshake heart-with-monitor house id-card jet large-ship luggage plant porthole puzzle rainbow record round-door sandals scales screwdriver shop tall-window treasure-chest vault-door vehicle wallet wrench] # Set the vault icon. + name: text +] where { + terminal [--help --version] +} # Get details about a vault -export extern "op vault get" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for get - - vaults?: string@"nu completion vault" # [{ <vaultName> | <vaultID> | - }] -] +export complete [op vault get] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for get + vaults?: by "nu-complete op vault" # [{ <vaultName> | <vaultID> | - }] +] where { + terminal [--help --version] +} # Edit a vault's name, description, icon, or Travel Mode status -export extern "op vault edit" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --description description # Change the vault's description. - --help(-h) # help for edit - --icon=icon: string@"nu completion vault_icon" # Change the vault's icon. - --name=name: string # Change the vault's name. - --travel-mode: string@"nu completion onoff" # Turn Travel Mode on or off for the vault. Only vaults with Travel Mode enabled are accessible while a user has Travel Mode turned on. (default off) - - vaults?: string@"nu completion vault" # [{ <vaultName> | <vaultID> | - }] -] +export complete [op vault edit] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --description: text # Change the vault's description. + --help(-h) # help for edit + --icon: words [airplane application art-supplies bankers-box brown-briefcase brown-gate buildings cabin castle circle-of-dots coffee color-wheel curtained-window document doughnut fence galaxy gears globe green-backpack green-gem handshake heart-with-monitor house id-card jet large-ship luggage plant porthole puzzle rainbow record round-door sandals scales screwdriver shop tall-window treasure-chest vault-door vehicle wallet wrench] # Change the vault's icon. + --name: text # Change the vault's name. + --travel-mode: words [on off] # Turn Travel Mode on or off for the vault. Only vaults with Travel Mode enabled are accessible while a user has Travel Mode turned on. (default off) + vaults?: by "nu-complete op vault" # [{ <vaultName> | <vaultID> | - }] +] where { + terminal [--help --version] +} # Remove a vault -export extern "op vault delete" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for delete - - vaults?: string@"nu completion vault" # [{ <vaultName> | <vaultID> | - }] -] -export alias "vault rm" = op vault delete -export alias "vault remove" = op vault delete +export complete [op vault delete] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for delete + vaults?: by "nu-complete op vault" # [{ <vaultName> | <vaultID> | - }] +] where { + terminal [--help --version] +} # List all vaults in the account -export extern "op vault list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --group=string: string@"nu completion group" # List vaults a group has access to. - --help(-h) # help for list - --permission=permissions: string@"nu completion permissions" # List only vaults that the specified user/group has this permission for. - --user=string: string@"nu completion user" # List vaults that a given user has access to. -] -export alias "vault ls" = op vault list +export complete [op vault list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --group: by "nu-complete op group" # List vaults a group has access to. + --help(-h) # help for list + --permission: op.list with { root.item: by "nu-complete op permission" } # List only vaults that the specified user/group has this permission for. + --user: by "nu-complete op user" # List vaults that a given user has access to. +] where { + excludes --group --user + terminal [--help --version] +} # Manage group vault access -export extern "op vault group" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for group -] +export complete [op vault group] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for group +] where { + terminal [--help --version] +} # Grant a group permissions to a vault -export extern "op vault group grant" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --group=group: string@"nu completion group" # The group to receive access. - --help(-h) # help for grant - --no-input=input # Do not prompt for input on interactive terminal. - --permissions=permissions: string@"nu completion permissions" # The permissions to grant to the group. - --vault=vault: string@"nu completion vault" # The vault to grant group permissions to. -] +export complete [op vault group grant] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --group: by "nu-complete op group" # The group to receive access. + --help(-h) # help for grant + --no-input # Do not prompt for input on interactive terminal. + --permissions: op.list with { root.item: by "nu-complete op permission" } # The permissions to grant to the group. + --vault: by "nu-complete op vault" # The vault to grant group permissions to. +] where { + terminal [--help --version] +} # Revoke a portion or the entire access of a group to a vault -export extern "op vault group revoke" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --group=group: string@"nu completion group" # The group to revoke access from. - --help(-h) # help for revoke - --no-input=input # Do not prompt for input on interactive terminal. - --permissions=permissions: string@"nu completion permissions" # The permissions to revoke from the group. - --vault=vault: string@"nu completion vault" # The vault to revoke access to. -] +export complete [op vault group revoke] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --group: by "nu-complete op group" # The group to revoke access from. + --help(-h) # help for revoke + --no-input # Do not prompt for input on interactive terminal. + --permissions: op.list with { root.item: by "nu-complete op permission" } # The permissions to revoke from the group. + --vault: by "nu-complete op vault" # The vault to revoke access to. +] where { + terminal [--help --version] +} # List all the groups that have access to the given vault -export extern "op vault group list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for list - - vault?: string@"nu completion vault" -] - -export alias "vault group ls" = op vault group list +export complete [op vault group list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for list + vault?: by "nu-complete op vault" +] where { + terminal [--help --version] +} # Manage user vault access -export extern "op vault user" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for user -] +export complete [op vault user] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for user +] where { + terminal [--help --version] +} # Grant a user access to a vault -export extern "op vault user grant" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for grant - --no-input=input # Do not prompt for input on interactive terminal. - --permissions=permissions: string@"nu completion permissions" # The permissions to grant to the user. - --user=user: string@"nu completion user" # The user to receive access. - --vault=vault: string@"nu completion vault" # The vault to grant access to. -] +export complete [op vault user grant] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for grant + --no-input # Do not prompt for input on interactive terminal. + --permissions: op.list with { root.item: by "nu-complete op permission" } # The permissions to grant to the user. + --user: by "nu-complete op user" # The user to receive access. + --vault: by "nu-complete op vault" # The vault to grant access to. +] where { + terminal [--help --version] +} # Revoke a portion or the entire access of a user to a vault -export extern "op vault user revoke" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help # help for revoke - --no-input=input # Do not prompt for input on interactive terminal. - --permissions=permissions: string@"nu completion permissions" # The permissions to revoke from the user. - --user=user: string@"nu completion user" # The user to revoke access from. - --vault=vault: string@"nu completion vault" # The vault to revoke access to. -] +export complete [op vault user revoke] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help # help for revoke + --no-input # Do not prompt for input on interactive terminal. + --permissions: op.list with { root.item: by "nu-complete op permission" } # The permissions to revoke from the user. + --user: by "nu-complete op user" # The user to revoke access from. + --vault: by "nu-complete op vault" # The vault to revoke access to. +] where { + terminal [--help --version] +} # List all users with access to the vault and their permissions -export extern "op vault user list" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for list - - vault: string@"nu completion vault" -] +export complete [op vault user list] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for list + vault: by "nu-complete op vault" +] where { + terminal [--help --version] +} # export alias "vault user ls" = op vault user list # Generate shell completion information -export extern "op completion" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for completion - - shell: string@"nu completion completion_shell" -] - -# Inject secrets into a config file -export extern "op inject" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --file-mode=filemode: int # Set filemode for the output file. It is ignored without the --out-file flag. (default 0600) - --force(-f) # Do not prompt for confirmation. - --help(-h) # help for inject - --in-file(-i)=string: path # The filename of a template file to inject. - --out-file(-o)=string: path # Write the injected template to a file instead of stdout. -] - -# Read a secret reference -export extern "op read" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --file-mode=filemode: int # Set filemode for the output file. It is ignored without the --out-file flag. (default 0600) - --force(-f) # Do not prompt for confirmation. - --help(-h) # help for read - --no-newline(-n) # Do not print a new line after the secret. - --out-file(-o)=string: path # Write the secret to a file instead of stdout. - - reference: string -] - -# Pass secrets as environment variables to a process -export extern "op run" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --env-file=stringArray: path # Enable Dotenv integration with specific Dotenv files to parse. For example: --env-file=.env. - --help(-h) # help for run - --no-masking # Disable masking of secrets on stdout and stderr. - - # "--": string - ...command: string -] - -# Sign in to a 1Password account -export extern "op signin" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --force(-f) # Ignore warnings and print raw output from this command. - --help(-h) # help for signin - --raw # Only return the session token. -] - -# Sign out of a 1Password account -export extern "op signout" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --all # Sign out of all signed-in accounts. - --forget # Remove the details for a 1Password account from this device. - --help(-h) # help for signout -] - -# Check for and download updates. -export extern "op update" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --channel=string: string@"nu completion update_channel" # Look for updates from a specific channel. allowed: stable, beta - --directory=string: path # Download the update to this ''path''. - --help(-h) # help for update -] - -# Get information about a signed-in account -export extern "op whoami" [ - # GLOBAL FLAGS - --account=account: string@"nu completion account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. - --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) - --config=directory: path # Use this configuration directory. - --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. - --encoding=type: string@"nu completion encoding" # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. - --format=string: string@"nu completion format" # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") - --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. - --no-color # Print output without color. - --session=token: string # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. - --version(-v) # version for op - - --help(-h) # help for whoami -] - - -def "nu completion format" [] { - [ - json - human-readable - ] -} - -def "nu completion encoding" [] { - [ - UTF-8 - SHIFT_JIS - gbk - ] +export complete [op completion] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for completion + shell: words [bash zsh fish powershell] +] where { + terminal [--help --version] } -def "nu completion update_channel" [] { - [ - stable - beta - ] -} - -def "nu completion group" [] { - op group list --format json - | from json - | upsert description {|row| $"($row.name?) \(($row.state?)): ($row.description?)"} - | select id name description state - | rename value description - | sort-by description --ignore-case --natural -} - -def "nu completion server" [] { - # untested 🤷🏿‍♂️ - op server list --format json | from json | select id name | rename value description | sort-by description --ignore-case --natural -} - -def "nu completion vault" [] { - op vault list --format json | from json | select id name | rename value description | sort-by description --ignore-case --natural -} - -def "nu completion vault permissions" [ctx: string] { - let vault_permissions = [ - {value: read_items, description: 'READ'} - {value: write_items, description: 'WRITE: requires read_items'} - {value: share_items, description: 'SHARE: requires read_items'} - ] - let token = $ctx | nu completion parse-context | transpose option value | last | get value - if ($token | is-not-empty) and (($token | str ends-with ,) or ($token | str ends-with :)) { - $vault_permissions | each {|e| $e | upsert value $"($token)($e.value)" } - } else { - nu completion vault | each {|e| $e | upsert value $"($e.value):" } - } -} - -def "nu completion vaults" [ctx: string] { - let vaults = $ctx | nu completion parse-context | transpose option value | last | get value - if ($vaults | is-not-empty) and ($vaults | str ends-with ,) { - nu completion vault | each {|e| $e | upsert value $"($vaults)($e.value)" } - } else { - nu completion vault - } -} - -def "nu completion vault_icon" [] { - [airplane, application, art-supplies, bankers-box, brown-briefcase, brown-gate, buildings, cabin, castle, circle-of-dots, coffee, color-wheel, curtained-window, document, doughnut, fence, galaxy, gears, globe, green-backpack, green-gem, handshake, heart-with-monitor, house, id-card, jet, large-ship, luggage, plant, porthole, puzzle, rainbow, record, round-door, sandals, scales, screwdriver, shop, tall-window, treasure-chest, vault-door, vehicle, wallet, wrench] -} - -def "nu completion duration" [ctx: string] { - let duration = $ctx | nu completion parse-context | transpose option value | last | get value - - if ($duration | parse --regex ".*?(\\d+)$" | is-not-empty) { - [s m h d w] | each {|e| - let label = match $e { - "s" => "seconds" - "m" => "minutes" - "h" => "hours" - "d" => "days" - "w" => "weeks" - } - {value: $"($duration)($e)", description: $"+($duration | parse --regex '.*?(?<value>\d+)$' | last | get value | into float) ($label)"} - } - } -} - -def "nu completion tag" [] { - op item list --format json | from json | get tags -o | uniq | sort --ignore-case --natural -} - -def "nu completion tags" [ctx: string] { - let tags = $ctx | nu completion parse-context | transpose option value | last | get value - if ($tags | is-not-empty) and ($tags | str ends-with ,) { - nu completion tag | each {|e| $e | upsert value $"($tags)($e.value)" } - } - else { - nu completion tag - } -} - -def "nu completion feature" [ctx:string] { - let features = ['signinattempts','itemusages', 'auditevents'] - let token = $ctx | nu completion parse-context | transpose option value | last | get value - if ($token | is-not-empty) and ($token | str ends-with ,) { - $features | each {|e| $"($token)($e)" } - } else { - $features - } -} - -def "nu completion user" [] { - op user list --format json | from json | upsert name {|row| $"($row.name) \(($row.type) - ($row.state)): ($row.email)"} | select id name | rename value description | sort-by description --ignore-case --natural -} - -def "nu completion role" [] { - [member manager] -} - -def "nu completion category" [$ctx: string] { - [ - "API Credential" "Bank Account" "Credit Card" - Database Document "Driver License" - "Email Account" Identity Login - Membership "Outdoor License" Passport - Password "Reward Program" "Secure Note" - Server "Social Security Number" "Software License" - SSH Key "Wireless Router" - ] | nu completion output $ctx --complete +# Inject secrets into a config file +export complete [op inject] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --file-mode: words [0600 0640 0644 0400] # Set filemode for the output file. It is ignored without the --out-file flag. (default 0600) + --force(-f) # Do not prompt for confirmation. + --help(-h) # help for inject + --in-file(-i): path # The filename of a template file to inject. + --out-file(-o): path # Write the injected template to a file instead of stdout. +] where { + requires --file-mode --out-file + terminal [--help --version] } -def "nu completion generate-password" [ctx: string] { - let token = $ctx | nu completion parse-context | transpose option value | last | get value - if ($token | is-not-empty) and ($token | str ends-with ,) { - [letters,digits,symbols,] | append (seq 1 64) | each {|e| - if ($e | describe --detailed | get type) == int { - $"($token)($e)" - } else if not ($token | str contains $e) and ($e | describe --detailed | get type) == string { - $"($token)($e)" - } - } - } else { - [letters,digits,symbols,] | append (seq 1 64) | each {|e| $e } - } +# Read a secret reference +export complete [op read] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --file-mode: words [0600 0640 0644 0400] # Set filemode for the output file. It is ignored without the --out-file flag. (default 0600) + --force(-f) # Do not prompt for confirmation. + --help(-h) # help for read + --no-newline(-n) # Do not print a new line after the secret. + --out-file(-o): path # Write the secret to a file instead of stdout. + reference: op.reference with { root.vault: by "nu-complete op vault" root.item: by "nu-complete op item" } +] where { + requires --file-mode --out-file + terminal [--help --version] } -def "nu completion ssh-generate-key" [] { - ['ed25519', 'rsa', 'rsa2048', 'rsa3072', 'rsa4096'] +# Pass secrets as environment variables to a process +export complete [op run] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --env-file: path # Enable Dotenv integration with specific Dotenv files to parse. For example: --env-file=.env. + --help(-h) # help for run + --no-masking # Disable masking of secrets on stdout and stderr. + ...command: command +] where { + terminal [--help --version] } -def nu_plugins [] { - op plugin list --format json | from json +# Sign in to a 1Password account +export complete [op signin] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --force(-f) # Ignore warnings and print raw output from this command. + --help(-h) # help for signin + --raw # Only return the session token. +] where { + excludes --raw --force + terminal [--help --version] } -def "nu completion plugin_name" [] { - nu_plugins | get plugin_name | uniq +# Sign out of a 1Password account +export complete [op signout] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --all # Sign out of all signed-in accounts. + --forget # Remove the details for a 1Password account from this device. + --help(-h) # help for signout +] where { + terminal [--help --version] } -def "nu completion plugin_executable" [] { - nu_plugins | get executable | uniq +# Check for and download updates. +export complete [op update] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --channel: words [stable beta] # Look for updates from a specific channel. allowed: stable, beta + --directory: path # Download the update to this ''path''. + --help(-h) # help for update +] where { + terminal [--help --version] } -def "nu completion permission" [] { - [ - allow_viewing, allow_editing, allow_managing, - - {value: view_items, description: 'ALLOW_VIEWING: 1password for business only'} - {value: view_and_copy_passwords, description: 'ALLOW_VIEWING: 1password for business only'} - {value: view_item_history, description: 'ALLOW_VIEWING: 1password for business only'} - - {value: create_items, description: 'ALLOW_EDITING: 1password for business only'} - {value: edit_items, description: 'ALLOW_EDITING: 1password for business only'} - {value: archive_items, description: 'ALLOW_EDITING: 1password for business only'} - {value: delete_items, description: 'ALLOW_EDITING: 1password for business only'} - {value: import_items, description: 'ALLOW_EDITING: 1password for business only'} - {value: export_items, description: 'ALLOW_EDITING: 1password for business only'} - {value: copy_and_share_items, description: 'ALLOW_EDITING: 1password for business only'} - {value: print_items, description: 'ALLOW_EDITING: 1password for business only'} - - {value: manage_vault, description: 'ALLOW_MANAGING: 1password for business only'} - ] +# Get information about a signed-in account +export complete [op whoami] [ + --account: by "nu-complete op account" # Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable. + --cache # Store and use cached information. Caching is enabled by default on UNIX-like systems. Caching is not available on Windows. Options: true, false. Can also be set with the OP_CACHE environment variable. (default true) + --config: dir # Use this configuration directory. + --debug # Enable debug mode. Can also be enabled by setting the OP_DEBUG environment variable to true. + --encoding: words [UTF-8 SHIFT_JIS gbk] # Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk. + --format: words [human-readable json] # Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable. (default "human-readable") + --iso-timestamps # Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable. + --no-color # Print output without color. + --session: text # Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when 1Password app integration is not enabled. + --version(-v) # version for op + --help(-h) # help for whoami +] where { + terminal [--help --version] } -def "nu completion permissions" [$ctx: string] { - let permissions = $ctx | nu completion parse-context | transpose option value | last | get value - if ($permissions | is-not-empty) and ($permissions | str ends-with ,) { - nu completion permission | each {|e| $e | if ($e | describe --detailed | get type) == record { upsert value $"($permissions)($e.value)" } else { upsert value $"($permissions)($e)" } } - } else { - nu completion permission - } -} - -def "nu completion onoff" [] { - [on off] -} - -def "nu completion completion_shell" [] { - [zsh fish powershell bash] -} - -def "nu completion bool" [] { - [ '"true"' '"false"' ] -} - -def "nu completion account" [] { - op account list --format json | from json | select -o account_uuid email | rename value description | sort-by description --ignore-case --natural -} - -def "nu completion document_item" [] { - op item list --format json | from json | where category == "DOCUMENT" | select -o id title | rename value description | sort-by description --ignore-case --natural -} - -def "nu completion item" [] { - op item list --format json | from json | select -o id title additional_information | rename value description - | upsert description {|row| if ($row.additional_information | is-not-empty) and $row.additional_information != '' {$"($row.description) - ($row.additional_information)"} else {$row.description} } - | sort-by description --ignore-case --natural - | select value description -} - -def parse_args_rg [] { "(?<opening_quote>['\"`]?)(?<content>.*?)(?<closing_quote>\\k<opening_quote>)(?<separator>\\s+)" } - -def "nu completion parse-context" []: string -> record { - # context strings starts at cursor position - let ctx = $in + ' ' # add space to end to ensure last part is parsed🙄 - mut parse = $ctx | parse --regex (parse_args_rg) - mut content = '' - - mut cmd = {cmd: $parse.content.0, args: []} - mut args = [] - - $parse = ($parse | skip 1) - - # parse options and arguments - while ($parse | length) > 0 { - let currentArg = $parse.0 - let content = $currentArg.content - # check if part is an option - let isOption = ($content | str starts-with '-') - # if it is an option add the next value as the value of option name's key - if $isOption { - # no need to check for whitespace (\s) in the regex, because content is non-greedy AKA not parsing of option name from raw command string like above - let optName = $content | parse --regex "(?:--?)(?<option_name>[\\w-]+)" | get option_name | first - if ($parse | length) == 1 { - $cmd = ($cmd | upsert $optName null) - } else { - # check if it is the last arg with an unclosed quote - let nextArg = $parse.1 - if $nextArg.opening_quote == '' and ($nextArg.content | parse --regex "(?<quote>['\"`])(?:.*)" | is-not-empty) { - let optValue = $parse | skip 2 | reduce -f ($nextArg.content | str substring 1..) {|e,acc| $acc + ' ' + $e.content } - $parse = ($parse | last 2) - $cmd = ($cmd | upsert $optName $optValue) - } else { - let optValue = $parse.content | get 1 - $cmd = ($cmd | upsert $optName $optValue) - } - } - } else { # not an option: add it to the args list (...rest) - if ($content | parse --regex "(?<quote>['\"`])(?:.*)" | is-not-empty) { - let $content = $parse | skip 1 | reduce -f ($content | str substring 1..) {|e,acc| $acc + ' ' + $e.content } | str trim #don't know why it needs the trim but it does🤷🏿‍♂️ - $args ++= $content - $parse = [[]; []] - } else { - $args ++= $content - } - } - $parse = ($parse | skip (1 + if $isOption {1} else {0})) - } - $cmd | upsert args $args -} - - -def "nu completion output" [ - ctx: string, # entered command [sub command, args, + options] - --complete (-c) # if the copletion should have a closing quote and terminating space - ]: list<string> -> list<string>, string -> list<string> { - - let output = $in - let parse = $ctx + ` ` - | parse --regex (parse_args_rg) - | last - let opening_quote = $parse | get opening_quote - let content = $parse | get content - - # checks within the content (unmatched quote) or if there is a matched quote (unlinkely "some val"-> [why would they tab complete herre?]) - if $opening_quote != '' { - let quote = $opening_quote - $output | each {|e| if $complete { $"($quote)($e)($quote) " } else { $"($quote)($e)" } } - } else if ($content | parse --regex "(?<quote>['\"`])(?:.*)" | is-not-empty) { - let quote = $content | str substring 0..1 - $output | each {|e| if $complete { $"($quote)($e)($quote) " } else { $"($quote)($e)" }} - } else { - let quote = '`' - let wrap = $output | any {|e| $e | str contains ' '} - $output | each {|e| - if $wrap { - if $complete { - $"($quote)($e)($quote) " - } else { - $"($quote)($e)" - } - } else { - if $complete { - $e + ' ' - } else { - $e - } - } - } - } -} diff --git a/custom-completions/pass/extensions/pass-otp/pass-otp-completions.nu b/custom-completions/pass/extensions/pass-otp/pass-otp-completions.nu index ceb4297dc..4cf0ab8b7 100644 --- a/custom-completions/pass/extensions/pass-otp/pass-otp-completions.nu +++ b/custom-completions/pass/extensions/pass-otp/pass-otp-completions.nu @@ -1,41 +1,54 @@ -use ../../nu-complete "nu-complete pass-files" +# Declarative completions for pass-otp, the one-time-password extension for pass. +export use ../../nu-complete "nu-complete pass-files" -# Prompt for and insert a new OTP key. -export extern "pass otp insert" [ - name?: string@"nu-complete pass-files" # The name of the password entry to insert the OTP key into. If not provided, the URI label is used. - --force(-f) # Do not prompt before overwriting an existing URI. - --echo(-e) # Echo the input. - --secret(-s) # Prompt for the OTP secret, assuming SHA1 algorithm, 30-second period, and 6 OTP digits. If set, one of --issuer or --account is also required. If not set, prompt for a key URI. - --issuer(-i): string # The issuer of the OTP key. - --account(-a): string # The account the OTP key belongs to. +# Generate an OTP code +export complete [pass otp] [ + --clip(-c) # Put the OTP code on the clipboard and clear it after 45 seconds + name: by "nu-complete pass-files" # The password entry containing the OTP secret ] -# Appends an OTP key URI to an existing password file. -export extern "pass otp append" [ - name: string@"nu-complete pass-files" # The name of the password entry to insert the OTP key into. - --force(-f) # Do not prompt before overwriting an existing URI. - --echo(-e) # Echo the input. - --secret(-s) # Prompt for the OTP secret, assuming SHA1 algorithm, 30-second period, and 6 OTP digits. If set, one of --issuer or --account is also required. If not set, prompt for a key URI. - --issuer(-i): string # The issuer of the OTP key. - --account(-a): string # The account the OTP key belongs to. +# Generate an OTP code (explicit form) +export complete [pass otp code] [ + --clip(-c) # Put the OTP code on the clipboard and clear it after 45 seconds + name: by "nu-complete pass-files" # The password entry containing the OTP secret ] -# Display the key URI stored in the given password entry. -export extern "pass otp uri" [ - name: string@"nu-complete pass-files" # The name of the password entry. - --clip(-c) # Put the URI on the clipboard. - --qrcode(-q) # Output the URI as a QR code. -] +# Prompt for and insert a new OTP key +export complete [pass otp insert] [ + --force(-f) # Do not prompt before overwriting an existing URI + --echo(-e) # Echo the input + --secret(-s) # Prompt for the secret (SHA1, 30-second period, 6 digits) instead of a key URI + --issuer(-i): text # The issuer of the OTP key (with --secret) + --account(-a): text # The account the OTP key belongs to (with --secret) + name?: by "nu-complete pass-files" # Entry to insert the key into (default: the URI label) +] where { + requires --issuer --secret + requires --account --secret +} -# Test if the given URI is a valid OTP key URI. -export extern "pass otp validate" [ - uri: string # The URI to validate. -] +# Append an OTP key URI to an existing password file +export complete [pass otp append] [ + --force(-f) # Do not prompt before overwriting an existing URI + --echo(-e) # Echo the input + --secret(-s) # Prompt for the secret instead of a key URI + --issuer(-i): text # The issuer of the OTP key (with --secret) + --account(-a): text # The account the OTP key belongs to (with --secret) + name: by "nu-complete pass-files" # The entry to append the key to +] where { + requires --issuer --secret + requires --account --secret +} -# Generate an OTP code. -export extern "pass otp" [ - name: string@"nu-complete pass-files" # The name of the password entry containing the OTP secret. - --clip(-c) # Put the OTP code on the clipboard and clear it after 45 seconds. -] +# Display the key URI stored in the given password entry +export complete [pass otp uri] [ + --clip(-c) # Put the URI on the clipboard + --qrcode(-q) # Output the URI as a QR code + name: by "nu-complete pass-files" # The password entry +] where { + excludes --clip --qrcode +} -export alias "pass otp code" = pass otp +# Test if the given URI is a valid OTP key URI +export complete [pass otp validate] [ + uri: text # The otpauth:// URI to validate +] diff --git a/custom-completions/pass/extensions/pass-update/pass-update-completions.nu b/custom-completions/pass/extensions/pass-update/pass-update-completions.nu index 87b839bf5..42a204879 100644 --- a/custom-completions/pass/extensions/pass-update/pass-update-completions.nu +++ b/custom-completions/pass/extensions/pass-update/pass-update-completions.nu @@ -1,17 +1,25 @@ -use ../../nu-complete "nu-complete pass-files" +# Declarative completions for pass-update, the bulk password updater for pass. +export use ../../nu-complete ["nu-complete pass-files" "nu-complete pass-entries"] -# Interactively update a set of passwords. -export extern "pass update" [ - ...paths: string@"nu-complete pass-files" # The passwords and/or directories to update. - --clip(-c) # Write the password to the clipboard. - --no-symbols(-n) # Do not use any non-alphanumeric characters. - --length(-l): int = 25 # Provide a password length. - --provide(-p) # Let the user specify a password by hand. - --multiline(-m) # Update multiline passwords. If not set, only the first line of a password file is updated. - --include(-i): string # Only update the passwords that match a regex. - --exclude(-e): string # Do not update the passwords that match a regex. - --edit(-E) # Edit the passwords using the default editor. - --force(-f) # Force update. - --version(-V) # Show version information. - --help(-h) # Print a help message. -] +# Interactively update a set of passwords +export complete [pass update] [ + --clip(-c) # Write the password to the clipboard + --no-symbols(-n) # Do not use any non-alphanumeric characters + --length(-l): words [16 20 25 32 48 64] # Password length (default 25) + --provide(-p) # Let the user specify a password by hand + --multiline(-m) # Update multiline passwords, not only the first line + --include(-i): text # Only update the passwords that match this regex + --exclude(-e): text # Do not update the passwords that match this regex + --edit(-E) # Edit the passwords using the default editor + --force(-f) # Force update + --version(-V) # Show version information + --help(-h) # Print a help message + ...paths: by "nu-complete pass-entries" # The passwords and/or directories to update +] where { + at-most-one [--provide --edit] + excludes --provide --no-symbols + excludes --provide --length + excludes --edit --length + excludes --edit --no-symbols + terminal [--help --version] +} diff --git a/custom-completions/pass/nu-complete/mod.nu b/custom-completions/pass/nu-complete/mod.nu index 0791252da..ebfdd6634 100644 --- a/custom-completions/pass/nu-complete/mod.nu +++ b/custom-completions/pass/nu-complete/mod.nu @@ -1,39 +1,53 @@ +# Shared live providers for `pass` and its extensions. + def pass_completions_directory [] { - if ($env | columns | any { |it| $it == "PASSWORD_STORE_DIR" }) { - return $env.PASSWORD_STORE_DIR - } else { - return ("~/.password-store" | path expand) - } + $env.PASSWORD_STORE_DIR? | default ("~/.password-store" | path expand) } +# Password entries in the store (paths relative to the store, without `.gpg`). +@non-destructive export def "nu-complete pass-files" [] { - let dir = (pass_completions_directory) - ls ($dir | path join "**" | path join "*.gpg" | into glob) - | get name - | each {|it| ( $it - | path relative-to $dir - | str replace ".gpg" "" - ) - } + try { + let dir = (pass_completions_directory) + glob ($dir | path join "**" "*.gpg") + | each {|it| $it | path relative-to $dir | str replace --regex '\.gpg$' '' } + | sort + } catch { [] } } +# Folders in the store, with a trailing `/` so a new entry name can follow. +@non-destructive export def "nu-complete pass-directories" [] { - let dir = (pass_completions_directory) - ls ($dir | path join **) - | get name - | where { |it| not (ls $it | is-empty) } - | each {|it| ( $it | path relative-to $dir) } + try { + let dir = (pass_completions_directory) + glob ($dir | path join "**") --no-file --exclude ["**/.git/**" "**/.git" "**/.extensions/**"] + | where {|it| $it != $dir } + | each {|it| $"($it | path relative-to $dir)/" } + | sort + } catch { [] } } +# Entries and folders, for commands that accept either. +@non-destructive +export def "nu-complete pass-entries" [] { + try { (nu-complete pass-directories) | append (nu-complete pass-files) } catch { [] } +} + +# GPG public keys, as key id with the primary uid as description. +@non-destructive export def "nu-complete pass-gpg" [] { - ^gpg --list-keys - | lines - | skip 2 - | split list '' - | each { |entry| - { - value: ($entry.1 | str trim), - description: ($entry.2 | parse --regex '^uid\s*\[[\w\s]*\]\s*(.*?)\s*$' | get 0.capture0) - } - } + try { + mut keys: list<any> = [] + mut cur: any = null + for row in (^gpg --list-keys --with-colons | lines | each { split row ":" }) { + if $row.0 == "pub" { + if $cur != null { $keys = ($keys | append $cur) } + $cur = {value: ($row | get 4), description: ""} + } else if $row.0 == "uid" and $cur != null and $cur.description == "" { + $cur = ($cur | upsert description ($row | get 9)) + } + } + if $cur != null { $keys = ($keys | append $cur) } + $keys + } catch { [] } } diff --git a/custom-completions/pass/pass-completions.nu b/custom-completions/pass/pass-completions.nu index 187bf7f7e..45015b7e4 100644 --- a/custom-completions/pass/pass-completions.nu +++ b/custom-completions/pass/pass-completions.nu @@ -1,93 +1,156 @@ -use nu-complete * +# Declarative completions for pass, the standard unix password manager. +export use nu-complete * + +# Show a password, or list the store +export complete [pass] [ + --clip(-c)?: text # Copy the first (or the given, e.g. -c2) line to the clipboard instead of printing it + --qrcode(-q)?: text # Display the first (or the given) line as a QR code instead of printing it + path?: by "nu-complete pass-entries" # The password to show or the subfolder to list +] where { + excludes --clip --qrcode +} + +# Initialize new password storage or reencrypt existing passwords +export complete [pass init] [ + --path(-p): by "nu-complete pass-directories" # Subfolder to selectively reencrypt + ...gpg_ids: by "nu-complete pass-gpg" # GPG key ids to encrypt the passwords with (`""` to deinitialize a subfolder) +] -# Initialize new password storage or reencrypt existing passwords. -export extern "pass init" [ - ...gpg_ids: string@"nu-complete pass-gpg" # The ID(s) of the GPG public keys the passwords shall be encrypted with. - --path(-p): string@"nu-complete pass-directories" # Subfolder to selectively reencrypt. +# List passwords +export complete [pass ls] [ + subfolder?: by "nu-complete pass-directories" # The subfolder to list ] -# List passwords. -export extern "pass ls" [ - subfolder?: string@"nu-complete pass-directories" # The subfolder to list. +# Alias of `pass ls` +export complete [pass list] [ + subfolder?: by "nu-complete pass-directories" # The subfolder to list ] -# List passwords that match pass-names. -export extern "pass find" [ - ...pass_names: string # List of terms to search for. +# List passwords that match pass-names +export complete [pass find] [ + ...pass_names: text # Terms to search for ] -# Show the value of a password. -export extern "pass show" [ - name: string@"nu-complete pass-files" # The name of the password to show. - --clip(-c) # Do not print the password but instead copy the first (or otherwise specified, example: -c2) line to the clipboard. - --qrcode(-q) # Do not print the password but instead display a QR code. +# Alias of `pass find` +export complete [pass search] [ + ...pass_names: text # Terms to search for ] -# Search for password files containing a given search string when decrypted. -export extern "pass grep" [ - ...grepoptions # Options that will be passed to ^grep. - search_string: string # The search string. +# Show the value of a password +export complete [pass show] [ + --clip(-c)?: text # Copy the first (or the given, e.g. -c2) line to the clipboard instead of printing it + --qrcode(-q)?: text # Display the first (or the given) line as a QR code instead of printing it + name?: by "nu-complete pass-files" # The name of the password to show +] where { + excludes --clip --qrcode +} + +# Search for password files containing a given search string when decrypted +export complete [pass grep] [ + --ignore-case(-i) # Ignore case (passed to grep) + --word-regexp(-w) # Match whole words (passed to grep) + --extended-regexp(-E) # Extended regular expressions (passed to grep) + --fixed-strings(-F) # Fixed strings (passed to grep) + --invert-match(-v) # Invert the match (passed to grep) + search_string: text # The search string ] # Insert a new password -export extern "pass insert" [ - name: string@"nu-complete pass-directories" - --echo(-e) # Enable keyboard echo. - --multiline(-m) # Lines will be read until EOF or Ctrl+D is reached. - --force(-f) # Omit prompt when trying to overwrite existing password. +export complete [pass insert] [ + --echo(-e) # Enable keyboard echo + --multiline(-m) # Read lines until EOF or Ctrl+D + --force(-f) # Omit the prompt when overwriting an existing password + name: by "nu-complete pass-entries" # The name of the new password +] where { + excludes --echo --multiline +} + +# Alias of `pass insert` +export complete [pass add] [ + --echo(-e) # Enable keyboard echo + --multiline(-m) # Read lines until EOF or Ctrl+D + --force(-f) # Omit the prompt when overwriting an existing password + name: by "nu-complete pass-entries" # The name of the new password +] where { + excludes --echo --multiline +} + +# Edit an existing password +export complete [pass edit] [ + name: by "nu-complete pass-files" # The name of the password ] -export alias "pass add" = pass insert +# Generate a new password +export complete [pass generate] [ + --no-symbols(-n) # Do not use any non-alphanumeric characters + --clip(-c) # Copy the password to the clipboard instead of printing it + --qrcode(-q) # Display the password as a QR code + --in-place(-i) # Only replace the first line of an existing password file + --force(-f) # Omit the prompt when overwriting an existing password + name: by "nu-complete pass-entries" # The name of the password + length?: words [16 20 25 32 48 64] # Length of the new password (default 25) +] where { + excludes --in-place --force + excludes --clip --qrcode +} + +# Remove a password or directory +export complete [pass rm] [ + --recursive(-r) # Delete recursively if it is a directory + --force(-f) # Do not prompt before removal + name: by "nu-complete pass-entries" # The password or directory to remove +] -# Edit an existing password. -export extern "pass edit" [ - name: string@"nu-complete pass-files" # The name of the password. +# Alias of `pass rm` +export complete [pass remove] [ + --recursive(-r) # Delete recursively if it is a directory + --force(-f) # Do not prompt before removal + name: by "nu-complete pass-entries" # The password or directory to remove ] -# Generate a new password -export extern "pass generate" [ - name: string@"nu-complete pass-directories" # The name of the password. - length?: int = 25 # the length of the new password. - --no-symbols(-n) # Do not use any non-alphanumeric characters in the generated password. - --clip(-c) # Do not print the password but instead copy it to the clipboard using xclip or wl-clipboard. - --in-place(-i) # Do not interactively prompt, and only replace the first line of the password file with the new generated password, keeping the remainder of the file intact. - --force(-f) # Omit prompt when trying to overwrite existing password. +# Alias of `pass rm` +export complete [pass delete] [ + --recursive(-r) # Delete recursively if it is a directory + --force(-f) # Do not prompt before removal + name: by "nu-complete pass-entries" # The password or directory to remove ] -# Remove a password or directory. -export extern "pass rm" [ - name: string@"nu-complete pass-files" # The name of the password or directory to remove. - --recursive(-r) # delete pass-name recursively if it is a directory. - --force(-f) # Do not interactively prompt before removal. +# Rename or move a password or directory +export complete [pass mv] [ + --force(-f) # Omit the prompt when overwriting an existing password + oldname: by "nu-complete pass-entries" # The password or directory to move + newname: by "nu-complete pass-directories" # Where to move it ] -# Rename or move a password or directory. -export extern "pass mv" [ - oldname: string@"nu-complete pass-files" # The password or directory to copy. - newname: string@"nu-complete pass-directories" # The path to copy the password or directory to. - --force(-f) # Omit prompt when trying to overwrite existing password. +# Alias of `pass mv` +export complete [pass rename] [ + --force(-f) # Omit the prompt when overwriting an existing password + oldname: by "nu-complete pass-entries" # The password or directory to move + newname: by "nu-complete pass-directories" # Where to move it ] -# Copy a password or directory. -export extern "pass cp" [ - oldname: string@"nu-complete pass-files" # The password or directory to copy. - newname: string@"nu-complete pass-directories" # The path to copy the password or directory to. - --force(-f) # Omit prompt when trying to overwrite existing password. +# Copy a password or directory +export complete [pass cp] [ + --force(-f) # Omit the prompt when overwriting an existing password + oldname: by "nu-complete pass-entries" # The password or directory to copy + newname: by "nu-complete pass-directories" # Where to copy it ] -# If the password store is a git repository, execute a git command. -export extern "pass git" [ - ...git_command_args # The git command to run. +# Alias of `pass cp` +export complete [pass copy] [ + --force(-f) # Omit the prompt when overwriting an existing password + oldname: by "nu-complete pass-entries" # The password or directory to copy + newname: by "nu-complete pass-directories" # Where to copy it ] -# Show help information. -export extern "pass help" [] +# If the password store is a git repository, execute a git command +export complete [pass git] [ + subcommand?: words [init status log diff add commit push pull fetch remote branch checkout reset show] # The git subcommand + ...args: text # Arguments for the git command +] -# Show version information. -export extern "pass version" [] +# Show help information +export complete [pass help] [] -export extern "pass" [ - path: string@"nu-complete pass-files" # The password to show or subfolder to list. - --clip(-c) # Do not print the password but instead copy the first (or otherwise specified, example: -c2) line to the clipboard. - --qrcode(-q) # Do not print the password but instead display a QR code. -] +# Show version information +export complete [pass version] [] diff --git a/custom-completions/pdm/pdm-completions.nu b/custom-completions/pdm/pdm-completions.nu index 102297021..8c7d138f0 100644 --- a/custom-completions/pdm/pdm-completions.nu +++ b/custom-completions/pdm/pdm-completions.nu @@ -1,3 +1,7 @@ +def "nu-complete pdm" [] { + [add build cache config export fix import info init install list lock publish remove run search self show sync update use venv] +} + def "nu-complete pdm export-file-format" [] { [pipfile, poetry, flit, setuppy, requirements] } @@ -18,398 +22,484 @@ def "nu-complete pdm venv-commands" [] { [create, list, remove, activate, purge] } -def "nu-complete pdm current-groups" [] { - let ng1 = try {(open pyproject.toml | get tool.pdm.dev-dependencies | columns)} catch {[]} - let ng2 = try {(open pyproject.toml | get project.optional-dependencies | columns)} catch {[]} - [] | append $ng1 | append $ng2 +@non-destructive +export def "nu-complete pdm current-groups" [project?: string] { + let p = try { pdm-pyproject $project } catch { {} } + let dg = $p | get -o dependency-groups | default {} | columns | each {|g| {value: $g, description: 'dependency group'} } + let dev = $p | get -o tool.pdm.dev-dependencies | default {} | columns | each {|g| {value: $g, description: 'dev group'} } + let opt = $p | get -o project.optional-dependencies | default {} | columns | each {|g| {value: $g, description: 'optional group'} } + $dg ++ $dev ++ $opt | uniq-by value } -def "nu-complete pdm current-scripts" [] { - try {(open pyproject.toml | get tool.pdm.scripts | columns)} catch {[]} +# pyproject.toml of the project given with `--project` (or of this directory). +def pdm-pyproject [project?: string] { + open ($project | default . | path join pyproject.toml) } -export extern "pdm add" [ - --verbose(-v) - --global(-g) - --project(-p): path - --lockfile(-L): path - --save-compatible - --save-wildcard, - --save-exact - --save-minimum - --update-reuse - --update-eager - --update-all - --pre - --prerelease - --unconstrained(-u) - --dry-run - --venv: string - --skip(-k) - --dev(-d) - --group(-G): string@"nu-complete pdm current-groups" - --no-sync - --editable (-e) - --no-editable - --no-self - --fail-fast(-x) - --no-isolation -] +# Dependencies of the project (main, optional and dev), names only. +@non-destructive +export def "nu-complete pdm dependencies" [project?: string] { + let p = try { pdm-pyproject $project } catch { {} } + let main = $p | get -o project.dependencies | default [] + let opt = $p | get -o project.optional-dependencies | default {} | values | flatten + let dg = $p | get -o dependency-groups | default {} | values | flatten | where {|d| ($d | describe) == string } + let dev = $p | get -o tool.pdm.dev-dependencies | default {} | values | flatten + $main ++ $opt ++ $dg ++ $dev | each {|d| $d | parse --regex '^(?<n>[A-Za-z0-9._-]+)' | get 0?.n } | compact | uniq +} +@non-destructive +export def "nu-complete pdm current-scripts" [project?: string] { + try { + pdm-pyproject $project | get tool.pdm.scripts | transpose name s + | each {|r| {value: $r.name, description: (if ($r.s | describe) == string { $r.s } else { $r.s | get -o cmd shell call composite help | compact | first | to text })} } + } catch { [] } +} -export extern "pdm build" [ - --verbose(-v) - --project(-p): path - --no-isolation - --skip(-k) - --no-sdist - --no-wheel - --dest(-d): string - --no-clean - --config-setting(-C): string +export complete [pdm] [ + --version(-V) + --help(-h) +] where { + terminal [--help --version] +} -] +export complete [pdm add] [ + ...package: text + --verbose(-v) + --global(-g) + --project(-p): path + --lockfile(-L): path + --save-compatible + --save-wildcard + --save-exact + --save-minimum + --update-reuse + --update-eager + --update-all + --pre + --prerelease + --unconstrained(-u) + --dry-run + --venv: text + --skip(-k) + --dev(-d) + --group(-G): by "nu-complete pdm current-groups" [project: --project] + --no-sync + --editable(-e) + --no-editable + --no-self + --fail-fast(-x) + --no-isolation +] where { + overrides [--editable --no-editable] + excludes --dev --group + at-most-one [--save-compatible --save-wildcard --save-exact --save-minimum] + at-most-one [--update-reuse --update-eager --update-all] + at-most-one [--global --project] + at-most-one [--editable --no-editable] +} -export extern "pdm config" [ - --verbose(-v) - --global(-g) - --project(-p): path - --local(-l) - --delete(-d) - --edit(-e) -] +export complete [pdm build] [ + --verbose(-v) + --project(-p): path + --no-isolation + --skip(-k) + --no-sdist + --no-wheel + --dest(-d): text + --no-clean + --config-setting(-C): text +] where { + at-most-one [--no-sdist --no-wheel] +} -export extern "pdm cache" [ - --verbose(-v) - command?: string@"nu-complete pdm cache-commands" -] +export complete [pdm config] [ + --verbose(-v) + --global(-g) + --project(-p): path + --local(-l) + --delete(-d) + --edit(-e) +] where { + at-most-one [--global --project] +} -export extern "pdm cache list" [ - --verbose(-v) +export complete [pdm cache] [ + --verbose(-v) ] -export extern "pdm cache clear" [ - --verbose(-v) - ...targets: string@"nu-complete pdm cache-types" +export complete [pdm cache list] [ + --verbose(-v) ] -export extern "pdm cache remove" [ - --verbose(-v) +export complete [pdm cache clear] [ + --verbose(-v) + ...targets: words ["hashes" "http" "wheels" "metadata" "packages"] ] -export extern "pdm cache info" [ - --verbose(-v) +export complete [pdm cache remove] [ + --verbose(-v) ] -export extern "pdm export" [ - --verbose(-v) - --global(-g) - --project(-p): path - --lockfile(-L): path - --format: string@"nu-complete pdm export-file-format" - --without-hashes - --output(-o): string - --pyproject - --expandvars - --group(-G): string@"nu-complete pdm current-groups" - --no-default - --dev(-d) - --prod +export complete [pdm cache info] [ + --verbose(-v) ] -export extern "pdm fix" [ - --verbose(-v) - --global(-g) - --project(-p): path - --dry-run -] +export complete [pdm export] [ + --verbose(-v) + --global(-g) + --project(-p): path + --lockfile(-L): path + --format: words ["pipfile" "poetry" "flit" "setuppy" "requirements"] + --without-hashes + --output(-o): text + --pyproject + --expandvars + --group(-G): by "nu-complete pdm current-groups" [project: --project] + --no-default + --dev(-d) + --prod +] where { + at-most-one [--dev --prod] + at-most-one [--global --project] +} -export extern "pdm import" [ - --verbose(-v) - --global(-g) - --project(-p): path - --dev(-d) - --group(-G): string@"nu-complete pdm current-groups" - --format: string@"nu-complete pdm export-file-format" -] +export complete [pdm fix] [ + --verbose(-v) + --global(-g) + --project(-p): path + --dry-run +] where { + at-most-one [--global --project] +} -export extern "pdm info" [ - --verbose(-v) - --global(-g) - --project(-p): path - --python - --where - --packages - --env - --json -] +export complete [pdm import] [ + file: path + --verbose(-v) + --global(-g) + --project(-p): path + --dev(-d) + --group(-G): by "nu-complete pdm current-groups" [project: --project] + --format: words ["pipfile" "poetry" "flit" "setuppy" "requirements"] +] where { + at-most-one [--global --project] +} -export extern "pdm init" [ - --verbose(-v) - --global(-g) - --project(-p): path - --skip(-k) - --copier - --cookiecutter - --non-interactive(-n) - --python: string - --backend: string - --lib - template?: path - ...generator_args: string -] +export complete [pdm info] [ + --verbose(-v) + --global(-g) + --project(-p): path + --python + --where + --packages + --env + --json +] where { + at-most-one [--global --project] + at-most-one [--python --where --packages --env] +} +export complete [pdm init] [ + --verbose(-v) + --global(-g) + --project(-p): path + --skip(-k) + --copier + --cookiecutter + --non-interactive(-n) + --python: text + --backend: text + --lib + template?: path + ...generator_args: text +] where { + at-most-one [--global --project] + at-most-one [--copier --cookiecutter] +} -export extern "pdm install" [ - --verbose(-v) - --global(-g) - --project(-p): path - --dry-run - --lockfile(-L): path - --skip(-k) - --venv: string - --no-lock - --check - --plugins - --group(-G): string@"nu-complete pdm current-groups" - --no-default - --dev(-d) - --prod - --no-editable - --no-self - --fail-fast(-x) - --no-isolation -] +export complete [pdm install] [ + --verbose(-v) + --global(-g) + --project(-p): path + --dry-run + --lockfile(-L): path + --skip(-k) + --venv: text + --no-lock + --check + --plugins + --group(-G): by "nu-complete pdm current-groups" [project: --project] + --no-default + --dev(-d) + --prod + --no-editable + --no-self + --fail-fast(-x) + --no-isolation +] where { + at-most-one [--dev --prod] + at-most-one [--global --project] +} -export extern "pdm list" [ - --verbose(-v) - --global(-g) - --project(-p): path - --venv: string - --freeze - --graph - --reverse(-r) - --resolve - --fields: string - --sort: string - --csv - --json - --markdown - --include: string - --exclude: string -] +export complete [pdm list] [ + --verbose(-v) + --global(-g) + --project(-p): path + --venv: text + --freeze + --graph + --reverse(-r) + --resolve + --fields: text + --sort: text + --csv + --json + --markdown + --include: text + --exclude: text +] where { + at-most-one [--global --project] + at-most-one [--json --csv --markdown --freeze --graph] +} -export extern "pdm lock" [ - --verbose(-v) - --global(-g) - --project(-p): path - --lockfile(-L): path - --no-isolation - --skip(-k) - --refresh - --check - --no-cross-platform - --static-urls - --no-static-urls - --group(-G): string@"nu-complete pdm current-groups" - --no-default - --dev(-d) - --prod -] +export complete [pdm lock] [ + --verbose(-v) + --global(-g) + --project(-p): path + --lockfile(-L): path + --no-isolation + --skip(-k) + --refresh + --check + --no-cross-platform + --static-urls + --no-static-urls + --group(-G): by "nu-complete pdm current-groups" [project: --project] + --no-default + --dev(-d) + --prod +] where { + overrides [--static-urls --no-static-urls] + at-most-one [--dev --prod] + at-most-one [--global --project] + at-most-one [--static-urls --no-static-urls] +} -export extern "pdm publish" [ - --verbose(-v) - --global(-g) - --project(-p): path - --skip(-k) - --repository(-r): string - --username(-u): string - --password(-P): string - --sign(-S) - --identity(-i): string - --comment(-c): string - --no-build - --no-very-ssl - --ca-certs: path -] +export complete [pdm publish] [ + --verbose(-v) + --global(-g) + --project(-p): path + --skip(-k) + --repository(-r): text + --username(-u): text + --password(-P): text + --sign(-S) + --identity(-i): text + --comment(-c): text + --no-build + --no-very-ssl + --ca-certs: path +] where { + at-most-one [--global --project] +} -export extern "pdm remove" [ - --verbose(-v) - --global(-g) - --project(-p): path - --dry-run - --lockfile(-L): path - --skip(-k) - --venv: string - --dev(-d) - --group(-G): string@"nu-complete pdm current-groups" - --no-sync - --no-editable - --no-self - --fail-fast(-x) - --no-isolation -] +export complete [pdm remove] [ + ...package: by "nu-complete pdm dependencies" [project: --project] + --verbose(-v) + --global(-g) + --project(-p): path + --dry-run + --lockfile(-L): path + --skip(-k) + --venv: text + --dev(-d) + --group(-G): by "nu-complete pdm current-groups" [project: --project] + --no-sync + --no-editable + --no-self + --fail-fast(-x) + --no-isolation +] where { + at-most-one [--global --project] +} -export extern "pdm run" [ - --verbose(-v) - --global(-g) - --project(-p): path - --skip(-k) - --venv: string - --list(-l) - --json(-j) - --site-packages(-s) - script: string@"nu-complete pdm current-scripts" - ...args: string -] +export complete [pdm run] [ + --verbose(-v) + --global(-g) + --project(-p): path + --skip(-k) + --venv: text + --list(-l) + --json(-j) + --site-packages(-s) + script: by "nu-complete pdm current-scripts" [project: --project] + ...args: text +] where { + at-most-one [--global --project] +} -export extern "pdm search" [ - --verbose(-v) +export complete [pdm search] [ + ...package: text + --verbose(-v) ] -export extern "pdm self" [ - --verbose(-v) - command?: string@"nu-complete pdm self-commands" +export complete [pdm self] [ + --verbose(-v) ] -export extern "pdm self list" [ - --verbose(-v) - --plugins +export complete [pdm self list] [ + --verbose(-v) + --plugins ] -export extern "pdm self add" [ - --verbose(-v) - --pip-args: string - ...packages: string +export complete [pdm self add] [ + --verbose(-v) + --pip-args: text + ...packages: text ] -export extern "pdm self remove" [ - --verbose(-v) - --pip-args: string - --yes(-y) - ...packages: string +export complete [pdm self remove] [ + --verbose(-v) + --pip-args: text + --yes(-y) + ...packages: text ] -export extern "pdm self update" [ - --verbose(-v) - --pip-args: string - --head - --pre +export complete [pdm self update] [ + --verbose(-v) + --pip-args: text + --head + --pre ] -export extern "pdm show" [ - --verbose(-v) - --global(-g) - --project(-p): path - --venv: string - --name - --version - --summary - --license - --platform - --keywords - package?: string -] +export complete [pdm show] [ + --verbose(-v) + --global(-g) + --project(-p): path + --venv: text + --name + --version + --summary + --license + --platform + --keywords + package?: text +] where { + at-most-one [--global --project] + at-most-one [--name --version --summary --license --platform --keywords] +} -export extern "pdm sync" [ - --verbose(-v) - --global(-g) - --project(-p): path - --dry-run - --lockfile(-L): path - --skip(-k) - --venv: string - --clean - --only-keep - --reinstall(-r) - --group(-G): string@"nu-complete pdm current-groups" - --no-default - --dev(-d) - --prod - --no-editable - --no-self - --fail-fast(-x) - --no-isolation -] +export complete [pdm sync] [ + --verbose(-v) + --global(-g) + --project(-p): path + --dry-run + --lockfile(-L): path + --skip(-k) + --venv: text + --clean + --only-keep + --reinstall(-r) + --group(-G): by "nu-complete pdm current-groups" [project: --project] + --no-default + --dev(-d) + --prod + --no-editable + --no-self + --fail-fast(-x) + --no-isolation +] where { + at-most-one [--dev --prod] + at-most-one [--global --project] +} -export extern "pdm update" [ - --verbose(-v) - --global(-g) - --project(-p): path - --lockfile(-L): path - --save-compatible - --save-wildcard, - --save-exact - --save-minimum - --update-reuse - --update-eager - --update-all - --pre - --prerelease - --unconstrained(-u) - --dry-run - --venv: string - --skip(-k) - --dev(-d) - --group(-G): string@"nu-complete pdm current-groups" - --no-sync - --editable (-e) - --no-editable - --no-self - --fail-fast(-x) - --no-isolation -] +export complete [pdm update] [ + ...package: by "nu-complete pdm dependencies" [project: --project] + --verbose(-v) + --global(-g) + --project(-p): path + --lockfile(-L): path + --save-compatible + --save-wildcard + --save-exact + --save-minimum + --update-reuse + --update-eager + --update-all + --pre + --prerelease + --unconstrained(-u) + --dry-run + --venv: text + --skip(-k) + --dev(-d) + --group(-G): by "nu-complete pdm current-groups" [project: --project] + --no-sync + --editable(-e) + --no-editable + --no-self + --fail-fast(-x) + --no-isolation +] where { + overrides [--editable --no-editable] + at-most-one [--save-compatible --save-wildcard --save-exact --save-minimum] + at-most-one [--update-reuse --update-eager --update-all] + at-most-one [--global --project] + at-most-one [--editable --no-editable] +} -export extern "pdm use" [ - --verbose(-v) - --global(-g) - --project(-p): path - --skip(-k) - --first(-f) - --ignore-remembered(-i) - --venv: string - python?: string -] +export complete [pdm use] [ + --verbose(-v) + --global(-g) + --project(-p): path + --skip(-k) + --first(-f) + --ignore-remembered(-i) + --venv: text + python?: text +] where { + at-most-one [--global --project] +} -export extern "pdm venv" [ - --verbose(-v) - --global(-g) - --project(-p): path - --skip(-k) - --first(-f) - --ignore-remembered(-i) - --venv: string - --python: string - command?: string@"nu-complete pdm venv-commands" -] +export complete [pdm venv] [ + --verbose(-v) + --global(-g) + --project(-p): path + --skip(-k) + --first(-f) + --ignore-remembered(-i) + --venv: text + --python: text +] where { + at-most-one [--global --project] +} -export extern "pdm venv create" [ - --verbose(-v) - --force(-f) - --name(-n): string - --with-pip - --with: string - python: string - ...venv_args: string +export complete [pdm venv create] [ + --verbose(-v) + --force(-f) + --name(-n): text + --with-pip + --with: text + python: text + ...venv_args: text ] -export extern "pdm venv list" [ - --verbose(-v) +export complete [pdm venv list] [ + --verbose(-v) ] -export extern "pdm venv remove" [ - --verbose(-v) - --yes(-y) - env: string +export complete [pdm venv remove] [ + --verbose(-v) + --yes(-y) + env: text ] -export extern "pdm venv activate" [ - --verbose(-v) - env: string +export complete [pdm venv activate] [ + --verbose(-v) + env: text ] -export extern "pdm venv purge" [ - --verbose(-v) - --force(-f) - --interactive(-i) -] \ No newline at end of file +export complete [pdm venv purge] [ + --verbose(-v) + --force(-f) + --interactive(-i) +] diff --git a/custom-completions/pnpm/pnpm-completions.nu b/custom-completions/pnpm/pnpm-completions.nu index 272a48c6c..ab3d64481 100644 --- a/custom-completions/pnpm/pnpm-completions.nu +++ b/custom-completions/pnpm/pnpm-completions.nu @@ -1,74 +1,253 @@ +# pnpm — fast, disk space efficient package manager. Declarative completions (`export complete`). +# Scripts of package.json, with the command they run. +@non-destructive export def "nu-complete get scripts" [] { - open package.json - | get scripts - #| describe record<start: string, build: string, test: string, eject: string> - | transpose # to convert the record<start: string, build: string, test: string, eject: string> into a table - | rename value description + try { open package.json | get scripts | transpose value description } catch { [] } } +# Dependencies (prod, dev, optional, peer) of package.json. +@non-destructive export def "nu-complete get deps" [] { - let packagejson = (open ./package.json) - let deps = try { $packagejson | get dependencies | columns } catch { [] } - let devDeps = try { $packagejson | get devDependencies | columns } catch { [] } + try { + let manifest = open ./package.json + [dependencies devDependencies optionalDependencies peerDependencies] + | each {|kind| $manifest | get -o $kind | default {} | transpose value version | each {|d| {value: $d.value, description: $"($d.version) · ($kind)"} } } + | flatten + | uniq-by value + } catch { [] } +} + +# Workspace packages (from pnpm-workspace.yaml), for `--filter`. +@non-destructive +export def "nu-complete pnpm workspace packages" [] { + try { + open pnpm-workspace.yaml | get -o packages | default [] | where {|g| not ($g starts-with '!') } + | each {|g| glob $g } | flatten + | each {|dir| try { open ($dir | path join package.json) | get name } catch { null } } | compact + } catch { [] } +} + +# Binaries of node_modules/.bin, for `pnpm exec`. +@non-destructive +export def "nu-complete pnpm bins" [] { + try { ls node_modules/.bin | get name | path basename } catch { [] } +} + +export complete [pnpm] [ + ...args: by "nu-complete get scripts" # A package.json script (pnpm runs unknown commands as scripts) + --dir(-C): dir cwd # Run as if pnpm was started in <dir> + --workspace-root(-w) # Run on the root of the workspace + --recursive(-r) # Run the command for each project in the workspace + --filter(-F): by "nu-complete pnpm workspace packages" # Restrict the command to matching packages + --reporter: words [silent default append-only ndjson] # Output reporter + --silent(-s) # Only print errors + --loglevel: words [debug info warn error] # Log level + --color # Force colored output + --no-color # Disable colored output + --stream # Stream output from child processes immediately + --aggregate-output # Aggregate output from child processes + --help(-h) # Print help + --version(-v) # Print version +] where { + at-most-one [--silent --reporter --loglevel] + overrides [--color --no-color] + at-most-one [--stream --aggregate-output] + terminal [--help --version] +} + +export complete [pnpm run] [ + script?: by "nu-complete get scripts" # The package.json script to run + ...args: text + --recursive(-r) # Run the script in every workspace project + --filter(-F): by "nu-complete pnpm workspace packages" + --if-present # Avoid exiting with non-zero when the script is undefined + --parallel # Ignore concurrency and topological sorting + --sequential # Run sequentially + --stream # Stream output immediately, prefixed with the package + --resume-from: by "nu-complete pnpm workspace packages" # Resume from a particular project + --report-summary # Save execution results to pnpm-exec-summary.json + --no-bail # Don't stop on the first failure + --help(-h) # Print help +] where { + at-most-one [--parallel --sequential] + terminal [--help] +} + +export complete [pnpm add] [ + ...package: text # <pkg>[@<version>] + --save-exact(-E) # Install exact version + --global(-g) # Install as a global package + --recursive(-r) # Add to every workspace project + --filter(-F): by "nu-complete pnpm workspace packages" + --workspace # Only add if the package is in the workspace + --save-dev(-D) # Save to devDependencies + --save-optional(-O) # Save to optionalDependencies + --save-peer # Save to peerDependencies and devDependencies + --save-prod(-P) # Save to dependencies (default) + --save-catalog # Save to the default catalog + --ignore-scripts # Don't run lifecycle scripts + --help(-h) # Print help +] where { + at-most-one [--save-dev --save-optional --save-peer --save-prod] + excludes --global --recursive + terminal [--help] +} - $deps | append $devDeps +export complete [pnpm remove] [ + ...package: by "nu-complete get deps" + --recursive(-r) # Remove from every workspace project + --filter(-F): by "nu-complete pnpm workspace packages" + --global(-g) # Remove a global package + --save-dev(-D) # Only remove from devDependencies + --save-optional(-O) # Only remove from optionalDependencies + --save-prod(-P) # Only remove from dependencies + --help(-h) # Print help +] where { + at-most-one [--save-dev --save-optional --save-prod] + terminal [--help] } -def "nu-complete pnpm" [] { - [ - # manage your dependencies section - { value: "add", description: "Installs a package and any packages that it depends on. By default, any new package is installed as a prod dependency" } - { value: "import", description: "Generates a pnpm-lock.yaml from an npm package-lock.json (or npm-shrinkwrap.json) file" } - { value: "install", description: "(i) Install all dependencies for a project" } - { value: "install-test", description: "(it) Runs a pnpm install followed immediately by a pnpm test" } - { value: "link", description: "(ln) Connect the local project to another one" } - { value: "prune", description: "Removes extraneous packages" } - { value: "rebuild", description: "(rb) Rebuild a package" } - { value: "remove", description: "(rm) Removes packages from node_modules and from the project's package.json" } - { value: "unlink", description: "Unlinks a package. Like yarn unlink but pnpm re-installs the dependency after removing the external link" } - { value: "update", description: "(up) Updates packages to their latest version based on the specified range" } - # review your dependencies section - { value: "audit", description: "Checks for known security issues with the installed packages" } - { value: "licenses", description: "Check licenses in consumed packages" } - { value: "list", description: "(ls) Print all the versions of packages that are installed, as well as their dependencies, in a tree-structure" } - { value: "outdated", description: "Check for outdated packages" } - # run your scripts section - { value: "exec", description: "Executes a shell command in scope of a project" } - { value: "run", description: "Runs a defined package script" } - { value: "start", description: "Runs an arbitrary command specified in the package's `start` property of its `scripts` object" } - { value: "test", description: "(t) Runs a package's `test` script, if one was provided" } - # others - { value: "pack", description:"" } - { value: "publish", description:"Publishes a package to the registry" } - { value: "root", description:"" } - { value: "store", description:"store add, store path, store prune & store status" } - ] +export complete [pnpm install] [ + --frozen-lockfile # Refuse to update the lockfile + --no-frozen-lockfile # Allow updating the lockfile + --prefer-frozen-lockfile # Skip resolution when the lockfile satisfies package.json + --lockfile-only # Only update pnpm-lock.yaml + --prod(-P) # Install only the production dependencies + --dev(-D) # Install only the development dependencies + --no-optional # Skip optionalDependencies + --offline # Use only packages already in the store + --prefer-offline # Prefer cached data + --ignore-scripts # Don't run lifecycle scripts + --force # Force reinstall + --recursive(-r) # Install in every workspace project + --filter(-F): by "nu-complete pnpm workspace packages" + --fix-lockfile # Fix broken lockfile entries + --resolution-only # Re-run resolution + --node-linker: words [isolated hoisted pnp] # How node_modules is laid out + --help(-h) # Print help +] where { + overrides [--frozen-lockfile --no-frozen-lockfile] + at-most-one [--frozen-lockfile --lockfile-only --fix-lockfile] + at-most-one [--prod --dev] + at-most-one [--offline --prefer-offline] + terminal [--help] } -export extern "pnpm" [ - command?: string@"nu-complete pnpm" - --recursive(-r) # Run the command for each project in the workspace. - --help(-h) # Print help information -] - -export extern "pnpm run" [ - command?: string@"nu-complete get scripts" - --help(-h) # Print help information -] - -export extern "pnpm remove" [ - command?: string@"nu-complete get deps" - --help(-h) # Print help information -] - -export extern "pnpm add" [ - --help(-h) # Print help information - --save-exact(-E) # Install exact version - --global(-g) # Install as a global package - --recursive(-r) # Run installation recursively in every package found in subdirectories or in every workspace package, when executed inside a workspace. For options that may be used with `-r`, see "pnpm help recursive" - --save-dev(-D) # Save package to your `devDependencies` - --save-optional(-O) # Save package to your `optionalDependencies` - --save-peer # Save package to your `peerDependencies` and `devDependencies` - --save-prod(-P) # Save package to your `dependencies`. The default behavior -] +export complete [pnpm update] [ + ...package: by "nu-complete get deps" + --latest(-L) # Update to the latest version, ignoring the ranges + --recursive(-r) # Update the dependencies of every workspace project + --filter(-F): by "nu-complete pnpm workspace packages" + --global(-g) # Update global packages + --interactive(-i) # Pick the packages to update + --workspace # Link workspace packages + --prod(-P) # Only update dependencies + --dev(-D) # Only update devDependencies + --no-optional # Don't update optionalDependencies + --depth: text # How deep to update + --help(-h) # Print help +] where { + at-most-one [--prod --dev] + terminal [--help] +} + +export complete [pnpm list] [ + ...package: by "nu-complete get deps" + --global(-g) # List the globally installed packages + --recursive(-r) # List packages of every workspace project + --depth: text # Limit the depth of the tree + --long # Show extended information + --json # Print the tree as JSON + --parseable # Output parseable paths + --prod(-P) # Show only the production dependencies + --dev(-D) # Show only the development dependencies + --help(-h) # Print help +] where { + at-most-one [--json --parseable] + at-most-one [--prod --dev] + terminal [--help] +} + +export complete [pnpm why] [ + ...package: by "nu-complete get deps" + --recursive(-r) --json --long --parseable --prod(-P) --dev(-D) --help(-h) +] where { + at-most-one [--json --parseable] + at-most-one [--prod --dev] + terminal [--help] +} + +export complete [pnpm outdated] [ + ...package: by "nu-complete get deps" + --recursive(-r) --long --json --compatible --prod(-P) --dev(-D) + --format: words [table list json] + --help(-h) +] where { + at-most-one [--json --format] + at-most-one [--prod --dev] + terminal [--help] +} + +export complete [pnpm exec] [ + ...command: by "nu-complete pnpm bins" # The command (and its arguments) to run + --recursive(-r) # Run in every workspace project + --parallel # Ignore concurrency and topological sorting + --shell-mode(-c) # Run the command inside a shell + --help(-h) # Print help +] where { terminal [--help] } + +export complete [pnpm dlx] [ + ...command: text # Package (and arguments) to fetch and run + --package: text # The package to install before running + --shell-mode(-c) # Run the command inside a shell + --help(-h) # Print help +] where { terminal [--help] } + +export complete [pnpm create] [ name: text ...args: text --help(-h) ] where { terminal [--help] } +export complete [pnpm test] [ ...args: text --recursive(-r) --help(-h) ] where { terminal [--help] } +export complete [pnpm start] [ ...args: text --help(-h) ] where { terminal [--help] } +export complete [pnpm init] [ --help(-h) ] where { terminal [--help] } +export complete [pnpm import] [ --help(-h) ] where { terminal [--help] } +export complete [pnpm prune] [ --prod --no-optional --help(-h) ] where { terminal [--help] } +export complete [pnpm rebuild] [ ...package: by "nu-complete get deps" --recursive(-r) --help(-h) ] where { terminal [--help] } +export complete [pnpm link] [ target?: dir --global(-g) --help(-h) ] where { terminal [--help] } +export complete [pnpm unlink] [ ...package: by "nu-complete get deps" --recursive(-r) --help(-h) ] where { terminal [--help] } +export complete [pnpm audit] [ + --audit-level: words [low moderate high critical] + --fix --json --dev(-D) --prod(-P) --no-optional --ignore-registry-errors --help(-h) +] where { + at-most-one [--prod --dev] + terminal [--help] +} +export complete [pnpm licenses] [ --help(-h) ] where { terminal [--help] } +export complete [pnpm licenses list] [ --json --long --prod(-P) --dev(-D) ] +export complete [pnpm pack] [ --pack-destination: dir --out: path --json --help(-h) ] where { terminal [--help] } +export complete [pnpm publish] [ + dir?: dir # Directory or tarball to publish + --tag: text # Register the package under the given dist-tag + --access: words [public restricted] # Set the access level of the published package + --dry-run # Report what would be published without publishing + --no-git-checks # Don't check the git branch/state + --publish-branch: text # Primary branch of the repository + --otp: text # One-time password + --recursive(-r) # Publish all workspace packages + --force # Publish even if the version already exists + --help(-h) # Print help +] where { terminal [--help] } +export complete [pnpm root] [ --global(-g) --help(-h) ] where { terminal [--help] } +export complete [pnpm bin] [ --global(-g) --help(-h) ] where { terminal [--help] } +export complete [pnpm store] [ --help(-h) ] where { terminal [--help] } +export complete [pnpm store add] [ ...package: text ] +export complete [pnpm store path] [] +export complete [pnpm store prune] [ --force ] +export complete [pnpm store status] [] +export complete [pnpm env] [ --help(-h) ] where { terminal [--help] } +export complete [pnpm env use] [ version: words [lts latest rc nightly] --global(-g) ] +export complete [pnpm env list] [ --remote ] +export complete [pnpm env remove] [ version: text --global(-g) ] +export complete [pnpm config] [ --help(-h) ] where { terminal [--help] } +export complete [pnpm config get] [ key: text --global(-g) --json ] +export complete [pnpm config set] [ key: text value?: text --global(-g) --location: words [global project] ] +export complete [pnpm config delete] [ key: text --global(-g) ] +export complete [pnpm config list] [ --json --global(-g) ] diff --git a/custom-completions/podman/podman-completions.nu b/custom-completions/podman/podman-completions.nu index 72666a6a4..00c33bef0 100644 --- a/custom-completions/podman/podman-completions.nu +++ b/custom-completions/podman/podman-completions.nu @@ -1,1104 +1,2659 @@ -def "nu-complete podman containers" [] { - ^podman ps -a --format "{{.ID}} {{.Names}}" | lines - | parse "{value} {description}" +# Declarative completions for podman. +# +# The `export complete` declarations describe each route once; the live providers below +# (all `@non-destructive`, all wrapped in `try`/`catch`) read containers, images, pods, +# networks, volumes, connections and compose services from `podman ... --format json`. +# `podman.port` describes `--publish` values: `[ip:]host:container[/proto]`. +# `export def` commands such as `podman-containers` stay user-facing. + +# The containers, running or not, one row each: `id`, `name`, `image`, `state` (running, exited, +# ...) and the human `status` ("Up 2 hours"). Reads only. +# `podman-containers | where name == ` completes the names. +@non-destructive +@example "Names of the containers that are running" { podman-containers | where state == running | get name } +@example "Containers started from an image" { podman-containers | where image =~ nginx } +export def podman-containers []: nothing -> table<id: string, name: string, image: string, state: string, status: string> { + ^podman ps --all --format '{{.ID}}|{{.Names}}|{{.Image}}|{{.State}}|{{.Status}}' + | lines + | parse "{id}|{name}|{image}|{state}|{status}" +} + +# The images, one row each: `id`, `repository`, `tag` and `size`. Reads only. +# `podman-images | where size > ` completes the sizes. +@non-destructive +@example "The images over a gigabyte" { podman-images | where size > 1gb | get repository } +@example "Every tag of one repository" { podman-images | where repository == alpine | get tag } +export def podman-images []: nothing -> table<id: string, repository: string, tag: string, size: filesize> { + ^podman images --format '{{.ID}}|{{.Repository}}|{{.Tag}}|{{.Size}}' + | lines + | parse "{id}|{repository}|{tag}|{size}" + | update size { try { into filesize } catch { 0b } } +} + +# The volumes, one row each: `name` and `driver`. Reads only. +@non-destructive +@example "Names of the local volumes" { podman-volumes | where driver == local | get name } +export def podman-volumes []: nothing -> table<name: string, driver: string> { + ^podman volume ls --format '{{.Name}}|{{.Driver}}' + | lines + | parse "{name}|{driver}" +} + +# The networks, one row each: `id`, `name` and `driver`. Reads only. +@non-destructive +@example "Names of the bridge networks" { podman-networks | where driver == bridge | get name } +export def podman-networks []: nothing -> table<id: string, name: string, driver: string> { + ^podman network ls --format '{{.ID}}|{{.Name}}|{{.Driver}}' + | lines + | parse "{id}|{name}|{driver}" +} + +# --- Live providers --------------------------------------------------------------- + +# A container's first name (podman reports `Names` as a list). +def first-name []: any -> string { + let names = $in + if ($names | describe | str starts-with 'list') { $names | first } else { $names } +} + +# Running containers, by name, described by image and status. +@non-destructive +export def "nu-complete podman containers" [] { + try { + ^podman ps --format json | from json + | each {|c| {value: ($c.Names | first-name), description: $"($c.Image) — ($c.Status)"} } + } catch { + [] + } +} + +# Every container, running or not, by name, described by image and status. +@non-destructive +export def "nu-complete podman all-containers" [] { + try { + ^podman ps --all --format json | from json + | each {|c| {value: ($c.Names | first-name), description: $"($c.Image) — ($c.Status)"} } + } catch { + [] + } } -def "nu-complete podman images" [] { - ^podman images --format "{{.ID}} {{.Repository}}" | lines - | parse "{value} {description}" +# Local images as `repository:tag` (or the id for untagged ones), described by size and age. +@non-destructive +export def "nu-complete podman images" [] { + try { + ^podman images --format '{{json .}}' | lines | where $it != '' | each { from json } + | each {|i| + let value = if $i.Repository == '<none>' { $i.ID } else if $i.Tag == '<none>' { $i.Repository } else { $"($i.Repository):($i.Tag)" } + {value: $value, description: $"($i.Size), ($i.CreatedSince)"} + } + } catch { + [] + } } -def "nu-complete podman run" [] { - (nu-complete podman images) - | append (nu-complete podman containers) +# Pods, by name, described by status and container count. +@non-destructive +export def "nu-complete podman pods" [] { + try { + ^podman pod ps --format json | from json + | each {|p| {value: $p.Name, description: $"($p.Status), ($p.Containers | length) containers"} } + } catch { + [] + } } -def "nu-complete podman pull" [] { - [always, missing, never] +# Networks, by name, described by driver. +@non-destructive +export def "nu-complete podman networks" [] { + try { + ^podman network ls --format json | from json + | each {|n| {value: $n.name, description: $n.driver} } + } catch { + [] + } } -def "nu-complete podman remove image" [] { - [local, all] +# Volumes, by name, described by driver. +@non-destructive +export def "nu-complete podman volumes" [] { + try { + ^podman volume ls --format json | from json + | each {|v| {value: $v.Name, description: $v.Driver} } + } catch { + [] + } } -def "nu-complete local files" [] { - ^ls | lines +# System connections (podman's counterpart of docker contexts), by name, described by URI. +@non-destructive +export def "nu-complete podman contexts" [] { + try { + ^podman system connection ls --format json | from json + | each {|c| {value: $c.Name, description: (if $c.Default { $"default, ($c.URI)" } else { $c.URI })} } + } catch { + [] + } } -def "nu-complete podman compose ps" [] { - ^podman compose ps -a --format "{{.ID}} {{.Names}}" | lines - | parse "{value} {description}" +# The services of the compose project in the current directory. +@non-destructive +export def "nu-complete podman compose services" [] { + try { + ^podman compose config --services | lines | where $it != '' + } catch { + [] + } } -def "nu-complete podman compose service status" [] { - [paused restarting removing running dead created exited] +# Top-level subcommands, from `podman --help`. +@non-destructive +export def "nu-complete podman subcommands" [] { + try { + ^podman --help | lines | where $it =~ '^ {2}[A-Za-z]' + | parse --regex '^ {2}(?P<value>[^\s*]+)\*?\s+(?P<description>.+)$' + } catch { + [] + } } -def "nu-complete podman subcommands" [] { - ^podman --help | lines | where $it =~ '^ {2}[A-Za-z]' | parse --regex '^ {2}(?P<value>[^\s*]+)\*?\s+(?P<description>.+)$' +# Transport protocols a published port may name. +@non-destructive +export def "nu-complete podman protocols" [] { + try { + [[value description]; [tcp "TCP (default)"] [udp UDP] [sctp SCTP]] + } catch { + [] + } } - -def "nu-complete podman compose subcommands" [] { - ^podman compose --help | lines | where $it =~ '^ {4}[A-Za-z]' | parse --regex '^ {4}(?P<value>[^\s*]+)\*?\s+(?P<description>.+)$' -} - -# Log in to a container registry -export extern "podman login" [ - registry?: string #Container registry URL - --authfile: string #Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override - --cert-dir: string #Use certificates at the specified path to access the registry - --compat-auth-file: string #Path of a Docker-compatible config file to update instead - --password(-p): string #Password - --password-stdin #Take the password from stdin - --username(-u): string #Username - --get-login #Return the current login user for the registry - --secret: string #Retrieve password from a podman secret - --tls-verify #Require HTTPS and verify certificates when contacting registries - --verbose(-v) #Write more detailed information to stdout -] - -# Log out from a Podman registry -export extern "podman logout" [ - registry?: string #Container registry URL - --all(-a) #Remove the cached credentials for all registries in the auth file - --authfile: string #Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override - --compat-auth-file: path #Path of a Docker-compatible config file to update instead -] - -# Search registry for image -export extern "podman search" [ - --authfile: string #Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override - --cert-dir: path #Pathname of a directory containing TLS certificates and keys - --compatible #List stars, official and automated columns (Docker compatibility) - --creds: string #Credentials (USERNAME:PASSWORD) to use for authenticating to a registry - --filter(-f): string #Filter output based on conditions provided - --format: string #Change the output format to JSON or a Go template - --limit: int #Limit the number of results - --list-tags #List the tags of the input registry - --no-trunc #Do not truncate the output - --tls-verify #Require HTTPS and verify certificates when contacting registries -] - -# Show the podman version information -export extern "podman version" [ - --format(-f): string #Format the output using the given Go template -] - -# Inspect changes to files or directories on a container's filesystem -export extern "podman system events" [ - --filter(-f): string #Filter output based on conditions provided - --format: string #Pretty-print images using a Go template - --no-trunc #Don't truncate output - --since: string #Show all events created since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) - --stream #Stream events and do not exit when returning the last known event (default true) - --until: string #Stream events until this timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) -] - -# Attach local standard input, output, and error streams to a running container -export extern "podman container attach" [ - container?: string@"nu-complete podman containers" - --detach-keys:string #Override the key sequence for detaching a container - --latest(-l) #Act on the latest container podman is aware of - --no-stdin #Do not attach STDIN - --sig-proxy #Proxy all received signals to the process -] - -# Create a new image from a container's changes -export extern "podman container commit" [ - container?: string@"nu-complete podman containers" - --author(-a): string #Author (e.g., "John Hannibal Smith <hannibal@a-team.com>" - --change(-c): string #Apply Podmanfile instruction to the created image - --config: path #File containing a container configuration to merge into the image - --format(-f): string #Format of the image manifest and metadata (default "oci") - --iidfile: string #File to write the image ID to - --include-volumes #Include container volumes as image volumes - --message(-m): string #Commit message - --pause(-p) #Pause container during commit (default true) - --quiet(-q) #Suppress output - --squash(-s) #Squash newly built layers into a single new layer -] - -# Create a new container -export extern "podman container create" [ - image?: string@"nu-complete podman images" #The image to create the container from - command?: string #Command to run inside the container - ...args: string - --add-host: string #Add a custom host-to-IP mapping (host:ip) - --annotation: string #Add an annotation to the container (passed through to the OCI runtime) (default map[]) - --attach: string #Attach to STDIN, STDOUT or STDERR - --arch: string #Use ARCH instead of the architecture of the machine for choosing images - --blkio-weight: int #Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) - --blkio-weight-device: string #Block IO weight (relative device weight) (default []) - --cap-add: string #Add Linux capabilities - --cap-drop: string #Drop Linux capabilities - --cert-dir: string #Pathname of a directory containing TLS certificates and keys - --cgroup-conf: string #Configure cgroup v2 (key=value) - --cgroup-parent: string #Optional parent cgroup for the container - --cgroupns: string #Cgroup namespace to use (host|private) - --cgroups: string #Control container cgroup configuration ("enabled"|"disabled"|"no-conmon"|"split") (default "enabled") - --chrootdirs: string #Chroot directories inside the container - --cidfile: string #Write the container ID to the file - --conmon-pidfile: string #Path to the file that will receive the PID of conmon - --cpu-period: int #Limit CPU CFS (Completely Fair Scheduler) period - --cpu-quota: int #Limit CPU CFS (Completely Fair Scheduler) quota - --cpu-rt-period: int #Limit CPU real-time period in microseconds - --cpu-rt-runtime: int #Limit CPU real-time runtime in microseconds - --cpu-shares(-c): int #CPU shares (relative weight) - --cpus: int #Number of CPUs - --cpuset-cpus: string #CPUs in which to allow execution (0-3, 0,1) - --cpuset-mems: string #MEMs in which to allow execution (0-3, 0,1) - --creds: string #Credentials (USERNAME:PASSWORD) to use for authenticating to a registry - --decryption-key: string #Key needed to decrypt the image (e.g. /path/to/key.pem) - --device: string #Add a host device to the container - --device-cgroup-rule: string #Add a rule to the cgroup allowed devices list - --device-read-bps: int #Limit read rate (bytes per second) from a device (default []) - --device-read-iops: int #Limit read rate (IO per second) from a device (default []) - --device-write-bps: int #Limit write rate (bytes per second) to a device (default []) - --device-write-iops: int #Limit write rate (IO per second) to a device (default []) - --disable-content-trust #Skip image verification (default true) - --dns: int #Set custom DNS servers - --dns-option: string #Set DNS options - --dns-search: string #Set custom DNS search domains - --entrypoint: string #Overwrite the default ENTRYPOINT of the image - --env(-e): string #Set environment variables - --env-file: string #Read in a file of environment variables - --env-host #Use all current host environment variables in container - --env-merge: string #Preprocess environment variables from image before injecting them into the container - --expose: string #Expose a port or a range of ports - --gidmap: string #GID map to use for the user namespace - --gpus: string #GPU devices to add to the container ('all' to pass all GPUs) - --group-add: string #Add additional groups to join - --group-entry: string #Entry to write to /etc/group - --health-cmd: string #Command to run to check health - --health-interval: duration #Time between running the check (ms|s|m|h) (default 0s) - --health-log-destination: string #Set the destination of the HealthCheck log. Directory path, local or events_logger (local use container state file) (default "local") - --health-max-log-count: int #Set maximum number of attempts in the HealthCheck log file. ('0' value means an infinite number of attempts in the log file) (default 5) - --health-max-log-size: int #Set maximum length in characters of stored HealthCheck log. ('0' value means an infinite log length) (default 500) - --health-on-failure: string #Action to take once the container turns unhealthy (default "none") - --health-retries: int #Consecutive failures needed to report unhealthy - --health-startup-cmd: string #Set a startup healthcheck command for the container - --health-start-interval: duration #Time between running the check during the start period (ms|s|m|h) (default 0s) - --health-start-period: duration #Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s) - --health-startup-retries: int #Set the maximum number of retries before the startup healthcheck will restart the container - --health-startup-success: int #Set the number of consecutive successes before the startup healthcheck is marked as successful and the normal healthcheck begins (0 indicates any success will start the regular healthcheck) - --health-startup-timeout: string #Set the maximum amount of time that the startup healthcheck may take before it is considered failed (default "30s") - --health-timeout: duration #Maximum time to allow one check to run (ms|s|m|h) (default 0s) - --hostname(-h): string #Container host name - --hosts-file: string #Base file to create the /etc/hosts file inside the container, or one of the special values. ("image"|"none") - --hostuser: string #Host user account to add to /etc/passwd within container - --http-proxy #Set proxy environment variables in the container based on the host proxy vars (default true) - --image-volume: string #Tells podman how to handle the builtin image volumes ("bind"|"tmpfs"|"ignore") (default "anonymous") - --init #Run an init inside the container that forwards signals and reaps processes - --init-ctr: string #Make this a pod init container. - --init-path: string #Path to the container-init binary - --interactive(-i) #Keep STDIN open even if not attached - --ip: string #IPv4 address (e.g., 172.30.100.104) - --ip6: string #IPv6 address (e.g., 2001:db8::33) - --ipc: string #IPC mode to use - --label(-l): string #Set meta data on a container - --label-file: string #Read in a line delimited file of labels - --log-driver: string #Logging driver for the container - --log-opt: string #Log driver options - --mac-address: string #Container MAC address (e.g., 92:d0:c6:0a:29:33) - --memory(-m): int #Memory limit - --memory-reservation: int #Memory soft limit - --memory-swap: int #Swap limit equal to memory plus swap: '-1' to enable unlimited swap - --memory-swappiness: int #Tune container memory swappiness (0 to 100) (default -1) - --mount: string #Attach a filesystem mount to the container - --name: string #Assign a name to the container - --network: string #Connect a container to a network - --network-alias: string #Add network-scoped alias for the container - --no-healthcheck #Disable any container-specified HEALTHCHECK - --no-hostname #Do not create /etc/hostname within the container, instead use the version from the image - --no-hosts #Do not create /etc/hosts within the container, instead use the version from the image - --oom-kill-disable #Disable OOM Killer - --oom-score-adj: int #Tune host's OOM preferences (-1000 to 1000) - --os: string #Use OS instead of the running OS for choosing images - --passwd-entry: string #Entry to write to /etc/passwd - --personality: string #Configure execution domain using personality (e.g., LINUX/LINUX32) - --pid: string #PID namespace to use - --pidfile: string #Write the container process ID to the file - --pids-limit: int #Tune container pids limit (set -1 for unlimited) - --platform: string #Set platform if server is multi-platform capable - --pod: string #Run container in an existing pod - --pod-id-file: string #Read the pod ID from the file - --privileged #Give extended privileges to this container - --publish(-p): string #Publish a container's port(s) to the host - --publish-all(-P) #Publish all exposed ports to random ports - --pull: string@"nu-complete podman pull" #Pull image before running ("always", "missing", "never") (default "missing") - --quiet(-q) #Suppress the pull output - --rdt-class: string #Class of Service (COS) that the container should be assigned to - --read-only #Mount the container's root filesystem as read only - --read-only-tmpfs #When running --read-only containers mount read-write tmpfs on /dev, /dev/shm, /run, /tmp and /var/tmp (default true) - --replace #If a container with the same name exists, replace it - --requires: string #Add one or more requirement containers that must be started before this container will start - --restart: string #Restart policy to apply when a container #exits (default "no") - --retry: int #number of times to retry in case of failure when performing pull (default 3) - --retry-delay: string #Delay between retries in case of pull failures - --rm #Automatically remove the container when it exits - --rootfs #The first argument is not an image but the rootfs to the exploded container - --sdnotify: string #Control sd-notify behavior ("container"|"conmon"|"healthy"|"ignore") (default "container") - --seccomp-policy: string #Policy for selecting a seccomp profile (experimental) (default "default") - --secret: string #Add secret to container - --security-opt: string #Security Options - --shm-size: int #Size of /dev/shm - --shm-size-systemd: int #Size of systemd specific tmpfs mounts (/run, /run/lock) (format: <number>[<unit>], where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes)) - --stop-signal: string #Signal to stop the container - --stop-timeout: int #Timeout (in seconds) to stop a container - --subgidname: string #Name of range listed in /etc/subgid for use in user namespace - --subuidname: string #Name of range listed in /etc/subuid for use in user namespace - --storage-opt: string #Storage driver options for the container - --sysctl: string #Sysctl options (default map[]) - --systemd: string #Run container in systemd mode ("true"|"false"|"always") (default "true") - --timeout: int #Maximum length of time a container is allowed to run. The container will be killed automatically after the time expires. - --tls-verify #Require HTTPS and verify certificates when contacting registries for pulling images - --tmpfs: string #Mount a tmpfs directory - --tty(-t) #Allocate a pseudo-TTY - --tz: string #Set timezone in container - --uidmap: string #UID map to use for the user namespace - --ulimit: string #Ulimit options - --umask: string #Set umask in container (default "0022") - --unsetenv: string #Unset environment default variables in container - --unsetenv-all #Unset all default environment variables in container - --ulimit: int #Ulimit options (default []) - --user(-u): string #Username or UID (format: <name|uid>[:<group|gid>]) - --userns: string #User namespace to use - --uts: string #UTS namespace to use - --variant: string #Use VARIANT instead of the running architecture variant for choosing images - --volume(-v): string #Bind mount a volume - --volumes-from: string #Mount volumes from the specified container(s) - --workdir(-w): string #Working directory inside the container -] - -# Inspect changes to files or directories on a container's filesystem -export extern "podman container diff" [ - container?: string@"nu-complete podman containers" - --format: string #Change the output format (json) - --latest(-l) #Act on the latest container podman is aware of Not supported with the "--remote" flag -] - -# Run a command in a running container -export extern "podman container exec" [ - container?: string@"nu-complete podman containers" - --cidfile: string #File to read the container ID from - --detach(-d) #Detached mode: run command in the background - --detach-keys: string #Select the key sequence for detaching a container. Format is a single character [a-Z] or ctrl-<value> where <value> is one of: a-z, @, ^, [, , or _ (default "ctrl-p,ctrl-q") - --env(-e): string #Set environment variables - --env-file: string #Read in a file of environment variables - --interactive(-i) #Keep STDIN open even if not attached - --latest(-l) #Act on the latest container podman is aware of Not supported with the "--remote" flag - --preserve-fd: int #Pass a list of additional file descriptors to the container (default []) - --preserve-fds: int #Pass N additional file descriptors to the container - --privileged #Give the process extended Linux capabilities inside the container. The default is false - --tty(-t) #Allocate a pseudo-TTY - --user(-u): string #Username or UID (format: <name|uid>[:<group|gid>]) - --workdir(-w): string #Working directory inside the container -] - -# Export a container's filesystem as a tar archive -export extern "podman container export" [ - container?: string@"nu-complete podman containers" - --output(-o): string #Write to a file, instead of STDOUT -] - -# Display detailed information on one or more containers -export extern "podman container inspect" [ - container?: string@"nu-complete podman containers" - --format(-f):string #Format the output using the given Go template - --latest(-l) #Act on the latest container podman is aware of. Not supported with the "--remote" flag - --size(-s) #Display total file sizes -] - -# Kill one or more running containers -export extern "podman container kill" [ - container?: string@"nu-complete podman containers" - --all(-a) #Signal all running containers - --cidfile: string #Read the container ID from the file - --latest(-l) #Act on the latest container podman is aware of. Not supported with the "--remote" flag - --signal(-s):string #Signal to send to the container -] - -# Fetch the logs of a container -export extern "podman container logs" [ - container?: string@"nu-complete podman containers" - --color #Output the containers with different colors in the log. - --follow(-f) #Follow log output - --latest(-l) #Act on the latest container podman is aware of. Not supported with the "--remote" flag - --names(-n) #Output the container name in the log - --since: string #Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) - --tail(-n): int #Number of lines to show from the end of the logs - --timestamps(-t) #Show timestamps - --until: string #Show logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) -] - -# List containers -export extern "podman container ls" [ - --all(-a) #Show all containers (default shows just running) - --external #Show containers in storage not controlled by Podman - --filter: string #Filter output based on conditions provided - --format: string #Pretty-print containers using a Go template - --last(-n): int #Show n last created containers (includes all states) (default -1) - --latest(-l) #Show the latest created container (includes all states) - --no-trunc #Don't truncate output - --noheading #Do not print headers - --ns #Display namespace information - --quiet(-q) #Only display numeric IDs - --size(-s) #Display total file sizes - --sort: string #Sort output by: command, created, id, image, names, runningfor, size, status - --sync #Sync container state with OCI runtime - --watch(-w): int #Watch the ps output on an interval in seconds -] - -# Pause all processes within one or more containers -export extern "podman container pause" [ - container?: string@"nu-complete podman containers" - --all(-a) #Pause all running containers - --cidfile: string #Read the container ID from the file - --filter(-f): string #Filter output based on conditions given - --latest(-l) #Act on the latest container podman is aware of. Not supported with the "--remote" flag -] - -# Remove all stopped containers -export extern "podman container prune" [ - --filter: string #Provide filter values (e.g. 'until=24h') - --force(-f) #Do not prompt for confirmation -] - -# List port mappings or a specific mapping for the container -export extern "podman container port" [ - container?: string@"nu-complete podman containers" - --all(-a) #Display port information for all containers - --latest(-l) #Act on the latest container podman is aware of. Not supported with the "--remote" flag -] - -# Rename a container -export extern "podman container rename" [ - container?: string@"nu-complete podman containers" - name?: string -] - -# Restart one or more containers -export extern "podman container restart" [ - container?: string@"nu-complete podman containers" - --all(-a) #Restart all running containers - --cidfile: string #Read the container ID from the file - --filter(-f): string #Filter output based on conditions given - --latest(-l) #Act on the latest container podman is aware of. Not supported with the "--remote" flag - --running #Restart only running containers - --time(-t): int #Seconds to wait for stop before killing the container -] - -# Remove one or more containers -export extern "podman container rm" [ - container?: string@"nu-complete podman containers" - --all(-a) #Remove all running containers - --cidfile: string #Read the container ID from the file - --depend #Remove container and all containers that depend on the selected container - --filter: string #Filter output based on conditions given - --force(-f) #Force removal of a running or unusable container - --ignore(-i) #Ignore errors when a specified container is missing - --latest(-l) #Act on the latest container podman is aware of. Not supported with the "--remote" flag - --time(-t): int #Seconds to wait for stop before killing the container -] - -# Run a command in a new container -export extern "podman container run" [ - image?: string@"nu-complete podman run" #The image to create the container from - command?: string #Command to run inside the container - ...args: string - --add-host: string #Add a custom host-to-IP mapping (host:ip) - --annotation: string #Add an annotation to the container (passed through to the OCI runtime) (default map[]) - --attach: string #Attach to STDIN, STDOUT or STDERR - --authfile: path #Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override - --blkio-weight: int #Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) - --blkio-weight-device: string #Block IO weight (relative device weight) (default []) - --cap-add: string #Add Linux capabilities - --cap-drop: string #Drop Linux capabilities - --cert-dir: string #Pathname of a directory containing TLS certificates and keys - --cgroup-conf: string #Configure cgroup v2 (key=value) - --cgroup-parent: string #Optional parent cgroup for the container - --cgroupns: string #Cgroup namespace to use (host|private) - --cgroups: string #Control container cgroup configuration ("enabled"|"disabled"|"no-conmon"|"split") (default "enabled") - --chrootdirs: string #Chroot directories inside the container - --cidfile: string #Write the container ID to the file - --conmon-pidfile: path #Path to the file that will receive the PID of conmon - --cpu-period: int #Limit CPU CFS (Completely Fair Scheduler) period - --cpu-quota: int #Limit CPU CFS (Completely Fair Scheduler) quota - --cpu-rt-period: int #Limit CPU real-time period in microseconds - --cpu-rt-runtime: int #Limit CPU real-time runtime in microseconds - --cpu-shares(-c): int #CPU shares (relative weight) - --cpus: int #Number of CPUs - --cpuset-cpus: string #CPUs in which to allow execution (0-3, 0,1) - --cpuset-mems: string #MEMs in which to allow execution (0-3, 0,1) - --creds: string #Credentials (USERNAME:PASSWORD) to use for authenticating to a registry - --decryption-key: string #Key needed to decrypt the image (e.g. /path/to/key.pem) - --detach(-d) #Run container in background and print container ID - --detach-keys: string #Override the key sequence for detaching a container - --device: string #Add a host device to the container - --device-cgroup-rule: string #Add a rule to the cgroup allowed devices int - --device-read-bps: int #Limit read rate (bytes per second) from a device (default []) - --device-read-iops: int #Limit read rate (IO per second) from a device (default []) - --device-write-bps: int #Limit write rate (bytes per second) to a device (default []) - --device-write-iops: int #Limit write rate (IO per second) to a device (default []) - --disable-content-trust #Skip image verification (default true) - --dns: int #Set custom DNS servers - --dns-option: string #Set DNS options - --dns-search: string #Set custom DNS search domains - --domainname: string #Container NIS domain name - --entrypoint: string #Overwrite the default ENTRYPOINT of the image - --env(-e): string #Set environment variables - --env-file: string #Read in a file of environment variables - --env-host #Use all current host environment variables in container - --expose: string #Expose a port or a range of ports - --gidmap: string #GID map to use for the user namespace - --gpus: string #GPU devices to add to the container ('all' to pass all GPUs) - --group-add: string #Add additional groups to join - --health-cmd: string #Command to run to check health - --health-interval: duration #Time between running the check (ms|s|m|h) (default 0s) - --health-log-destination: string #Set the destination of the HealthCheck log. Directory path, local or events_logger (local use container state file) (default "local") - --health-max-log-count: int #Set maximum number of attempts in the HealthCheck log file. ('0' value means an infinite number of attempts in the log file) (default 5) - --health-max-log-size: int #Set maximum length in characters of stored HealthCheck log. ('0' value means an infinite log length) (default 500) - --health-on-failure: string #Action to take once the container turns unhealthy (default "none") - --health-retries: int #Consecutive failures needed to report unhealthy - --health-start-period: duration #Time between running the check during the start period (ms|s|m|h) (default 0s) - --health-startup-cmd: string #Set a startup healthcheck command for the container - --health-startup-interval: string #Set an interval for the startup healthcheck. (default "30s") - --health-startup-retries: int #Set the maximum number of retries before the startup healthcheck will restart the container - --health-startup-success: int #Set the number of consecutive successes before the startup healthcheck is marked as successful and the normal healthcheck begins (0 indicates any success will start the regular healthcheck) - --health-startup-timeout: string #Set the maximum amount of time that the startup healthcheck may take before it is considered failed (default "30s") - --health-timeout: duration #Maximum time to allow one check to run (ms|s|m|h) (default 0s) - --hostname(-h): string #Container host name - --hosts-file: string #Base file to create the /etc/hosts file inside the container, or one of the special values. ("image"|"none") - --hostuser: string #Host user account to add to /etc/passwd within container - --http-proxy #Set proxy environment variables in the container based on the host proxy vars (default true) - --image-volume: string #Tells podman how to handle the builtin image volumes ("bind"|"tmpfs"|"ignore") (default "anonymous") - --init #Run an init inside the container that forwards signals and reaps processes - --init-path: path #Path to the container-init binary - --interactive(-i) #Keep STDIN open even if not attached - --ip: string #IPv4 address (e.g., 172.30.100.104) - --ip6: string #IPv6 address (e.g., 2001:db8::33) - --ipc: string #IPC mode to use - --label(-l): string #Set meta data on a container - --label-file: string #Read in a line delimited file of labels - --log-driver: string #Logging driver for the container - --log-opt: string #Log driver options - --mac-address: string #Container MAC address (e.g., 92:d0:c6:0a:29:33) - --memory(-m): int #Memory limit - --memory-reservation: int #Memory soft limit - --memory-swap: int #Swap limit equal to memory plus swap: '-1' to enable unlimited swap - --memory-swappiness: int #Tune container memory swappiness (0 to 100) (default -1) - --mount: string #Attach a filesystem mount to the container - --name: string #Assign a name to the container - --network: string #Connect a container to a network - --network-alias: string #Add network-scoped alias for the container - --no-healthcheck #Disable any container-specified HEALTHCHECK - --oom-kill-disable #Disable OOM Killer - --oom-score-adj: int #Tune host's OOM preferences (-1000 to 1000) - --os: string #Use OS instead of the running OS for choosing images - --passwd #Add entries to /etc/passwd and /etc/group (default true) - --passwd-entry: string #Entry to write to /etc/passwd - --personality: string #Configure execution domain using personality (e.g., LINUX/LINUX32) - --pid: string #PID namespace to use - --pidfile: string #Write the container process ID to the file - --pids-limit: int #Tune container pids limit (set -1 for unlimited) - --platform: string #Set platform if server is multi-platform capable - --pod: string #Run container in an existing pod - --pod-id-file: string #Read the pod ID from the file - --preserve-fd: int #Pass a file descriptor into the container (default []) - --preserve-fds: int #Pass a number of additional file descriptors into the container - --privileged #Give extended privileges to this container - --publish(-p): string #Publish a container's port(s) to the host - --publish-all(-P) #Publish all exposed ports to random ports - --pull: string@"nu-complete podman pull" #Pull image before running ("always", "missing", "never") (default "missing") - --quiet(-q) #Suppress the pull output - --rdt-class: string #Class of Service (COS) that the container should be assigned to - --read-only #Mount the container's root filesystem as read only - --read-only-tmpfs #When running --read-only containers mount read-write tmpfs on /dev, /dev/shm, /run, /tmp and /var/tmp (default true) - --replace #If a container with the same name exists, replace it - --requires: string #Add one or more requirement containers that must be started before this container will start - --restart: string #Restart policy to apply when a container #exits (default "no") - --retry: int #Number of times to retry in case of failure when performing pull (default 3) - --retry-delay: string #Delay between retries in case of pull failures - --rm #Automatically remove the container when it exits - --rmi #Remove image unless used by other containers, implies --rm - --rootfs #The first argument is not an image but the rootfs to the exploded container - --sdnotify: string #control sd-notify behavior ("container"|"conmon"|"healthy"|"ignore") (default "container") - --seccomp-policy: string #Policy for selecting a seccomp profile (experimental) (default "default") - --secret: string #Add secret to container - --security-opt: string #Security Options - --shm-size: int #Size of /dev/shm - --shm-size-systemd: int #Size of systemd specific tmpfs mounts (/run, /run/lock) (format: <number>[<unit>], where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes)) - --sig-proxy #Proxy received signals to the process (default true) - --stop-signal: string #Signal to stop the container - --stop-timeout: int #Timeout (in seconds) to stop a container - --subgidname: string #Name of range listed in /etc/subgid for use in user namespace - --subuidname: string #Name of range listed in /etc/subuid for use in user namespace - --sysctl: string #Sysctl options (default map[]) - --systemd: string #Run container in systemd mode ("true"|"false"|"always") (default "true") - --timeout: int #Maximum length of time a container is allowed to run. The container will be killed automatically after the time expires. - --tls-verify #Require HTTPS and verify certificates when contacting registries for pulling images - --tmpfs: string #Mount a tmpfs directory - --tty(-t) #Allocate a pseudo-TTY - --tz: string #Set timezone in container - --uidmap: string #UID map to use for the user namespace - --ulimit: int #Ulimit options (default []) - --umask: string #Set umask in container (default "0022") - --unsetenv: string #Unset environment default variables in container - --unsetenv-all #Unset all default environment variables in container - --user(-u): string #Username or UID (format: <name|uid>[:<group|gid>]) - --userns: string #User namespace to use - --uts: string #UTS namespace to use - --variant: string #Use VARIANT instead of the running architecture variant for choosing images - --volume(-v): string #Bind mount a volume - --volume-driver: string #Optional volume driver for the container - --volumes-from: string #Mount volumes from the specified container(s) - --workdir(-w): string #Working directory inside the container -] - -# Start one or more stopped containers -export extern "podman container start" [ - container?: string@"nu-complete podman containers" - --all #Start all containers regardless of their state or configuration - --attach(-a) #Attach STDOUT/STDERR and forward signals - --detach-keys: string #Override the key sequence for detaching a container - - --filter(-f): string #Filter output based on conditions provided - --interactive(-i) #Attach container's STDIN - --latest(-l) #Act on the latest container podman is aware of - --sig-proxy #Proxy received signals to the process (default true if attaching, false otherwise) -] - -# Display a live stream of container(s) resource usage statistics -export extern "podman container stats" [ - container?: string@"nu-complete podman containers" - --all(-a) #Show all containers (default shows just running) - --format: string #Pretty-print images using a Go template - --interval(-i): int #Time in seconds between stats reports (default 5) - --latest(-l) #Act on the latest container podman is aware of - --no-reset #Disable resetting the screen between intervals - --no-stream #Disable streaming stats and only pull the first result - --no-trunc #Do not truncate output -] - -# Stop one or more running containers -export extern "podman container stop" [ - container?: string@"nu-complete podman containers" - --all(-a) #Stop all containers (default shows just running) - --cidfile: string #Read the container ID from the file - --filter(-f): string #Filter output based on conditions provided - --ignore(-i) #Ignore errors when a specified container is missing - --latest(-l) #Act on the latest container podman is aware of - --time(-t): int #Seconds to wait for stop before killing the container - --signal(-s): int #Signal to stop the container -] - -# Display the running processes of a container -export extern "podman container top" [ - container?: string@"nu-complete podman containers" - --latest(-l) #Act on the latest container podman is aware of -] - -# Unpause all processes within one or more containers -export extern "podman container unpause" [ - container?: string@"nu-complete podman containers" - --all(-a) #Unpause all containers (default shows just running) - --cidfile: string #Read the container ID from the file - --filter(-f): string #Filter output based on conditions provided - --latest(-l) #Act on the latest container podman is aware of -] - -# Update configuration of one or more containers -export extern "podman container update" [ - container?: string@"nu-complete podman containers" - --blkio-weight: string #Block IO weight (10–1000) - --blkio-weight-device: string #DEVICE_NAME:WEIGHT - --cpu-period: int #Limit the CPU CFS period - --cpu-quota: int #Limit the CPU CFS quota - --cpu-rt-period: int #CPU real-time period (microseconds) - --cpu-rt-runtime: int #CPU real-time runtime (microseconds) - --cpu-shares(-c): int #CPU shares (relative weight) - --cpus: float #Number of CPUs - --cpuset-cpus: string #CPUs to allow execution (0-3, 0,1) - --cpuset-mems: string #Memory nodes (NUMA only) - --device-read-bps: string #Limit read rate (bytes/sec) - --device-read-iops: string #Limit read rate (IOPS) - --device-write-bps: string #Limit write rate (bytes/sec) - --device-write-iops: string #Limit write rate (IOPS) - --env(-e): string #Set environment variables - --health-cmd: string #Set healthcheck command - --health-interval: string #Healthcheck interval - --health-log-destination: string #Healthcheck log destination - --health-max-log-count: int #Max healthcheck log entries - --health-max-log-size: int #Max healthcheck log size - --health-on-failure: string #Action on unhealthy - --health-retries: int #Healthcheck retries - --health-start-period: string #Container bootstrap time - --health-startup-cmd: string #Startup healthcheck command - --health-startup-interval: string #Startup healthcheck interval - --health-startup-retries: int #Startup healthcheck retries - --health-startup-success: int #Startup success threshold - --health-startup-timeout: string #Startup healthcheck timeout - --health-timeout: string #Healthcheck timeout - --latest(-l) #Act on the latest container - --memory(-m): string #Memory limit <number>[unit] - --memory-reservation: string #Memory soft limit - --memory-swap: string #Swap limit - --memory-swappiness: int #Memory swappiness - --no-healthcheck #Disable healthchecks - --pids-limit: int #PIDs limit - --restart: string #Restart policy - --unsetenv: string #Unset environment variables -] - -# Block until one or more containers stop, then print their exit codes -export extern "podman container wait" [ - container?: string@"nu-complete podman containers" - --condition: string #Condition to wait on - --exit-first-match #Wait for exit of first container which matches conditions - --ignore #Ignore if a container does not exist - --interval(-i): string #Time interval before polling (default 250ms) - --latest(-l) #Act on the latest container (not supported with --remote) -] - -# Build an image from a Podmanfile -export extern "podman image build" [ - --add-host: string #Add a custom host-to-IP mapping (host:ip) - --all-platforms #Attempt to build for all base image platforms - --annotation: string #Set metadata for an image - --arch: string #Set the ARCH of the image (default: amd64) - --authfile: string #Path of the authentication file - --build-arg: string #Argument=value to supply to the builder - --build-arg-file: string #Argfile.conf containing argument=value lines - --build-context: string #Additional build context (argument=value) - --cache-from: string #Remote repositories used as cache sources - --cache-to: string #Remote repositories used as cache destinations - --cache-ttl: string #Only consider cache images under this duration - --cap-add: string #Add the specified Linux capability - --cap-drop: string #Drop the specified Linux capability - --cert-dir: string #Certificates directory for registry access - --cgroup-parent: string #Optional parent cgroup for the container - --cgroupns: string #Cgroup namespace ('private' or 'host') - --compat-volumes #Preserve VOLUME contents during RUN - --compress #Legacy option, no effect - --cpp-flag: string #Additional flags for the C preprocessor - --cpu-period: int #Limit the CPU CFS period - --cpu-quota: int #Limit the CPU CFS quota - --cpu-shares(-c): int #CPU shares (relative weight) - --cpuset-cpus: string #CPUs allowed to execute (e.g. 0-3, 0,1) - --cpuset-mems: string #NUMA memory nodes to use - --created-annotation #Set image created annotation - --creds: string #Registry credentials [username[:password]] - --cw: string #Confidential workload options - --decryption-key: string #Key needed to decrypt the image - --device: string #Additional devices to provide - --disable-compression(-D) #Do not compress layers by default - --disable-content-trust #Docker-specific NOOP option - --dns: string #Custom DNS servers or 'none' - --dns-option: string #Custom DNS options - --dns-search: string #Custom DNS search domains - --env: string #Set environment variables for the image - --file(-f): string #Pathname or URL of a Dockerfile - --force-rm #Always remove intermediate containers - --format: string #Image manifest format (default: oci) - --from: string #Override first FROM image - --group-add: string #Add additional groups to container process - --hooks-dir: string #OCI hooks directory (repeatable) - --http-proxy #Pass through HTTP proxy env vars - --identity-label #Add default identity label - --ignorefile: string #Alternate .dockerignore file path - --iidfile: string #File to write image ID to - --inherit-annotations #Inherit annotations from base image - --inherit-labels #Inherit labels from base image - --ipc: string #IPC namespace ('private', 'host', or path) - --isolation: string #Process isolation type - --jobs: int #Number of parallel build stages - --label: string #Set metadata labels for the image - --layer-label: string #Metadata labels for intermediate images - --layers #Use intermediate layers during build - --logfile: string #Log output to file - --logsplit #Split logfile per platform - --manifest: string #Add image to manifest list - --memory(-m): string #Memory limit (<number>[<unit>]) - --memory-swap: string #Memory + swap limit - --network: string #Network mode or namespace - --no-cache #Do not use cached images - --no-hostname #Do not create /etc/hostname - --no-hosts #Do not create /etc/hosts - --omit-history #Omit build history from image - --os: string #Override target OS (default: linux) - --os-feature: string #Required OS feature - --os-version: string #Required OS version - --output(-o): string #Output destination (type=local,dest=path) - --pid: string #PID namespace ('private', 'host', or path) - --platform: string #Target platform OS/ARCH[/VARIANT] - --pull: string #Image pull policy - --quiet(-q) #Suppress build output - --retry: int #Number of push/pull retries - --retry-delay: string #Delay between retries - --rewrite-timestamp #Rewrite layer timestamps - --rm #Remove intermediate containers on success - --runtime-flag: string #Global flags for container runtime - --sbom: string #SBOM preset configuration - --sbom-image-output: string #Add SBOM results to image path - --sbom-image-purl-output: string #Add SBOM purl results to image path - --sbom-merge-strategy: string #Merge SBOM results strategy - --sbom-output: string #Write SBOM results to file - --sbom-purl-output: string #Write SBOM purl results to file - --sbom-scanner-command: string #Scanner command inside scanner image - --sbom-scanner-image: string #Scanner image to use - --secret: string #Secret file exposed to the build - --security-opt: string #Security options - --shm-size: string #Size of /dev/shm - --sign-by: string #Sign image with GPG fingerprint - --skip-unused-stages #Skip unused build stages - --source-date-epoch: int #Set timestamps relative to epoch - --squash #Squash image layers into one - --squash-all #Squash all layers into one - --ssh: string #SSH agent socket or keys - --stdin #Pass stdin into containers - --tag(-t): string #Tag name for the built image - --target: string #Target build stage - --timestamp: int #Set timestamps in image and layers - --tls-verify #Require HTTPS and verify certificates - --ulimit: string #Ulimit options - --unsetannotation: string #Unset inherited annotations - --unsetenv: string #Unset environment variables - --unsetlabel: string #Unset inherited labels - --userns: string #User namespace mode or path - --userns-gid-map: string #GID mapping for user namespace - --userns-gid-map-group: string #Subgid group name - --userns-uid-map: string #UID mapping for user namespace - --userns-uid-map-user: string #Subuid user name - --uts: string #UTS namespace mode or path - --variant: string #Override image variant - --volume(-v): string #Bind mount a volume into container -] - -# Inspect changes to the image's file systems -export extern "podman image diff" [ - image: string@"nu-complete podman images" - image2?: string@"nu-complete podman images" - --format: string #Change the output format (json) -] - -# Check if an image exists in local storage -export extern "podman image exists" [ - image: string@"nu-complete podman images" -] - -# Show the history of an images -export extern "podman image history" [ - image?: string@"nu-complete podman images" - --format: string #Pretty-print images using a Go template - --human(-H) #Display sizes and dates in human readable format (default true) - --no-trunc #Don't truncate output - --quiet(-q) #Only show numeric IDs + +# --- Syntax ----------------------------------------------------------------------- + +# A published port: `[ip:][host[-end]]:container[-end][/proto]`, such as `8080:80` or +# `127.0.0.1:5432:5432/tcp`. +export syntax podman.port over chars { + root = (ip: addr ":")? host: range ":" container: range ("/" proto: words ["tcp" "udp" "sctp"])? + addr = digit+ "." digit+ "." digit+ "." digit+ + range = digit+ ("-" digit+)? +} + +# --- Root ------------------------------------------------------------------------- + +export complete [podman] [ + command?: by "nu-complete podman subcommands" # Subcommand + --cdi-spec-dir: dir # Set the CDI spec directory path (may be set multiple times) + --cgroup-manager: words [cgroupfs systemd] # Cgroup manager to use + --config: dir # Location of authentication config file + --conmon: path # Path of the conmon binary + --connection(-c): by "nu-complete podman contexts" # Connection to use for remote Podman service + --events-backend: words [file journald none] # Events backend to use + --hooks-dir: dir # Set the OCI hooks directory path (may be set multiple times) + --identity: path # Path to SSH identity file + --imagestore: dir # Path to the 'image store', different from 'graph root' + --log-level: words [trace debug info warn warning error fatal panic] # Log messages above specified level + --module: text # Load the containers.conf(5) module + --network-cmd-path: path # Path to the command for configuring the network + --network-config-dir: dir # Path of the configuration directory for networks + --out: path # Send output (stdout) from podman to a file + --remote(-r) # Access remote Podman service + --root: dir # Path to the graph root directory where images, containers, etc. are stored + --runroot: dir # Path to the 'run directory' where all state information is stored + --runtime: text # Path to the OCI-compatible binary used to run containers + --runtime-flag: text # Add global flags for the container runtime + --ssh: words [golang native] # Define the ssh mode + --storage-driver: text # Select which storage driver is used to manage storage of images and containers + --storage-opt: text # Used to pass an option to the storage driver + --syslog # Output podman-internal logs to syslog as well as the console + --tls-ca: path # Trust certs signed only by this CA + --tls-cert: path # Path to TLS certificate file + --tls-key: path # Path to TLS key file + --tmpdir: dir # Path to the tmp directory for libpod state content + --transient-store # Enable transient container storage + --url: text # URL to access Podman service (CONTAINER_HOST) + --version(-v) # Print version information and quit + --volumepath: dir # Path to the volume directory in which volume data is stored + --help(-h) # Print usage +] where { + terminal [--version --help] +} + +# --- Containers ------------------------------------------------------------------- + +export complete [podman run] [ + image: by "nu-complete podman images" # The image to create the container from + ...command: command # The command to run inside the container, and its arguments + --detach(-d) # Run container in background and print container ID + --detach-keys: text # Override the key sequence for detaching a container + --rmi # Remove image unless used by other containers, implies --rm + --sig-proxy # Proxy received signals to the process + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --annotation: text # Add an annotation to the container (passed through to the OCI runtime) (default map[]) + --arch: text # Use ARCH instead of the architecture of the machine for choosing images + --attach(-a): words [stdin stdout stderr] # Attach to STDIN, STDOUT or STDERR + --authfile: path # Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override + --blkio-weight: text # Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) + --blkio-weight-device: text # Block IO weight (relative device weight) (default []) + --cap-add: text # Add Linux capabilities + --cap-drop: text # Drop Linux capabilities + --cert-dir: text # Pathname of a directory containing TLS certificates and keys + --cgroup-conf: text # Configure cgroup v2 (key=value) + --cgroup-parent: text # Optional parent cgroup for the container + --cgroupns: words [host private] # Cgroup namespace to use (host|private) + --cgroups: words [enabled disabled no-conmon split] # Control container cgroup configuration ("enabled"|"disabled"|"no-conmon"|"split") (default "enabled") + --chrootdirs: text # Chroot directories inside the container + --cidfile: path # Write the container ID to the file + --conmon-pidfile: path # Path to the file that will receive the PID of conmon + --cpu-period: text # Limit CPU CFS (Completely Fair Scheduler) period + --cpu-quota: text # Limit CPU CFS (Completely Fair Scheduler) quota + --cpu-rt-period: text # Limit CPU real-time period in microseconds + --cpu-rt-runtime: text # Limit CPU real-time runtime in microseconds + --cpu-shares(-c): text # CPU shares (relative weight) + --cpus: text # Number of CPUs + --cpuset-cpus: text # CPUs in which to allow execution (0-3, 0,1) + --cpuset-mems: text # MEMs in which to allow execution (0-3, 0,1) + --creds: text # Credentials (USERNAME:PASSWORD) to use for authenticating to a registry + --decryption-key: text # Key needed to decrypt the image (e.g. /path/to/key.pem) + --device: path # Add a host device to the container + --device-cgroup-rule: text # Add a rule to the cgroup allowed devices int + --device-read-bps: text # Limit read rate (bytes per second) from a device (default []) + --device-read-iops: text # Limit read rate (IO per second) from a device (default []) + --device-write-bps: text # Limit write rate (bytes per second) to a device (default []) + --device-write-iops: text # Limit write rate (IO per second) to a device (default []) + --disable-content-trust # Skip image verification (default true) + --dns: text # Set custom DNS servers + --dns-option: text # Set DNS options + --dns-search: text # Set custom DNS search domains + --domainname: text # Container NIS domain name + --entrypoint: text # Overwrite the default ENTRYPOINT of the image + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --env-host # Use all current host environment variables in container + --env-merge: text # Preprocess environment variables from image before injecting them into the container + --expose: text # Expose a port or a range of ports + --gidmap: text # GID map to use for the user namespace + --gpus: text # GPU devices to add to the container ('all' to pass all GPUs) + --group-add: groups # Add additional groups to join + --group-entry: text # Entry to write to /etc/group + --health-cmd: text # Command to run to check health + --health-interval: text # Time between running the check (ms|s|m|h) (default 0s) + --health-log-destination: text # Set the destination of the HealthCheck log. Directory path, local or events_logger (local use container state file) (default "local") + --health-max-log-count: text # Set maximum number of attempts in the HealthCheck log file. ('0' value means an infinite number of attempts in the log file) (default 5) + --health-max-log-size: text # Set maximum length in characters of stored HealthCheck log. ('0' value means an infinite log length) (default 500) + --health-on-failure: words [none kill restart stop] # Action to take once the container turns unhealthy (default "none") + --health-retries: text # Consecutive failures needed to report unhealthy + --health-start-period: text # Time between running the check during the start period (ms|s|m|h) (default 0s) + --health-startup-cmd: text # Set a startup healthcheck command for the container + --health-startup-interval: text # Set an interval for the startup healthcheck. (default "30s") + --health-startup-retries: text # Set the maximum number of retries before the startup healthcheck will restart the container + --health-startup-success: text # Set the number of consecutive successes before the startup healthcheck is marked as successful and the normal healthcheck begins (0 indicates any success will start the regular healthcheck) + --health-startup-timeout: text # Set the maximum amount of time that the startup healthcheck may take before it is considered failed (default "30s") + --health-timeout: text # Maximum time to allow one check to run (ms|s|m|h) (default 0s) + --hostname(-h): text # Container host name + --hosts-file: path # Base file to create the /etc/hosts file inside the container, or one of the special values. ("image"|"none") + --hostuser: text # Host user account to add to /etc/passwd within container + --http-proxy # Set proxy environment variables in the container based on the host proxy vars (default true) + --image-volume: words [anonymous bind tmpfs ignore] # Tells podman how to handle the builtin image volumes ("bind"|"tmpfs"|"ignore") (default "anonymous") + --init # Run an init inside the container that forwards signals and reaps processes + --init-path: path # Path to the container-init binary + --interactive(-i) # Keep STDIN open even if not attached + --ip: text # IPv4 address (e.g., 172.30.100.104) + --ip6: text # IPv6 address (e.g., 2001:db8::33) + --ipc: text # IPC mode to use + --label(-l): text # Set meta data on a container + --label-file: path # Read in a line delimited file of labels + --log-driver: words [k8s-file journald none passthrough passthrough-tty] # Logging driver for the container + --log-opt: text # Log driver options + --mac-address: text # Container MAC address (e.g., 92:d0:c6:0a:29:33) + --memory(-m): text # Memory limit + --memory-reservation: text # Memory soft limit + --memory-swap: text # Swap limit equal to memory plus swap: '-1' to enable unlimited swap + --memory-swappiness: text # Tune container memory swappiness (0 to 100) (default -1) + --mount: text # Attach a filesystem mount to the container + --name: text # Assign a name to the container + --network: by "nu-complete podman networks" # Connect a container to a network + --network-alias: text # Add network-scoped alias for the container + --no-healthcheck # Disable any container-specified HEALTHCHECK + --no-hostname # Do not create /etc/hostname within the container, use the image's + --no-hosts # Do not create /etc/hosts within the container, use the image's + --oom-kill-disable # Disable OOM Killer + --oom-score-adj: text # Tune host's OOM preferences (-1000 to 1000) + --os: text # Use OS instead of the running OS for choosing images + --passwd # Add entries to /etc/passwd and /etc/group (default true) + --passwd-entry: text # Entry to write to /etc/passwd + --personality: text # Configure execution domain using personality (e.g., LINUX/LINUX32) + --pid: text # PID namespace to use + --pidfile: path # Write the container process ID to the file + --pids-limit: text # Tune container pids limit (set -1 for unlimited) + --platform: text # Set platform if server is multi-platform capable + --pod: by "nu-complete podman pods" # Run container in an existing pod + --pod-id-file: path # Read the pod ID from the file + --preserve-fd: text # Pass a file descriptor into the container (default []) + --preserve-fds: text # Pass a number of additional file descriptors into the container + --privileged # Give extended privileges to this container + --publish(-p): podman.port with { root.proto: by "nu-complete podman protocols" } # Publish a container's port(s) to the host ([ip:]host:container[/proto]) + --publish-all(-P) # Publish all exposed ports to random ports + --pull: words [always missing never newer] # Pull image before running ("always", "missing", "never") (default "missing") + --quiet(-q) # Suppress the pull output + --rdt-class: text # Class of Service (COS) that the container should be assigned to + --read-only # Mount the container's root filesystem as read only + --read-only-tmpfs # When running --read-only containers mount read-write tmpfs on /dev, /dev/shm, /run, /tmp and /var/tmp (default true) + --replace # If a container with the same name exists, replace it + --requires: by "nu-complete podman all-containers" # Add one or more requirement containers that must be started before this container will start + --restart: words [no always on-failure unless-stopped] # Restart policy to apply when a container exits (default "no") + --retry: text # Number of times to retry in case of failure when performing pull (default 3) + --retry-delay: text # Delay between retries in case of pull failures + --rm # Automatically remove the container when it exits + --rootfs # The first argument is not an image but the rootfs to the exploded container + --sdnotify: words [container conmon healthy ignore] # control sd-notify behavior ("container"|"conmon"|"healthy"|"ignore") (default "container") + --seccomp-policy: text # Policy for selecting a seccomp profile (experimental) (default "default") + --secret: text # Add secret to container + --security-opt: text # Security Options + --shm-size: text # Size of /dev/shm + --shm-size-systemd: text # Size of systemd specific tmpfs mounts (/run, /run/lock) (format: <number>[<unit>], where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes)) + --stop-signal: signals # Signal to stop the container + --stop-timeout: text # Timeout (in seconds) to stop a container + --subgidname: text # Name of range listed in /etc/subgid for use in user namespace + --subuidname: text # Name of range listed in /etc/subuid for use in user namespace + --sysctl: text # Sysctl options (default map[]) + --systemd: words [true false always] # Run container in systemd mode ("true"|"false"|"always") (default "true") + --timeout: text # Maximum length of time a container is allowed to run. The container will be killed automatically after the time expires. + --tls-verify # Require HTTPS and verify certificates when contacting registries for pulling images + --tmpfs: text # Mount a tmpfs directory + --tty(-t) # Allocate a pseudo-TTY + --tz: text # Set timezone in container + --uidmap: text # UID map to use for the user namespace + --ulimit: text # Ulimit options (default []) + --umask: text # Set umask in container (default "0022") + --unsetenv: text # Unset environment default variables in container + --unsetenv-all # Unset all default environment variables in container + --user(-u): users # Username or UID (format: <name|uid>[:<group|gid>]) + --userns: text # User namespace to use + --uts: text # UTS namespace to use + --variant: text # Use VARIANT instead of the running architecture variant for choosing images + --volume(-v): text # Bind mount a volume + --volume-driver: text # Optional volume driver for the container + --volumes-from: by "nu-complete podman all-containers" # Mount volumes from the specified container(s) + --workdir(-w): text # Working directory inside the container + --help # Print usage +] where { + excludes --rm --restart + excludes --rmi --restart +} + +export complete [podman container run] [ + image: by "nu-complete podman images" # The image to create the container from + ...command: command # The command to run inside the container, and its arguments + --detach(-d) # Run container in background and print container ID + --detach-keys: text # Override the key sequence for detaching a container + --rmi # Remove image unless used by other containers, implies --rm + --sig-proxy # Proxy received signals to the process + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --annotation: text # Add an annotation to the container (passed through to the OCI runtime) (default map[]) + --arch: text # Use ARCH instead of the architecture of the machine for choosing images + --attach(-a): words [stdin stdout stderr] # Attach to STDIN, STDOUT or STDERR + --authfile: path # Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override + --blkio-weight: text # Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) + --blkio-weight-device: text # Block IO weight (relative device weight) (default []) + --cap-add: text # Add Linux capabilities + --cap-drop: text # Drop Linux capabilities + --cert-dir: text # Pathname of a directory containing TLS certificates and keys + --cgroup-conf: text # Configure cgroup v2 (key=value) + --cgroup-parent: text # Optional parent cgroup for the container + --cgroupns: words [host private] # Cgroup namespace to use (host|private) + --cgroups: words [enabled disabled no-conmon split] # Control container cgroup configuration ("enabled"|"disabled"|"no-conmon"|"split") (default "enabled") + --chrootdirs: text # Chroot directories inside the container + --cidfile: path # Write the container ID to the file + --conmon-pidfile: path # Path to the file that will receive the PID of conmon + --cpu-period: text # Limit CPU CFS (Completely Fair Scheduler) period + --cpu-quota: text # Limit CPU CFS (Completely Fair Scheduler) quota + --cpu-rt-period: text # Limit CPU real-time period in microseconds + --cpu-rt-runtime: text # Limit CPU real-time runtime in microseconds + --cpu-shares(-c): text # CPU shares (relative weight) + --cpus: text # Number of CPUs + --cpuset-cpus: text # CPUs in which to allow execution (0-3, 0,1) + --cpuset-mems: text # MEMs in which to allow execution (0-3, 0,1) + --creds: text # Credentials (USERNAME:PASSWORD) to use for authenticating to a registry + --decryption-key: text # Key needed to decrypt the image (e.g. /path/to/key.pem) + --device: path # Add a host device to the container + --device-cgroup-rule: text # Add a rule to the cgroup allowed devices int + --device-read-bps: text # Limit read rate (bytes per second) from a device (default []) + --device-read-iops: text # Limit read rate (IO per second) from a device (default []) + --device-write-bps: text # Limit write rate (bytes per second) to a device (default []) + --device-write-iops: text # Limit write rate (IO per second) to a device (default []) + --disable-content-trust # Skip image verification (default true) + --dns: text # Set custom DNS servers + --dns-option: text # Set DNS options + --dns-search: text # Set custom DNS search domains + --domainname: text # Container NIS domain name + --entrypoint: text # Overwrite the default ENTRYPOINT of the image + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --env-host # Use all current host environment variables in container + --env-merge: text # Preprocess environment variables from image before injecting them into the container + --expose: text # Expose a port or a range of ports + --gidmap: text # GID map to use for the user namespace + --gpus: text # GPU devices to add to the container ('all' to pass all GPUs) + --group-add: groups # Add additional groups to join + --group-entry: text # Entry to write to /etc/group + --health-cmd: text # Command to run to check health + --health-interval: text # Time between running the check (ms|s|m|h) (default 0s) + --health-log-destination: text # Set the destination of the HealthCheck log. Directory path, local or events_logger (local use container state file) (default "local") + --health-max-log-count: text # Set maximum number of attempts in the HealthCheck log file. ('0' value means an infinite number of attempts in the log file) (default 5) + --health-max-log-size: text # Set maximum length in characters of stored HealthCheck log. ('0' value means an infinite log length) (default 500) + --health-on-failure: words [none kill restart stop] # Action to take once the container turns unhealthy (default "none") + --health-retries: text # Consecutive failures needed to report unhealthy + --health-start-period: text # Time between running the check during the start period (ms|s|m|h) (default 0s) + --health-startup-cmd: text # Set a startup healthcheck command for the container + --health-startup-interval: text # Set an interval for the startup healthcheck. (default "30s") + --health-startup-retries: text # Set the maximum number of retries before the startup healthcheck will restart the container + --health-startup-success: text # Set the number of consecutive successes before the startup healthcheck is marked as successful and the normal healthcheck begins (0 indicates any success will start the regular healthcheck) + --health-startup-timeout: text # Set the maximum amount of time that the startup healthcheck may take before it is considered failed (default "30s") + --health-timeout: text # Maximum time to allow one check to run (ms|s|m|h) (default 0s) + --hostname(-h): text # Container host name + --hosts-file: path # Base file to create the /etc/hosts file inside the container, or one of the special values. ("image"|"none") + --hostuser: text # Host user account to add to /etc/passwd within container + --http-proxy # Set proxy environment variables in the container based on the host proxy vars (default true) + --image-volume: words [anonymous bind tmpfs ignore] # Tells podman how to handle the builtin image volumes ("bind"|"tmpfs"|"ignore") (default "anonymous") + --init # Run an init inside the container that forwards signals and reaps processes + --init-path: path # Path to the container-init binary + --interactive(-i) # Keep STDIN open even if not attached + --ip: text # IPv4 address (e.g., 172.30.100.104) + --ip6: text # IPv6 address (e.g., 2001:db8::33) + --ipc: text # IPC mode to use + --label(-l): text # Set meta data on a container + --label-file: path # Read in a line delimited file of labels + --log-driver: words [k8s-file journald none passthrough passthrough-tty] # Logging driver for the container + --log-opt: text # Log driver options + --mac-address: text # Container MAC address (e.g., 92:d0:c6:0a:29:33) + --memory(-m): text # Memory limit + --memory-reservation: text # Memory soft limit + --memory-swap: text # Swap limit equal to memory plus swap: '-1' to enable unlimited swap + --memory-swappiness: text # Tune container memory swappiness (0 to 100) (default -1) + --mount: text # Attach a filesystem mount to the container + --name: text # Assign a name to the container + --network: by "nu-complete podman networks" # Connect a container to a network + --network-alias: text # Add network-scoped alias for the container + --no-healthcheck # Disable any container-specified HEALTHCHECK + --no-hostname # Do not create /etc/hostname within the container, use the image's + --no-hosts # Do not create /etc/hosts within the container, use the image's + --oom-kill-disable # Disable OOM Killer + --oom-score-adj: text # Tune host's OOM preferences (-1000 to 1000) + --os: text # Use OS instead of the running OS for choosing images + --passwd # Add entries to /etc/passwd and /etc/group (default true) + --passwd-entry: text # Entry to write to /etc/passwd + --personality: text # Configure execution domain using personality (e.g., LINUX/LINUX32) + --pid: text # PID namespace to use + --pidfile: path # Write the container process ID to the file + --pids-limit: text # Tune container pids limit (set -1 for unlimited) + --platform: text # Set platform if server is multi-platform capable + --pod: by "nu-complete podman pods" # Run container in an existing pod + --pod-id-file: path # Read the pod ID from the file + --preserve-fd: text # Pass a file descriptor into the container (default []) + --preserve-fds: text # Pass a number of additional file descriptors into the container + --privileged # Give extended privileges to this container + --publish(-p): podman.port with { root.proto: by "nu-complete podman protocols" } # Publish a container's port(s) to the host ([ip:]host:container[/proto]) + --publish-all(-P) # Publish all exposed ports to random ports + --pull: words [always missing never newer] # Pull image before running ("always", "missing", "never") (default "missing") + --quiet(-q) # Suppress the pull output + --rdt-class: text # Class of Service (COS) that the container should be assigned to + --read-only # Mount the container's root filesystem as read only + --read-only-tmpfs # When running --read-only containers mount read-write tmpfs on /dev, /dev/shm, /run, /tmp and /var/tmp (default true) + --replace # If a container with the same name exists, replace it + --requires: by "nu-complete podman all-containers" # Add one or more requirement containers that must be started before this container will start + --restart: words [no always on-failure unless-stopped] # Restart policy to apply when a container exits (default "no") + --retry: text # Number of times to retry in case of failure when performing pull (default 3) + --retry-delay: text # Delay between retries in case of pull failures + --rm # Automatically remove the container when it exits + --rootfs # The first argument is not an image but the rootfs to the exploded container + --sdnotify: words [container conmon healthy ignore] # control sd-notify behavior ("container"|"conmon"|"healthy"|"ignore") (default "container") + --seccomp-policy: text # Policy for selecting a seccomp profile (experimental) (default "default") + --secret: text # Add secret to container + --security-opt: text # Security Options + --shm-size: text # Size of /dev/shm + --shm-size-systemd: text # Size of systemd specific tmpfs mounts (/run, /run/lock) (format: <number>[<unit>], where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes)) + --stop-signal: signals # Signal to stop the container + --stop-timeout: text # Timeout (in seconds) to stop a container + --subgidname: text # Name of range listed in /etc/subgid for use in user namespace + --subuidname: text # Name of range listed in /etc/subuid for use in user namespace + --sysctl: text # Sysctl options (default map[]) + --systemd: words [true false always] # Run container in systemd mode ("true"|"false"|"always") (default "true") + --timeout: text # Maximum length of time a container is allowed to run. The container will be killed automatically after the time expires. + --tls-verify # Require HTTPS and verify certificates when contacting registries for pulling images + --tmpfs: text # Mount a tmpfs directory + --tty(-t) # Allocate a pseudo-TTY + --tz: text # Set timezone in container + --uidmap: text # UID map to use for the user namespace + --ulimit: text # Ulimit options (default []) + --umask: text # Set umask in container (default "0022") + --unsetenv: text # Unset environment default variables in container + --unsetenv-all # Unset all default environment variables in container + --user(-u): users # Username or UID (format: <name|uid>[:<group|gid>]) + --userns: text # User namespace to use + --uts: text # UTS namespace to use + --variant: text # Use VARIANT instead of the running architecture variant for choosing images + --volume(-v): text # Bind mount a volume + --volume-driver: text # Optional volume driver for the container + --volumes-from: by "nu-complete podman all-containers" # Mount volumes from the specified container(s) + --workdir(-w): text # Working directory inside the container + --help # Print usage +] where { + excludes --rm --restart + excludes --rmi --restart +} + +export complete [podman create] [ + image: by "nu-complete podman images" # The image to create the container from + ...command: command # The command to run inside the container, and its arguments + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --annotation: text # Add an annotation to the container (passed through to the OCI runtime) (default map[]) + --arch: text # Use ARCH instead of the architecture of the machine for choosing images + --attach(-a): words [stdin stdout stderr] # Attach to STDIN, STDOUT or STDERR + --authfile: path # Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override + --blkio-weight: text # Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) + --blkio-weight-device: text # Block IO weight (relative device weight) (default []) + --cap-add: text # Add Linux capabilities + --cap-drop: text # Drop Linux capabilities + --cert-dir: text # Pathname of a directory containing TLS certificates and keys + --cgroup-conf: text # Configure cgroup v2 (key=value) + --cgroup-parent: text # Optional parent cgroup for the container + --cgroupns: words [host private] # Cgroup namespace to use (host|private) + --cgroups: words [enabled disabled no-conmon split] # Control container cgroup configuration ("enabled"|"disabled"|"no-conmon"|"split") (default "enabled") + --chrootdirs: text # Chroot directories inside the container + --cidfile: path # Write the container ID to the file + --conmon-pidfile: path # Path to the file that will receive the PID of conmon + --cpu-period: text # Limit CPU CFS (Completely Fair Scheduler) period + --cpu-quota: text # Limit CPU CFS (Completely Fair Scheduler) quota + --cpu-rt-period: text # Limit CPU real-time period in microseconds + --cpu-rt-runtime: text # Limit CPU real-time runtime in microseconds + --cpu-shares(-c): text # CPU shares (relative weight) + --cpus: text # Number of CPUs + --cpuset-cpus: text # CPUs in which to allow execution (0-3, 0,1) + --cpuset-mems: text # MEMs in which to allow execution (0-3, 0,1) + --creds: text # Credentials (USERNAME:PASSWORD) to use for authenticating to a registry + --decryption-key: text # Key needed to decrypt the image (e.g. /path/to/key.pem) + --device: path # Add a host device to the container + --device-cgroup-rule: text # Add a rule to the cgroup allowed devices int + --device-read-bps: text # Limit read rate (bytes per second) from a device (default []) + --device-read-iops: text # Limit read rate (IO per second) from a device (default []) + --device-write-bps: text # Limit write rate (bytes per second) to a device (default []) + --device-write-iops: text # Limit write rate (IO per second) to a device (default []) + --disable-content-trust # Skip image verification (default true) + --dns: text # Set custom DNS servers + --dns-option: text # Set DNS options + --dns-search: text # Set custom DNS search domains + --domainname: text # Container NIS domain name + --entrypoint: text # Overwrite the default ENTRYPOINT of the image + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --env-host # Use all current host environment variables in container + --env-merge: text # Preprocess environment variables from image before injecting them into the container + --expose: text # Expose a port or a range of ports + --gidmap: text # GID map to use for the user namespace + --gpus: text # GPU devices to add to the container ('all' to pass all GPUs) + --group-add: groups # Add additional groups to join + --group-entry: text # Entry to write to /etc/group + --health-cmd: text # Command to run to check health + --health-interval: text # Time between running the check (ms|s|m|h) (default 0s) + --health-log-destination: text # Set the destination of the HealthCheck log. Directory path, local or events_logger (local use container state file) (default "local") + --health-max-log-count: text # Set maximum number of attempts in the HealthCheck log file. ('0' value means an infinite number of attempts in the log file) (default 5) + --health-max-log-size: text # Set maximum length in characters of stored HealthCheck log. ('0' value means an infinite log length) (default 500) + --health-on-failure: words [none kill restart stop] # Action to take once the container turns unhealthy (default "none") + --health-retries: text # Consecutive failures needed to report unhealthy + --health-start-period: text # Time between running the check during the start period (ms|s|m|h) (default 0s) + --health-startup-cmd: text # Set a startup healthcheck command for the container + --health-startup-interval: text # Set an interval for the startup healthcheck. (default "30s") + --health-startup-retries: text # Set the maximum number of retries before the startup healthcheck will restart the container + --health-startup-success: text # Set the number of consecutive successes before the startup healthcheck is marked as successful and the normal healthcheck begins (0 indicates any success will start the regular healthcheck) + --health-startup-timeout: text # Set the maximum amount of time that the startup healthcheck may take before it is considered failed (default "30s") + --health-timeout: text # Maximum time to allow one check to run (ms|s|m|h) (default 0s) + --hostname(-h): text # Container host name + --hosts-file: path # Base file to create the /etc/hosts file inside the container, or one of the special values. ("image"|"none") + --hostuser: text # Host user account to add to /etc/passwd within container + --http-proxy # Set proxy environment variables in the container based on the host proxy vars (default true) + --image-volume: words [anonymous bind tmpfs ignore] # Tells podman how to handle the builtin image volumes ("bind"|"tmpfs"|"ignore") (default "anonymous") + --init # Run an init inside the container that forwards signals and reaps processes + --init-ctr: words [always once] # Make this a pod init container + --init-path: path # Path to the container-init binary + --interactive(-i) # Keep STDIN open even if not attached + --ip: text # IPv4 address (e.g., 172.30.100.104) + --ip6: text # IPv6 address (e.g., 2001:db8::33) + --ipc: text # IPC mode to use + --label(-l): text # Set meta data on a container + --label-file: path # Read in a line delimited file of labels + --log-driver: words [k8s-file journald none passthrough passthrough-tty] # Logging driver for the container + --log-opt: text # Log driver options + --mac-address: text # Container MAC address (e.g., 92:d0:c6:0a:29:33) + --memory(-m): text # Memory limit + --memory-reservation: text # Memory soft limit + --memory-swap: text # Swap limit equal to memory plus swap: '-1' to enable unlimited swap + --memory-swappiness: text # Tune container memory swappiness (0 to 100) (default -1) + --mount: text # Attach a filesystem mount to the container + --name: text # Assign a name to the container + --network: by "nu-complete podman networks" # Connect a container to a network + --network-alias: text # Add network-scoped alias for the container + --no-healthcheck # Disable any container-specified HEALTHCHECK + --no-hostname # Do not create /etc/hostname within the container, use the image's + --no-hosts # Do not create /etc/hosts within the container, use the image's + --oom-kill-disable # Disable OOM Killer + --oom-score-adj: text # Tune host's OOM preferences (-1000 to 1000) + --os: text # Use OS instead of the running OS for choosing images + --passwd # Add entries to /etc/passwd and /etc/group (default true) + --passwd-entry: text # Entry to write to /etc/passwd + --personality: text # Configure execution domain using personality (e.g., LINUX/LINUX32) + --pid: text # PID namespace to use + --pidfile: path # Write the container process ID to the file + --pids-limit: text # Tune container pids limit (set -1 for unlimited) + --platform: text # Set platform if server is multi-platform capable + --pod: by "nu-complete podman pods" # Run container in an existing pod + --pod-id-file: path # Read the pod ID from the file + --preserve-fd: text # Pass a file descriptor into the container (default []) + --preserve-fds: text # Pass a number of additional file descriptors into the container + --privileged # Give extended privileges to this container + --publish(-p): podman.port with { root.proto: by "nu-complete podman protocols" } # Publish a container's port(s) to the host ([ip:]host:container[/proto]) + --publish-all(-P) # Publish all exposed ports to random ports + --pull: words [always missing never newer] # Pull image before running ("always", "missing", "never") (default "missing") + --quiet(-q) # Suppress the pull output + --rdt-class: text # Class of Service (COS) that the container should be assigned to + --read-only # Mount the container's root filesystem as read only + --read-only-tmpfs # When running --read-only containers mount read-write tmpfs on /dev, /dev/shm, /run, /tmp and /var/tmp (default true) + --replace # If a container with the same name exists, replace it + --requires: by "nu-complete podman all-containers" # Add one or more requirement containers that must be started before this container will start + --restart: words [no always on-failure unless-stopped] # Restart policy to apply when a container exits (default "no") + --retry: text # Number of times to retry in case of failure when performing pull (default 3) + --retry-delay: text # Delay between retries in case of pull failures + --rm # Automatically remove the container when it exits + --rootfs # The first argument is not an image but the rootfs to the exploded container + --sdnotify: words [container conmon healthy ignore] # control sd-notify behavior ("container"|"conmon"|"healthy"|"ignore") (default "container") + --seccomp-policy: text # Policy for selecting a seccomp profile (experimental) (default "default") + --secret: text # Add secret to container + --security-opt: text # Security Options + --shm-size: text # Size of /dev/shm + --shm-size-systemd: text # Size of systemd specific tmpfs mounts (/run, /run/lock) (format: <number>[<unit>], where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes)) + --stop-signal: signals # Signal to stop the container + --stop-timeout: text # Timeout (in seconds) to stop a container + --storage-opt: text # Storage driver option (a global podman option) + --subgidname: text # Name of range listed in /etc/subgid for use in user namespace + --subuidname: text # Name of range listed in /etc/subuid for use in user namespace + --sysctl: text # Sysctl options (default map[]) + --systemd: words [true false always] # Run container in systemd mode ("true"|"false"|"always") (default "true") + --timeout: text # Maximum length of time a container is allowed to run. The container will be killed automatically after the time expires. + --tls-verify # Require HTTPS and verify certificates when contacting registries for pulling images + --tmpfs: text # Mount a tmpfs directory + --tty(-t) # Allocate a pseudo-TTY + --tz: text # Set timezone in container + --uidmap: text # UID map to use for the user namespace + --ulimit: text # Ulimit options (default []) + --umask: text # Set umask in container (default "0022") + --unsetenv: text # Unset environment default variables in container + --unsetenv-all # Unset all default environment variables in container + --user(-u): users # Username or UID (format: <name|uid>[:<group|gid>]) + --userns: text # User namespace to use + --uts: text # UTS namespace to use + --variant: text # Use VARIANT instead of the running architecture variant for choosing images + --volume(-v): text # Bind mount a volume + --volume-driver: text # Optional volume driver for the container + --volumes-from: by "nu-complete podman all-containers" # Mount volumes from the specified container(s) + --workdir(-w): text # Working directory inside the container + --help # Print usage +] where { + excludes --rm --restart +} + +export complete [podman container create] [ + image: by "nu-complete podman images" # The image to create the container from + ...command: command # The command to run inside the container, and its arguments + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --annotation: text # Add an annotation to the container (passed through to the OCI runtime) (default map[]) + --arch: text # Use ARCH instead of the architecture of the machine for choosing images + --attach(-a): words [stdin stdout stderr] # Attach to STDIN, STDOUT or STDERR + --authfile: path # Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override + --blkio-weight: text # Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) + --blkio-weight-device: text # Block IO weight (relative device weight) (default []) + --cap-add: text # Add Linux capabilities + --cap-drop: text # Drop Linux capabilities + --cert-dir: text # Pathname of a directory containing TLS certificates and keys + --cgroup-conf: text # Configure cgroup v2 (key=value) + --cgroup-parent: text # Optional parent cgroup for the container + --cgroupns: words [host private] # Cgroup namespace to use (host|private) + --cgroups: words [enabled disabled no-conmon split] # Control container cgroup configuration ("enabled"|"disabled"|"no-conmon"|"split") (default "enabled") + --chrootdirs: text # Chroot directories inside the container + --cidfile: path # Write the container ID to the file + --conmon-pidfile: path # Path to the file that will receive the PID of conmon + --cpu-period: text # Limit CPU CFS (Completely Fair Scheduler) period + --cpu-quota: text # Limit CPU CFS (Completely Fair Scheduler) quota + --cpu-rt-period: text # Limit CPU real-time period in microseconds + --cpu-rt-runtime: text # Limit CPU real-time runtime in microseconds + --cpu-shares(-c): text # CPU shares (relative weight) + --cpus: text # Number of CPUs + --cpuset-cpus: text # CPUs in which to allow execution (0-3, 0,1) + --cpuset-mems: text # MEMs in which to allow execution (0-3, 0,1) + --creds: text # Credentials (USERNAME:PASSWORD) to use for authenticating to a registry + --decryption-key: text # Key needed to decrypt the image (e.g. /path/to/key.pem) + --device: path # Add a host device to the container + --device-cgroup-rule: text # Add a rule to the cgroup allowed devices int + --device-read-bps: text # Limit read rate (bytes per second) from a device (default []) + --device-read-iops: text # Limit read rate (IO per second) from a device (default []) + --device-write-bps: text # Limit write rate (bytes per second) to a device (default []) + --device-write-iops: text # Limit write rate (IO per second) to a device (default []) + --disable-content-trust # Skip image verification (default true) + --dns: text # Set custom DNS servers + --dns-option: text # Set DNS options + --dns-search: text # Set custom DNS search domains + --domainname: text # Container NIS domain name + --entrypoint: text # Overwrite the default ENTRYPOINT of the image + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --env-host # Use all current host environment variables in container + --env-merge: text # Preprocess environment variables from image before injecting them into the container + --expose: text # Expose a port or a range of ports + --gidmap: text # GID map to use for the user namespace + --gpus: text # GPU devices to add to the container ('all' to pass all GPUs) + --group-add: groups # Add additional groups to join + --group-entry: text # Entry to write to /etc/group + --health-cmd: text # Command to run to check health + --health-interval: text # Time between running the check (ms|s|m|h) (default 0s) + --health-log-destination: text # Set the destination of the HealthCheck log. Directory path, local or events_logger (local use container state file) (default "local") + --health-max-log-count: text # Set maximum number of attempts in the HealthCheck log file. ('0' value means an infinite number of attempts in the log file) (default 5) + --health-max-log-size: text # Set maximum length in characters of stored HealthCheck log. ('0' value means an infinite log length) (default 500) + --health-on-failure: words [none kill restart stop] # Action to take once the container turns unhealthy (default "none") + --health-retries: text # Consecutive failures needed to report unhealthy + --health-start-period: text # Time between running the check during the start period (ms|s|m|h) (default 0s) + --health-startup-cmd: text # Set a startup healthcheck command for the container + --health-startup-interval: text # Set an interval for the startup healthcheck. (default "30s") + --health-startup-retries: text # Set the maximum number of retries before the startup healthcheck will restart the container + --health-startup-success: text # Set the number of consecutive successes before the startup healthcheck is marked as successful and the normal healthcheck begins (0 indicates any success will start the regular healthcheck) + --health-startup-timeout: text # Set the maximum amount of time that the startup healthcheck may take before it is considered failed (default "30s") + --health-timeout: text # Maximum time to allow one check to run (ms|s|m|h) (default 0s) + --hostname(-h): text # Container host name + --hosts-file: path # Base file to create the /etc/hosts file inside the container, or one of the special values. ("image"|"none") + --hostuser: text # Host user account to add to /etc/passwd within container + --http-proxy # Set proxy environment variables in the container based on the host proxy vars (default true) + --image-volume: words [anonymous bind tmpfs ignore] # Tells podman how to handle the builtin image volumes ("bind"|"tmpfs"|"ignore") (default "anonymous") + --init # Run an init inside the container that forwards signals and reaps processes + --init-ctr: words [always once] # Make this a pod init container + --init-path: path # Path to the container-init binary + --interactive(-i) # Keep STDIN open even if not attached + --ip: text # IPv4 address (e.g., 172.30.100.104) + --ip6: text # IPv6 address (e.g., 2001:db8::33) + --ipc: text # IPC mode to use + --label(-l): text # Set meta data on a container + --label-file: path # Read in a line delimited file of labels + --log-driver: words [k8s-file journald none passthrough passthrough-tty] # Logging driver for the container + --log-opt: text # Log driver options + --mac-address: text # Container MAC address (e.g., 92:d0:c6:0a:29:33) + --memory(-m): text # Memory limit + --memory-reservation: text # Memory soft limit + --memory-swap: text # Swap limit equal to memory plus swap: '-1' to enable unlimited swap + --memory-swappiness: text # Tune container memory swappiness (0 to 100) (default -1) + --mount: text # Attach a filesystem mount to the container + --name: text # Assign a name to the container + --network: by "nu-complete podman networks" # Connect a container to a network + --network-alias: text # Add network-scoped alias for the container + --no-healthcheck # Disable any container-specified HEALTHCHECK + --no-hostname # Do not create /etc/hostname within the container, use the image's + --no-hosts # Do not create /etc/hosts within the container, use the image's + --oom-kill-disable # Disable OOM Killer + --oom-score-adj: text # Tune host's OOM preferences (-1000 to 1000) + --os: text # Use OS instead of the running OS for choosing images + --passwd # Add entries to /etc/passwd and /etc/group (default true) + --passwd-entry: text # Entry to write to /etc/passwd + --personality: text # Configure execution domain using personality (e.g., LINUX/LINUX32) + --pid: text # PID namespace to use + --pidfile: path # Write the container process ID to the file + --pids-limit: text # Tune container pids limit (set -1 for unlimited) + --platform: text # Set platform if server is multi-platform capable + --pod: by "nu-complete podman pods" # Run container in an existing pod + --pod-id-file: path # Read the pod ID from the file + --preserve-fd: text # Pass a file descriptor into the container (default []) + --preserve-fds: text # Pass a number of additional file descriptors into the container + --privileged # Give extended privileges to this container + --publish(-p): podman.port with { root.proto: by "nu-complete podman protocols" } # Publish a container's port(s) to the host ([ip:]host:container[/proto]) + --publish-all(-P) # Publish all exposed ports to random ports + --pull: words [always missing never newer] # Pull image before running ("always", "missing", "never") (default "missing") + --quiet(-q) # Suppress the pull output + --rdt-class: text # Class of Service (COS) that the container should be assigned to + --read-only # Mount the container's root filesystem as read only + --read-only-tmpfs # When running --read-only containers mount read-write tmpfs on /dev, /dev/shm, /run, /tmp and /var/tmp (default true) + --replace # If a container with the same name exists, replace it + --requires: by "nu-complete podman all-containers" # Add one or more requirement containers that must be started before this container will start + --restart: words [no always on-failure unless-stopped] # Restart policy to apply when a container exits (default "no") + --retry: text # Number of times to retry in case of failure when performing pull (default 3) + --retry-delay: text # Delay between retries in case of pull failures + --rm # Automatically remove the container when it exits + --rootfs # The first argument is not an image but the rootfs to the exploded container + --sdnotify: words [container conmon healthy ignore] # control sd-notify behavior ("container"|"conmon"|"healthy"|"ignore") (default "container") + --seccomp-policy: text # Policy for selecting a seccomp profile (experimental) (default "default") + --secret: text # Add secret to container + --security-opt: text # Security Options + --shm-size: text # Size of /dev/shm + --shm-size-systemd: text # Size of systemd specific tmpfs mounts (/run, /run/lock) (format: <number>[<unit>], where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes)) + --stop-signal: signals # Signal to stop the container + --stop-timeout: text # Timeout (in seconds) to stop a container + --storage-opt: text # Storage driver option (a global podman option) + --subgidname: text # Name of range listed in /etc/subgid for use in user namespace + --subuidname: text # Name of range listed in /etc/subuid for use in user namespace + --sysctl: text # Sysctl options (default map[]) + --systemd: words [true false always] # Run container in systemd mode ("true"|"false"|"always") (default "true") + --timeout: text # Maximum length of time a container is allowed to run. The container will be killed automatically after the time expires. + --tls-verify # Require HTTPS and verify certificates when contacting registries for pulling images + --tmpfs: text # Mount a tmpfs directory + --tty(-t) # Allocate a pseudo-TTY + --tz: text # Set timezone in container + --uidmap: text # UID map to use for the user namespace + --ulimit: text # Ulimit options (default []) + --umask: text # Set umask in container (default "0022") + --unsetenv: text # Unset environment default variables in container + --unsetenv-all # Unset all default environment variables in container + --user(-u): users # Username or UID (format: <name|uid>[:<group|gid>]) + --userns: text # User namespace to use + --uts: text # UTS namespace to use + --variant: text # Use VARIANT instead of the running architecture variant for choosing images + --volume(-v): text # Bind mount a volume + --volume-driver: text # Optional volume driver for the container + --volumes-from: by "nu-complete podman all-containers" # Mount volumes from the specified container(s) + --workdir(-w): text # Working directory inside the container + --help # Print usage +] where { + excludes --rm --restart +} + +export complete [podman exec] [ + container: by "nu-complete podman containers" # The running container + ...command: command # The command to run, and its arguments + --cidfile: path # Read the container ID from the file + --detach(-d) # Run the exec session in detached mode (backgrounded) + --detach-keys: text # Select the key sequence for detaching a container + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --interactive(-i) # Make STDIN available to the contained process + --latest(-l) # Act on the latest container podman is aware of + --preserve-fd: text # Pass a list of additional file descriptors to the container + --preserve-fds: text # Pass N additional file descriptors to the container + --privileged # Give the process extended Linux capabilities inside the container + --tty(-t) # Allocate a pseudo-TTY + --user(-u): users # Sets the username or UID used and optionally the groupname or GID for the specified command + --workdir(-w): text # Working directory inside the container + --help # Print usage ] -# Import a tarball to create a filesystem image -export extern "podman image import" [ - path: string #Import path - --arch: string #Set the architecture of the imported image - --change(-c): string #Apply the following possible instructions to the created image (default []): CMD | ENTRYPOINT | ENV | EXPOSE | LABEL | ONBUILD | STOPSIGNAL | USER | VOLUME | WORKDIR - --message(-m): string #Set commit message for imported image - --os: string #Set the OS of the imported image - --quiet(-q) #Suppress output - --variant: string #Set the variant of the imported image +export complete [podman container exec] [ + container: by "nu-complete podman containers" # The running container + ...command: command # The command to run, and its arguments + --cidfile: path # Read the container ID from the file + --detach(-d) # Run the exec session in detached mode (backgrounded) + --detach-keys: text # Select the key sequence for detaching a container + --env(-e): env-assign # Set environment variables + --env-file: path # Read in a file of environment variables + --interactive(-i) # Make STDIN available to the contained process + --latest(-l) # Act on the latest container podman is aware of + --preserve-fd: text # Pass a list of additional file descriptors to the container + --preserve-fds: text # Pass N additional file descriptors to the container + --privileged # Give the process extended Linux capabilities inside the container + --tty(-t) # Allocate a pseudo-TTY + --user(-u): users # Sets the username or UID used and optionally the groupname or GID for the specified command + --workdir(-w): text # Working directory inside the container + --help # Print usage +] + +export complete [podman ps] [ + --all(-a) # Show all the containers, default is only running containers + --external # Show containers in storage not controlled by Podman + --filter(-f): text # Filter output based on conditions given + --format: text # Pretty-print containers to JSON or using a Go template + --last(-n): text # Print the n last created containers (all states) + --latest(-l) # Act on the latest container podman is aware of + --no-trunc # Display the extended information + --noheading # Do not print headers + --ns # Display namespace information + --pod(-p) # Print the ID and name of the pod the containers are associated with + --quiet(-q) # Print the numeric IDs of the containers only + --size(-s) # Display the total file sizes + --sort: words [command created id image names runningfor size status] # Sort output by the given field + --sync # Sync container state with OCI runtime + --watch(-w): text # Watch the ps output on an interval in seconds + --help(-h) # Print usage +] where { + overrides [--last --latest] + at-most-one [--quiet --format] +} + +export complete [podman container ls] [ + --all(-a) # Show all the containers, default is only running containers + --external # Show containers in storage not controlled by Podman + --filter(-f): text # Filter output based on conditions given + --format: text # Pretty-print containers to JSON or using a Go template + --last(-n): text # Print the n last created containers (all states) + --latest(-l) # Act on the latest container podman is aware of + --no-trunc # Display the extended information + --noheading # Do not print headers + --ns # Display namespace information + --pod(-p) # Print the ID and name of the pod the containers are associated with + --quiet(-q) # Print the numeric IDs of the containers only + --size(-s) # Display the total file sizes + --sort: words [command created id image names runningfor size status] # Sort output by the given field + --sync # Sync container state with OCI runtime + --watch(-w): text # Watch the ps output on an interval in seconds + --help(-h) # Print usage +] where { + overrides [--last --latest] + at-most-one [--quiet --format] +} + +export complete [podman container list] [ + --all(-a) # Show all the containers, default is only running containers + --external # Show containers in storage not controlled by Podman + --filter(-f): text # Filter output based on conditions given + --format: text # Pretty-print containers to JSON or using a Go template + --last(-n): text # Print the n last created containers (all states) + --latest(-l) # Act on the latest container podman is aware of + --no-trunc # Display the extended information + --noheading # Do not print headers + --ns # Display namespace information + --pod(-p) # Print the ID and name of the pod the containers are associated with + --quiet(-q) # Print the numeric IDs of the containers only + --size(-s) # Display the total file sizes + --sort: words [command created id image names runningfor size status] # Sort output by the given field + --sync # Sync container state with OCI runtime + --watch(-w): text # Watch the ps output on an interval in seconds + --help(-h) # Print usage +] where { + overrides [--last --latest] + at-most-one [--quiet --format] +} + +export complete [podman container ps] [ + --all(-a) # Show all the containers, default is only running containers + --external # Show containers in storage not controlled by Podman + --filter(-f): text # Filter output based on conditions given + --format: text # Pretty-print containers to JSON or using a Go template + --last(-n): text # Print the n last created containers (all states) + --latest(-l) # Act on the latest container podman is aware of + --no-trunc # Display the extended information + --noheading # Do not print headers + --ns # Display namespace information + --pod(-p) # Print the ID and name of the pod the containers are associated with + --quiet(-q) # Print the numeric IDs of the containers only + --size(-s) # Display the total file sizes + --sort: words [command created id image names runningfor size status] # Sort output by the given field + --sync # Sync container state with OCI runtime + --watch(-w): text # Watch the ps output on an interval in seconds + --help(-h) # Print usage +] where { + overrides [--last --latest] + at-most-one [--quiet --format] +} + +export complete [podman logs] [ + ...containers: by "nu-complete podman all-containers" # The containers + --color # Output the containers with different colors in the log + --follow(-f) # Follow log output + --latest(-l) # Act on the latest container podman is aware of + --names(-n) # Output the container name in the log + --since: text # Show logs since TIMESTAMP + --tail: text # Output the specified number of LINES at the end of the logs + --timestamps(-t) # Output the timestamps in the log + --until: text # Show logs until TIMESTAMP + --help # Print usage +] + +export complete [podman container logs] [ + ...containers: by "nu-complete podman all-containers" # The containers + --color # Output the containers with different colors in the log + --follow(-f) # Follow log output + --latest(-l) # Act on the latest container podman is aware of + --names(-n) # Output the container name in the log + --since: text # Show logs since TIMESTAMP + --tail: text # Output the specified number of LINES at the end of the logs + --timestamps(-t) # Output the timestamps in the log + --until: text # Show logs until TIMESTAMP + --help # Print usage +] + +export complete [podman stop] [ + ...containers: by "nu-complete podman containers" # The containers to stop + --all(-a) # Stop all running containers + --cidfile: path # Read the container ID from the file + --filter(-f): text # Filter output based on conditions given + --ignore(-i) # Ignore errors when a specified container is missing + --latest(-l) # Act on the latest container podman is aware of + --time(-t): text # Seconds to wait for stop before killing the container + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman container stop] [ + ...containers: by "nu-complete podman containers" # The containers to stop + --all(-a) # Stop all running containers + --cidfile: path # Read the container ID from the file + --filter(-f): text # Filter output based on conditions given + --ignore(-i) # Ignore errors when a specified container is missing + --latest(-l) # Act on the latest container podman is aware of + --time(-t): text # Seconds to wait for stop before killing the container + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman restart] [ + ...containers: by "nu-complete podman all-containers" # The containers to restart + --all(-a) # Restart all non-running containers + --cidfile: path # Read the container ID from the file + --filter(-f): text # Filter output based on conditions given + --latest(-l) # Act on the latest container podman is aware of + --running # Restart only running containers + --time(-t): text # Seconds to wait for stop before killing the container + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman container restart] [ + ...containers: by "nu-complete podman all-containers" # The containers to restart + --all(-a) # Restart all non-running containers + --cidfile: path # Read the container ID from the file + --filter(-f): text # Filter output based on conditions given + --latest(-l) # Act on the latest container podman is aware of + --running # Restart only running containers + --time(-t): text # Seconds to wait for stop before killing the container + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman start] [ + ...containers: by "nu-complete podman all-containers" # The containers to start + --all # Start all containers regardless of their state or configuration + --attach(-a) # Attach container's STDOUT and STDERR + --detach-keys: text # Select the key sequence for detaching a container + --filter(-f): text # Filter output based on conditions given + --interactive(-i) # Make STDIN available to the contained process + --latest(-l) # Act on the latest container podman is aware of + --sig-proxy # Proxy received signals to the process + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman container start] [ + ...containers: by "nu-complete podman all-containers" # The containers to start + --all # Start all containers regardless of their state or configuration + --attach(-a) # Attach container's STDOUT and STDERR + --detach-keys: text # Select the key sequence for detaching a container + --filter(-f): text # Filter output based on conditions given + --interactive(-i) # Make STDIN available to the contained process + --latest(-l) # Act on the latest container podman is aware of + --sig-proxy # Proxy received signals to the process + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman rm] [ + ...containers: by "nu-complete podman all-containers" # The containers to remove + --all(-a) # Remove all containers + --cidfile: path # Read the container ID from the file + --depend # Remove container and all containers that depend on the selected container + --filter: text # Filter output based on conditions given + --force(-f) # Force removal of a running or unusable container + --ignore(-i) # Ignore errors when a specified container is missing + --latest(-l) # Act on the latest container podman is aware of + --time(-t): text # Seconds to wait for stop before killing the container + --volumes(-v) # Remove anonymous volumes associated with the container + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman container rm] [ + ...containers: by "nu-complete podman all-containers" # The containers to remove + --all(-a) # Remove all containers + --cidfile: path # Read the container ID from the file + --depend # Remove container and all containers that depend on the selected container + --filter: text # Filter output based on conditions given + --force(-f) # Force removal of a running or unusable container + --ignore(-i) # Ignore errors when a specified container is missing + --latest(-l) # Act on the latest container podman is aware of + --time(-t): text # Seconds to wait for stop before killing the container + --volumes(-v) # Remove anonymous volumes associated with the container + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman kill] [ + ...containers: by "nu-complete podman containers" # The containers to kill + --all(-a) # Signal all running containers + --cidfile: path # Read the container ID from the file + --latest(-l) # Act on the latest container podman is aware of + --signal(-s): signals # Signal to send to the container + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman container kill] [ + ...containers: by "nu-complete podman containers" # The containers to kill + --all(-a) # Signal all running containers + --cidfile: path # Read the container ID from the file + --latest(-l) # Act on the latest container podman is aware of + --signal(-s): signals # Signal to send to the container + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman attach] [ + container: by "nu-complete podman containers" # The running container + --detach-keys: text # Select the key sequence for detaching a container + --latest(-l) # Act on the latest container podman is aware of + --no-stdin # Do not attach STDIN + --sig-proxy # Proxy received signals to the process + --help(-h) # Print usage +] + +export complete [podman container attach] [ + container: by "nu-complete podman containers" # The running container + --detach-keys: text # Select the key sequence for detaching a container + --latest(-l) # Act on the latest container podman is aware of + --no-stdin # Do not attach STDIN + --sig-proxy # Proxy received signals to the process + --help(-h) # Print usage +] + +export complete [podman top] [ + container: by "nu-complete podman containers" # The running container + ...descriptors: text # Format descriptors (e.g. pid user args) + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] + +export complete [podman container top] [ + container: by "nu-complete podman containers" # The running container + ...descriptors: text # Format descriptors (e.g. pid user args) + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] + +export complete [podman stats] [ + ...containers: by "nu-complete podman containers" # The containers to watch (default: all running) + --all(-a) # Show all containers + --format: text # Pretty-print container statistics to JSON or using a Go template + --interval(-i): text # Time in seconds between stats reports + --latest(-l) # Act on the latest container podman is aware of + --no-reset # Disable resetting the screen between intervals + --no-stream # Disable streaming stats and only pull the first result + --no-trunc # Do not truncate output + --help(-h) # Print usage +] + +export complete [podman container stats] [ + ...containers: by "nu-complete podman containers" # The containers to watch (default: all running) + --all(-a) # Show all containers + --format: text # Pretty-print container statistics to JSON or using a Go template + --interval(-i): text # Time in seconds between stats reports + --latest(-l) # Act on the latest container podman is aware of + --no-reset # Disable resetting the screen between intervals + --no-stream # Disable streaming stats and only pull the first result + --no-trunc # Do not truncate output + --help(-h) # Print usage +] + +export complete [podman cp] [ + source: path # CONTAINER:SRC_PATH, or a local path (- for stdin) + dest: path # CONTAINER:DEST_PATH, or a local path (- for stdout) + --archive(-a) # Chown copied files to the primary uid/gid of the destination container + --overwrite # Allow to overwrite directories with non-directories and vice versa + --help(-h) # Print usage +] + +export complete [podman container cp] [ + source: path # CONTAINER:SRC_PATH, or a local path (- for stdin) + dest: path # CONTAINER:DEST_PATH, or a local path (- for stdout) + --archive(-a) # Chown copied files to the primary uid/gid of the destination container + --overwrite # Allow to overwrite directories with non-directories and vice versa + --help(-h) # Print usage +] + +export complete [podman pause] [ + ...containers: by "nu-complete podman containers" # The containers to pause + --all(-a) # Pause all running containers + --cidfile: path # Read the container ID from the file + --filter(-f): text # Filter output based on conditions given + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman container pause] [ + ...containers: by "nu-complete podman containers" # The containers to pause + --all(-a) # Pause all running containers + --cidfile: path # Read the container ID from the file + --filter(-f): text # Filter output based on conditions given + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman unpause] [ + ...containers: by "nu-complete podman all-containers" # The containers to unpause + --all(-a) # Unpause all paused containers + --cidfile: path # Read the container ID from the file + --filter(-f): text # Filter output based on conditions given + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman container unpause] [ + ...containers: by "nu-complete podman all-containers" # The containers to unpause + --all(-a) # Unpause all paused containers + --cidfile: path # Read the container ID from the file + --filter(-f): text # Filter output based on conditions given + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman port] [ + container?: by "nu-complete podman all-containers" # The container + port?: text # PRIVATE_PORT[/PROTO] + --all(-a) # Display port information for all containers + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] + +export complete [podman container port] [ + container?: by "nu-complete podman all-containers" # The container + port?: text # PRIVATE_PORT[/PROTO] + --all(-a) # Display port information for all containers + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] + +export complete [podman rename] [ + container: by "nu-complete podman all-containers" # The container to rename + new_name: text # The new name + --help(-h) # Print usage +] + +export complete [podman container rename] [ + container: by "nu-complete podman all-containers" # The container to rename + new_name: text # The new name + --help(-h) # Print usage +] + +export complete [podman diff] [ + container: by "nu-complete podman all-containers" # The container + --format: text # Change the output format (json) + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] + +export complete [podman container diff] [ + container: by "nu-complete podman all-containers" # The container + --format: text # Change the output format (json) + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] + +export complete [podman export] [ + container: by "nu-complete podman all-containers" # The container + --output(-o): path # Write to a specified file (default: stdout, which must be redirected) + --help(-h) # Print usage +] + +export complete [podman container export] [ + container: by "nu-complete podman all-containers" # The container + --output(-o): path # Write to a specified file (default: stdout, which must be redirected) + --help(-h) # Print usage +] + +export complete [podman commit] [ + container: by "nu-complete podman all-containers" # The container + image?: text # IMAGE[:TAG] for the new image + --author(-a): text # Set the author for the image committed + --change(-c): text # Apply the following possible instructions to the created image + --config: path # File containing a container configuration to merge into the image + --format(-f): words [oci docker] # Format of the image manifest and metadata + --iidfile: path # Write the image ID to the file + --include-volumes # Include container volumes as image volumes + --message(-m): text # Set commit message for imported image + --pause(-p) # Pause container during commit + --quiet(-q) # Suppress output + --squash(-s) # Squash newly built layers into a single new layer + --help(-h) # Print usage +] + +export complete [podman container commit] [ + container: by "nu-complete podman all-containers" # The container + image?: text # IMAGE[:TAG] for the new image + --author(-a): text # Set the author for the image committed + --change(-c): text # Apply the following possible instructions to the created image + --config: path # File containing a container configuration to merge into the image + --format(-f): words [oci docker] # Format of the image manifest and metadata + --iidfile: path # Write the image ID to the file + --include-volumes # Include container volumes as image volumes + --message(-m): text # Set commit message for imported image + --pause(-p) # Pause container during commit + --quiet(-q) # Suppress output + --squash(-s) # Squash newly built layers into a single new layer + --help(-h) # Print usage +] + +export complete [podman wait] [ + ...containers: by "nu-complete podman containers" # The containers to wait for + --condition: words [configured created exited healthy initialized paused removing running stopped stopping unhealthy] # Condition to wait on + --exit-first-match # Wait for exit of first container which matches conditions, ignore other ones + --ignore # Ignore if a container does not exist + --interval(-i): text # Time Interval to wait before polling for completion + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] + +export complete [podman container wait] [ + ...containers: by "nu-complete podman containers" # The containers to wait for + --condition: words [configured created exited healthy initialized paused removing running stopped stopping unhealthy] # Condition to wait on + --exit-first-match # Wait for exit of first container which matches conditions, ignore other ones + --ignore # Ignore if a container does not exist + --interval(-i): text # Time Interval to wait before polling for completion + --latest(-l) # Act on the latest container podman is aware of + --help(-h) # Print usage +] + +# Update the configuration of an existing container +export complete [podman container update] [ + container?: by "nu-complete podman all-containers" # The container to update + --blkio-weight: text # Block IO weight (relative weight), between 10 and 1000 + --blkio-weight-device: text # Block IO weight (relative device weight, DEVICE_NAME:WEIGHT) + --cpu-period: text # Limit the CPU CFS (Completely Fair Scheduler) period + --cpu-quota: text # Limit the CPU CFS (Completely Fair Scheduler) quota + --cpu-rt-period: text # Limit the CPU real-time period in microseconds + --cpu-rt-runtime: text # Limit the CPU real-time runtime in microseconds + --cpu-shares(-c): text # CPU shares (relative weight) + --cpus: text # Number of CPUs (0 means no limit) + --cpuset-cpus: text # CPUs in which to allow execution (0-3, 0,1) + --cpuset-mems: text # Memory nodes (MEMs) in which to allow execution (NUMA only) + --device-read-bps: text # Limit read rate (bytes per second) from a device + --device-read-iops: text # Limit read rate (IO per second) from a device + --device-write-bps: text # Limit write rate (bytes per second) to a device + --device-write-iops: text # Limit write rate (IO per second) to a device + --env(-e): env-assign # Set environment variables in the container + --health-cmd: text # Set a healthcheck command ('none' disables the existing healthcheck) + --health-interval: text # Interval for the healthcheck + --health-log-destination: text # Destination of the HealthCheck log (directory path, local or events_logger) + --health-max-log-count: text # Maximum number of attempts kept in the HealthCheck log + --health-max-log-size: text # Maximum length in characters of the stored HealthCheck log + --health-on-failure: words [none kill restart stop] # Action to take once the container turns unhealthy + --health-retries: text # Number of retries allowed before a healthcheck is considered unhealthy + --health-start-period: text # Initialization time needed for the container to bootstrap + --health-startup-cmd: text # Startup healthcheck command + --health-startup-interval: text # Interval for the startup healthcheck + --health-startup-retries: text # Maximum number of retries before the startup healthcheck restarts the container + --health-startup-success: text # Consecutive successes before the startup healthcheck is marked successful + --health-startup-timeout: text # Maximum time the startup healthcheck may take + --health-timeout: text # Maximum time allowed to complete the healthcheck + --latest(-l) # Act on the latest container podman is aware of + --memory(-m): text # Memory limit (<number>[<unit>]) + --memory-reservation: text # Memory soft limit (<number>[<unit>]) + --memory-swap: text # Swap limit equal to memory plus swap: '-1' to enable unlimited swap + --memory-swappiness: text # Container memory swappiness (0 to 100, or -1 for system default) + --no-healthcheck # Disable healthchecks on the container + --pids-limit: text # Container pids limit (-1 for unlimited) + --restart: words [always no never on-failure unless-stopped] # Restart policy to apply when the container exits + --ulimit: text # Ulimit options + --unsetenv: text # Unset environment default variables in the container + --help(-h) # Print usage +] where { + terminal [--help] +} + +export complete [podman inspect] [ + ...objects: by "nu-complete podman all-containers" # Names or IDs of the objects to inspect + --format(-f): text # Format the output to a Go template or json + --latest(-l) # Act on the latest container podman is aware of + --size(-s) # Display total file size + --type(-t): words [all container image network pod volume] # Specify inspect-object type + --help(-h) # Print usage +] + +export complete [podman container inspect] [ + ...containers: by "nu-complete podman all-containers" # The containers to inspect + --format(-f): text # Format the output to a Go template or json + --latest(-l) # Act on the latest container podman is aware of + --size(-s) # Display total file size + --help(-h) # Print usage +] + +export complete [podman container prune] [ + --filter: text # Provide filter values (e.g. 'label=<key>=<value>') + --force(-f) # Do not prompt for confirmation + --help(-h) # Print usage +] + +# --- Pods ------------------------------------------------------------------------- + +export complete [podman pod create] [ + name?: text # The name of the new pod + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --cgroup-parent: text # Set parent cgroup for the pod + --cpus: text # Number of CPUs + --dns: text # Set custom DNS servers + --exit-policy: words [continue stop] # Behaviour when the last container exits + --hostname: text # Set the pod's hostname + --infra # Create an infra container associated with the pod to share namespaces with + --infra-command: text # The command to run on the infra container when the pod is started + --infra-image: by "nu-complete podman images" # Container image to use for the infra container + --infra-name: text # The name used as infra container name + --label(-l): text # Set metadata on pod + --label-file: path # Read in a line delimited file of labels + --memory(-m): text # Memory limit + --name(-n): text # Assign a name to the pod + --network: by "nu-complete podman networks" # Connect the pod to a network + --pod-id-file: path # Write the pod ID to the file + --publish(-p): podman.port with { root.proto: by "nu-complete podman protocols" } # Publish a container's port(s) to the host + --replace # If a pod with the same name exists, replace it + --share: text # A comma delimited list of kernel namespaces the pod will share + --userns: text # User namespace to use + --volume(-v): text # Bind mount a volume + --help(-h) # Print usage +] + +export complete [podman pod ls] [ + --ctr-ids # Display the container UUIDs + --ctr-names # Display the container names + --ctr-status # Display the container status + --filter(-f): text # Filter output based on conditions given + --format: text # Pretty-print pods to JSON or using a Go template + --latest(-l) # Act on the latest pod podman is aware of + --no-trunc # Do not truncate pod and container IDs + --noheading # Do not print headers + --ns # Display namespace information of the pod + --quiet(-q) # Print the numeric IDs of the pods only + --sort: words [created id name status netns] # Sort output by created, id, name, or number + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman pod list] [ + --ctr-ids # Display the container UUIDs + --ctr-names # Display the container names + --ctr-status # Display the container status + --filter(-f): text # Filter output based on conditions given + --format: text # Pretty-print pods to JSON or using a Go template + --latest(-l) # Act on the latest pod podman is aware of + --no-trunc # Do not truncate pod and container IDs + --noheading # Do not print headers + --ns # Display namespace information of the pod + --quiet(-q) # Print the numeric IDs of the pods only + --sort: words [created id name status netns] # Sort output by created, id, name, or number + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman pod ps] [ + --ctr-ids # Display the container UUIDs + --ctr-names # Display the container names + --ctr-status # Display the container status + --filter(-f): text # Filter output based on conditions given + --format: text # Pretty-print pods to JSON or using a Go template + --latest(-l) # Act on the latest pod podman is aware of + --no-trunc # Do not truncate pod and container IDs + --noheading # Do not print headers + --ns # Display namespace information of the pod + --quiet(-q) # Print the numeric IDs of the pods only + --sort: words [created id name status netns] # Sort output by created, id, name, or number + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman pod rm] [ + ...pods: by "nu-complete podman pods" # The pods to remove + --all(-a) # Remove all running pods + --force(-f) # Force removal of a running pod by first stopping all containers, then removing all containers in the pod + --ignore(-i) # Ignore errors when a specified pod is missing + --latest(-l) # Act on the latest pod podman is aware of + --pod-id-file: path # Read the pod ID from the file + --time(-t): text # Seconds to wait for pod stop before killing the container + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman pod start] [ + ...pods: by "nu-complete podman pods" # The pods to start + --all(-a) # Start all pods + --latest(-l) # Act on the latest pod podman is aware of + --pod-id-file: path # Read the pod ID from the file + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +export complete [podman pod stop] [ + ...pods: by "nu-complete podman pods" # The pods to stop + --all(-a) # Stop all running pods + --ignore(-i) # Ignore errors when a specified pod is missing + --latest(-l) # Act on the latest pod podman is aware of + --pod-id-file: path # Read the pod ID from the file + --time(-t): text # Seconds to wait for pod stop before killing the container + --help(-h) # Print usage +] where { + at-most-one [--all --latest] +} + +# --- Images ----------------------------------------------------------------------- + +export complete [podman build] [ + context?: path # Build context directory or URL + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --all-platforms # Attempt to build for all base image platforms + --annotation: text # Set metadata for an image + --arch: text # Set the ARCH of the image (default: amd64) + --authfile: path # Path of the authentication file + --build-arg: text # Argument=value to supply to the builder + --build-arg-file: path # Argfile.conf containing argument=value lines + --build-context: text # Additional build context (argument=value) + --cache-from: text # Remote repositories used as cache sources + --cache-to: text # Remote repositories used as cache destinations + --cache-ttl: text # Only consider cache images under this duration + --cap-add: text # Add the specified Linux capability + --cap-drop: text # Drop the specified Linux capability + --cert-dir: dir # Certificates directory for registry access + --cgroup-parent: text # Optional parent cgroup for the container + --cgroupns: words [private host] # Cgroup namespace ('private' or 'host') + --compat-volumes # Preserve VOLUME contents during RUN + --compress # Legacy option, no effect + --cpp-flag: text # Additional flags for the C preprocessor + --cpu-period: text # Limit the CPU CFS period + --cpu-quota: text # Limit the CPU CFS quota + --cpu-shares(-c): text # CPU shares (relative weight) + --cpuset-cpus: text # CPUs allowed to execute (e.g. 0-3, 0,1) + --cpuset-mems: text # NUMA memory nodes to use + --created-annotation # Set image created annotation + --creds: text # Registry credentials [username[:password]] + --cw: text # Confidential workload options + --decryption-key: path # Key needed to decrypt the image + --device: text # Additional devices to provide + --disable-compression(-D) # Do not compress layers by default + --disable-content-trust # Docker-specific NOOP option + --dns: text # Custom DNS servers or 'none' + --dns-option: text # Custom DNS options + --dns-search: text # Custom DNS search domains + --env: text # Set environment variables for the image + --file(-f): path # Pathname or URL of a Dockerfile + --force-rm # Always remove intermediate containers + --format: words [oci docker] # Image manifest format (default: oci) + --from: text # Override first FROM image + --group-add: groups # Add additional groups to container process + --hooks-dir: text # OCI hooks directory (repeatable) + --http-proxy # Pass through HTTP proxy env vars + --identity-label # Add default identity label + --ignorefile: path # Alternate .dockerignore file path + --iidfile: path # File to write image ID to + --inherit-annotations # Inherit annotations from base image + --inherit-labels # Inherit labels from base image + --ipc: text # IPC namespace ('private', 'host', or path) + --isolation: text # Process isolation type + --jobs: text # Number of parallel build stages + --label: text # Set metadata labels for the image + --layer-label: text # Metadata labels for intermediate images + --layers # Use intermediate layers during build + --logfile: path # Log output to file + --logsplit # Split logfile per platform + --manifest: text # Add image to manifest list + --memory(-m): text # Memory limit (<number>[<unit>]) + --memory-swap: text # Memory + swap limit + --network: by "nu-complete podman networks" # Network mode or namespace + --no-cache # Do not use cached images + --no-hostname # Do not create /etc/hostname + --no-hosts # Do not create /etc/hosts + --omit-history # Omit build history from image + --os: text # Override target OS (default: linux) + --os-feature: text # Required OS feature + --os-version: text # Required OS version + --output(-o): text # Output destination (type=local,dest=path) + --pid: text # PID namespace ('private', 'host', or path) + --platform: text # Target platform OS/ARCH[/VARIANT] + --pull: words [always missing never newer true false] # Image pull policy + --quiet(-q) # Suppress build output + --retry: text # Number of push/pull retries + --retry-delay: text # Delay between retries + --rewrite-timestamp # Rewrite layer timestamps + --rm # Remove intermediate containers on success + --runtime-flag: text # Global flags for container runtime + --sbom: text # SBOM preset configuration + --sbom-image-output: text # Add SBOM results to image path + --sbom-image-purl-output: text # Add SBOM purl results to image path + --sbom-merge-strategy: text # Merge SBOM results strategy + --sbom-output: path # Write SBOM results to file + --sbom-purl-output: path # Write SBOM purl results to file + --sbom-scanner-command: text # Scanner command inside scanner image + --sbom-scanner-image: text # Scanner image to use + --secret: text # Secret file exposed to the build + --security-opt: text # Security options + --shm-size: text # Size of /dev/shm + --sign-by: text # Sign image with GPG fingerprint + --skip-unused-stages # Skip unused build stages + --source-date-epoch: text # Set timestamps relative to epoch + --squash # Squash image layers into one + --squash-all # Squash all layers into one + --ssh: text # SSH agent socket or keys + --stdin # Pass stdin into containers + --tag(-t): text # Tag name for the built image + --target: text # Target build stage + --timestamp: text # Set timestamps in image and layers + --tls-verify # Require HTTPS and verify certificates + --ulimit: text # Ulimit options + --unsetannotation: text # Unset inherited annotations + --unsetenv: text # Unset environment variables + --unsetlabel: text # Unset inherited labels + --userns: text # User namespace mode or path + --userns-gid-map: text # GID mapping for user namespace + --userns-gid-map-group: text # Subgid group name + --userns-uid-map: text # UID mapping for user namespace + --userns-uid-map-user: text # Subuid user name + --uts: text # UTS namespace mode or path + --variant: text # Override image variant + --volume(-v): text # Bind mount a volume into container + --help # Print usage +] where { + at-most-one [--squash --squash-all] +} + +export complete [podman image build] [ + context?: path # Build context directory or URL + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --all-platforms # Attempt to build for all base image platforms + --annotation: text # Set metadata for an image + --arch: text # Set the ARCH of the image (default: amd64) + --authfile: path # Path of the authentication file + --build-arg: text # Argument=value to supply to the builder + --build-arg-file: path # Argfile.conf containing argument=value lines + --build-context: text # Additional build context (argument=value) + --cache-from: text # Remote repositories used as cache sources + --cache-to: text # Remote repositories used as cache destinations + --cache-ttl: text # Only consider cache images under this duration + --cap-add: text # Add the specified Linux capability + --cap-drop: text # Drop the specified Linux capability + --cert-dir: dir # Certificates directory for registry access + --cgroup-parent: text # Optional parent cgroup for the container + --cgroupns: words [private host] # Cgroup namespace ('private' or 'host') + --compat-volumes # Preserve VOLUME contents during RUN + --compress # Legacy option, no effect + --cpp-flag: text # Additional flags for the C preprocessor + --cpu-period: text # Limit the CPU CFS period + --cpu-quota: text # Limit the CPU CFS quota + --cpu-shares(-c): text # CPU shares (relative weight) + --cpuset-cpus: text # CPUs allowed to execute (e.g. 0-3, 0,1) + --cpuset-mems: text # NUMA memory nodes to use + --created-annotation # Set image created annotation + --creds: text # Registry credentials [username[:password]] + --cw: text # Confidential workload options + --decryption-key: path # Key needed to decrypt the image + --device: text # Additional devices to provide + --disable-compression(-D) # Do not compress layers by default + --disable-content-trust # Docker-specific NOOP option + --dns: text # Custom DNS servers or 'none' + --dns-option: text # Custom DNS options + --dns-search: text # Custom DNS search domains + --env: text # Set environment variables for the image + --file(-f): path # Pathname or URL of a Dockerfile + --force-rm # Always remove intermediate containers + --format: words [oci docker] # Image manifest format (default: oci) + --from: text # Override first FROM image + --group-add: groups # Add additional groups to container process + --hooks-dir: text # OCI hooks directory (repeatable) + --http-proxy # Pass through HTTP proxy env vars + --identity-label # Add default identity label + --ignorefile: path # Alternate .dockerignore file path + --iidfile: path # File to write image ID to + --inherit-annotations # Inherit annotations from base image + --inherit-labels # Inherit labels from base image + --ipc: text # IPC namespace ('private', 'host', or path) + --isolation: text # Process isolation type + --jobs: text # Number of parallel build stages + --label: text # Set metadata labels for the image + --layer-label: text # Metadata labels for intermediate images + --layers # Use intermediate layers during build + --logfile: path # Log output to file + --logsplit # Split logfile per platform + --manifest: text # Add image to manifest list + --memory(-m): text # Memory limit (<number>[<unit>]) + --memory-swap: text # Memory + swap limit + --network: by "nu-complete podman networks" # Network mode or namespace + --no-cache # Do not use cached images + --no-hostname # Do not create /etc/hostname + --no-hosts # Do not create /etc/hosts + --omit-history # Omit build history from image + --os: text # Override target OS (default: linux) + --os-feature: text # Required OS feature + --os-version: text # Required OS version + --output(-o): text # Output destination (type=local,dest=path) + --pid: text # PID namespace ('private', 'host', or path) + --platform: text # Target platform OS/ARCH[/VARIANT] + --pull: words [always missing never newer true false] # Image pull policy + --quiet(-q) # Suppress build output + --retry: text # Number of push/pull retries + --retry-delay: text # Delay between retries + --rewrite-timestamp # Rewrite layer timestamps + --rm # Remove intermediate containers on success + --runtime-flag: text # Global flags for container runtime + --sbom: text # SBOM preset configuration + --sbom-image-output: text # Add SBOM results to image path + --sbom-image-purl-output: text # Add SBOM purl results to image path + --sbom-merge-strategy: text # Merge SBOM results strategy + --sbom-output: path # Write SBOM results to file + --sbom-purl-output: path # Write SBOM purl results to file + --sbom-scanner-command: text # Scanner command inside scanner image + --sbom-scanner-image: text # Scanner image to use + --secret: text # Secret file exposed to the build + --security-opt: text # Security options + --shm-size: text # Size of /dev/shm + --sign-by: text # Sign image with GPG fingerprint + --skip-unused-stages # Skip unused build stages + --source-date-epoch: text # Set timestamps relative to epoch + --squash # Squash image layers into one + --squash-all # Squash all layers into one + --ssh: text # SSH agent socket or keys + --stdin # Pass stdin into containers + --tag(-t): text # Tag name for the built image + --target: text # Target build stage + --timestamp: text # Set timestamps in image and layers + --tls-verify # Require HTTPS and verify certificates + --ulimit: text # Ulimit options + --unsetannotation: text # Unset inherited annotations + --unsetenv: text # Unset environment variables + --unsetlabel: text # Unset inherited labels + --userns: text # User namespace mode or path + --userns-gid-map: text # GID mapping for user namespace + --userns-gid-map-group: text # Subgid group name + --userns-uid-map: text # UID mapping for user namespace + --userns-uid-map-user: text # Subuid user name + --uts: text # UTS namespace mode or path + --variant: text # Override image variant + --volume(-v): text # Bind mount a volume into container + --help # Print usage +] where { + at-most-one [--squash --squash-all] +} + +export complete [podman buildx build] [ + context?: path # Build context directory or URL + --add-host: text # Add a custom host-to-IP mapping (host:ip) + --all-platforms # Attempt to build for all base image platforms + --annotation: text # Set metadata for an image + --arch: text # Set the ARCH of the image (default: amd64) + --authfile: path # Path of the authentication file + --build-arg: text # Argument=value to supply to the builder + --build-arg-file: path # Argfile.conf containing argument=value lines + --build-context: text # Additional build context (argument=value) + --cache-from: text # Remote repositories used as cache sources + --cache-to: text # Remote repositories used as cache destinations + --cache-ttl: text # Only consider cache images under this duration + --cap-add: text # Add the specified Linux capability + --cap-drop: text # Drop the specified Linux capability + --cert-dir: dir # Certificates directory for registry access + --cgroup-parent: text # Optional parent cgroup for the container + --cgroupns: words [private host] # Cgroup namespace ('private' or 'host') + --compat-volumes # Preserve VOLUME contents during RUN + --compress # Legacy option, no effect + --cpp-flag: text # Additional flags for the C preprocessor + --cpu-period: text # Limit the CPU CFS period + --cpu-quota: text # Limit the CPU CFS quota + --cpu-shares(-c): text # CPU shares (relative weight) + --cpuset-cpus: text # CPUs allowed to execute (e.g. 0-3, 0,1) + --cpuset-mems: text # NUMA memory nodes to use + --created-annotation # Set image created annotation + --creds: text # Registry credentials [username[:password]] + --cw: text # Confidential workload options + --decryption-key: path # Key needed to decrypt the image + --device: text # Additional devices to provide + --disable-compression(-D) # Do not compress layers by default + --disable-content-trust # Docker-specific NOOP option + --dns: text # Custom DNS servers or 'none' + --dns-option: text # Custom DNS options + --dns-search: text # Custom DNS search domains + --env: text # Set environment variables for the image + --file(-f): path # Pathname or URL of a Dockerfile + --force-rm # Always remove intermediate containers + --format: words [oci docker] # Image manifest format (default: oci) + --from: text # Override first FROM image + --group-add: groups # Add additional groups to container process + --hooks-dir: text # OCI hooks directory (repeatable) + --http-proxy # Pass through HTTP proxy env vars + --identity-label # Add default identity label + --ignorefile: path # Alternate .dockerignore file path + --iidfile: path # File to write image ID to + --inherit-annotations # Inherit annotations from base image + --inherit-labels # Inherit labels from base image + --ipc: text # IPC namespace ('private', 'host', or path) + --isolation: text # Process isolation type + --jobs: text # Number of parallel build stages + --label: text # Set metadata labels for the image + --layer-label: text # Metadata labels for intermediate images + --layers # Use intermediate layers during build + --logfile: path # Log output to file + --logsplit # Split logfile per platform + --manifest: text # Add image to manifest list + --memory(-m): text # Memory limit (<number>[<unit>]) + --memory-swap: text # Memory + swap limit + --network: by "nu-complete podman networks" # Network mode or namespace + --no-cache # Do not use cached images + --no-hostname # Do not create /etc/hostname + --no-hosts # Do not create /etc/hosts + --omit-history # Omit build history from image + --os: text # Override target OS (default: linux) + --os-feature: text # Required OS feature + --os-version: text # Required OS version + --output(-o): text # Output destination (type=local,dest=path) + --pid: text # PID namespace ('private', 'host', or path) + --platform: text # Target platform OS/ARCH[/VARIANT] + --pull: words [always missing never newer true false] # Image pull policy + --quiet(-q) # Suppress build output + --retry: text # Number of push/pull retries + --retry-delay: text # Delay between retries + --rewrite-timestamp # Rewrite layer timestamps + --rm # Remove intermediate containers on success + --runtime-flag: text # Global flags for container runtime + --sbom: text # SBOM preset configuration + --sbom-image-output: text # Add SBOM results to image path + --sbom-image-purl-output: text # Add SBOM purl results to image path + --sbom-merge-strategy: text # Merge SBOM results strategy + --sbom-output: path # Write SBOM results to file + --sbom-purl-output: path # Write SBOM purl results to file + --sbom-scanner-command: text # Scanner command inside scanner image + --sbom-scanner-image: text # Scanner image to use + --secret: text # Secret file exposed to the build + --security-opt: text # Security options + --shm-size: text # Size of /dev/shm + --sign-by: text # Sign image with GPG fingerprint + --skip-unused-stages # Skip unused build stages + --source-date-epoch: text # Set timestamps relative to epoch + --squash # Squash image layers into one + --squash-all # Squash all layers into one + --ssh: text # SSH agent socket or keys + --stdin # Pass stdin into containers + --tag(-t): text # Tag name for the built image + --target: text # Target build stage + --timestamp: text # Set timestamps in image and layers + --tls-verify # Require HTTPS and verify certificates + --ulimit: text # Ulimit options + --unsetannotation: text # Unset inherited annotations + --unsetenv: text # Unset environment variables + --unsetlabel: text # Unset inherited labels + --userns: text # User namespace mode or path + --userns-gid-map: text # GID mapping for user namespace + --userns-gid-map-group: text # Subgid group name + --userns-uid-map: text # UID mapping for user namespace + --userns-uid-map-user: text # Subuid user name + --uts: text # UTS namespace mode or path + --variant: text # Override image variant + --volume(-v): text # Bind mount a volume into container + --help # Print usage +] where { + at-most-one [--squash --squash-all] +} + +export complete [podman images] [ + repository?: text # Only show images of this repository[:tag] + --all(-a) # Show all images (default hides intermediate images) + --digests # Show digests + --filter(-f): text # Filter output based on conditions provided + --format: text # Change the output format to JSON or a Go template + --history # Display the image name history + --no-trunc # Do not truncate output + --noheading(-n) # Do not print column headings + --quiet(-q) # Display only image IDs + --sort: words [created id repository size tag] # Sort by created, id, repository, size, or tag + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman image ls] [ + repository?: text # Only show images of this repository[:tag] + --all(-a) # Show all images (default hides intermediate images) + --digests # Show digests + --filter(-f): text # Filter output based on conditions provided + --format: text # Change the output format to JSON or a Go template + --history # Display the image name history + --no-trunc # Do not truncate output + --noheading(-n) # Do not print column headings + --quiet(-q) # Display only image IDs + --sort: words [created id repository size tag] # Sort by created, id, repository, size, or tag + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman image list] [ + repository?: text # Only show images of this repository[:tag] + --all(-a) # Show all images (default hides intermediate images) + --digests # Show digests + --filter(-f): text # Filter output based on conditions provided + --format: text # Change the output format to JSON or a Go template + --history # Display the image name history + --no-trunc # Do not truncate output + --noheading(-n) # Do not print column headings + --quiet(-q) # Display only image IDs + --sort: words [created id repository size tag] # Sort by created, id, repository, size, or tag + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman rmi] [ + ...images: by "nu-complete podman images" # The images to remove + --all(-a) # Remove all images + --force(-f) # Force Removal of the image + --ignore(-i) # Ignore errors if a specified image does not exist + --no-prune # Do not remove dangling images + --help(-h) # Print usage +] + +export complete [podman image rm] [ + ...images: by "nu-complete podman images" # The images to remove + --all(-a) # Remove all images + --force(-f) # Force Removal of the image + --ignore(-i) # Ignore errors if a specified image does not exist + --no-prune # Do not remove dangling images + --help(-h) # Print usage +] + +export complete [podman image remove] [ + ...images: by "nu-complete podman images" # The images to remove + --all(-a) # Remove all images + --force(-f) # Force Removal of the image + --ignore(-i) # Ignore errors if a specified image does not exist + --no-prune # Do not remove dangling images + --help(-h) # Print usage +] + +export complete [podman pull] [ + image: by "nu-complete podman images" # NAME[:TAG|@DIGEST] + --all-tags(-a) # All tagged images in the repository will be pulled + --arch: text # Use ARCH instead of the architecture of the machine for choosing images + --authfile: path # Path of the authentication file + --cert-dir: dir # Pathname of a directory containing TLS certificates and keys + --creds: text # Credentials (USERNAME:PASSWORD) to use for authenticating to a registry + --decryption-key: path # Key needed to decrypt the image + --disable-content-trust # This is a Docker specific option and is a NOOP + --os: text # Use OS instead of the running OS for choosing images + --platform: text # Specify the platform for selecting the image + --policy: words [always missing never newer] # Specify a policy for pulling images + --quiet(-q) # Suppress output information when pulling images + --retry: text # Number of times to retry in case of failure when performing pull + --retry-delay: text # Delay between retries in case of pull failures + --tls-verify # Require HTTPS and verify certificates when contacting registries + --variant: text # Use VARIANT instead of the running architecture variant for choosing images + --help(-h) # Print usage +] where { + at-most-one [--platform --arch] + at-most-one [--platform --os] +} + +export complete [podman image pull] [ + image: by "nu-complete podman images" # NAME[:TAG|@DIGEST] + --all-tags(-a) # All tagged images in the repository will be pulled + --arch: text # Use ARCH instead of the architecture of the machine for choosing images + --authfile: path # Path of the authentication file + --cert-dir: dir # Pathname of a directory containing TLS certificates and keys + --creds: text # Credentials (USERNAME:PASSWORD) to use for authenticating to a registry + --decryption-key: path # Key needed to decrypt the image + --disable-content-trust # This is a Docker specific option and is a NOOP + --os: text # Use OS instead of the running OS for choosing images + --platform: text # Specify the platform for selecting the image + --policy: words [always missing never newer] # Specify a policy for pulling images + --quiet(-q) # Suppress output information when pulling images + --retry: text # Number of times to retry in case of failure when performing pull + --retry-delay: text # Delay between retries in case of pull failures + --tls-verify # Require HTTPS and verify certificates when contacting registries + --variant: text # Use VARIANT instead of the running architecture variant for choosing images + --help(-h) # Print usage +] where { + at-most-one [--platform --arch] + at-most-one [--platform --os] +} + +export complete [podman push] [ + image: by "nu-complete podman images" # The image to push + destination?: text # The destination (transport:details), default the image name + --authfile: path # Path of the authentication file + --cert-dir: dir # Path to a directory containing TLS certificates and keys + --compress # Compress tarball image layers when pushing to a directory using the 'dir' transport + --compression-format: words [gzip zstd zstd:chunked] # Compression format to use + --compression-level: text # Compression level to use + --creds: text # Credentials (USERNAME:PASSWORD) to use for authenticating to a registry + --digestfile: path # Write the digest of the pushed image to the specified file + --disable-content-trust # This is a Docker specific option and is a NOOP + --encrypt-layer: text # Layers to encrypt, 0-indexed layer indices with support for negative indexing + --encryption-key: text # Key with the encryption protocol to use to encrypt the image + --force-compression # Use the specified compression algorithm even if the destination contains a differently-compressed variant already + --format(-f): words [oci v2s1 v2s2] # Manifest type to use when pushing to a registry + --quiet(-q) # Suppress output information when pushing images + --remove-signatures # Discard any pre-existing signatures in the image + --retry: text # Number of times to retry in case of failure when performing push + --retry-delay: text # Delay between retries in case of push failures + --sign-by: text # Add a signature at the destination using the specified key + --sign-by-sq-fingerprint: text # Sign the image using a Sequoia-PGP key with the specified FINGERPRINT + --sign-by-sigstore: path # Sign the image using a sigstore parameter file at PATH + --sign-by-sigstore-private-key: path # Sign the image using a sigstore private key at PATH + --sign-passphrase-file: path # Read a passphrase for signing an image from PATH + --tls-verify # Require HTTPS and verify certificates when contacting registries + --help(-h) # Print usage +] + +export complete [podman image push] [ + image: by "nu-complete podman images" # The image to push + destination?: text # The destination (transport:details), default the image name + --authfile: path # Path of the authentication file + --cert-dir: dir # Path to a directory containing TLS certificates and keys + --compress # Compress tarball image layers when pushing to a directory using the 'dir' transport + --compression-format: words [gzip zstd zstd:chunked] # Compression format to use + --compression-level: text # Compression level to use + --creds: text # Credentials (USERNAME:PASSWORD) to use for authenticating to a registry + --digestfile: path # Write the digest of the pushed image to the specified file + --disable-content-trust # This is a Docker specific option and is a NOOP + --encrypt-layer: text # Layers to encrypt, 0-indexed layer indices with support for negative indexing + --encryption-key: text # Key with the encryption protocol to use to encrypt the image + --force-compression # Use the specified compression algorithm even if the destination contains a differently-compressed variant already + --format(-f): words [oci v2s1 v2s2] # Manifest type to use when pushing to a registry + --quiet(-q) # Suppress output information when pushing images + --remove-signatures # Discard any pre-existing signatures in the image + --retry: text # Number of times to retry in case of failure when performing push + --retry-delay: text # Delay between retries in case of push failures + --sign-by: text # Add a signature at the destination using the specified key + --sign-by-sq-fingerprint: text # Sign the image using a Sequoia-PGP key with the specified FINGERPRINT + --sign-by-sigstore: path # Sign the image using a sigstore parameter file at PATH + --sign-by-sigstore-private-key: path # Sign the image using a sigstore private key at PATH + --sign-passphrase-file: path # Read a passphrase for signing an image from PATH + --tls-verify # Require HTTPS and verify certificates when contacting registries + --help(-h) # Print usage +] + +export complete [podman tag] [ + source: by "nu-complete podman images" # The image to tag + ...targets: text # The new names (TARGET_IMAGE[:TAG]) + --help(-h) # Print usage +] + +export complete [podman image tag] [ + source: by "nu-complete podman images" # The image to tag + ...targets: text # The new names (TARGET_IMAGE[:TAG]) + --help(-h) # Print usage +] + +export complete [podman save] [ + ...images: by "nu-complete podman images" # The images to save + --compress # Compress tarball image layers when saving to a directory using the 'dir' transport + --format: words [docker-archive oci-archive oci-dir docker-dir] # Save image to the given format + --multi-image-archive(-m) # Interpret additional arguments as images not tags and create a multi-image-archive + --output(-o): path # Write to a specified file (default: stdout, which must be redirected) + --quiet(-q) # Suppress the output + --uncompressed # Accept uncompressed layers when copying OCI images + --help(-h) # Print usage +] + +export complete [podman image save] [ + ...images: by "nu-complete podman images" # The images to save + --compress # Compress tarball image layers when saving to a directory using the 'dir' transport + --format: words [docker-archive oci-archive oci-dir docker-dir] # Save image to the given format + --multi-image-archive(-m) # Interpret additional arguments as images not tags and create a multi-image-archive + --output(-o): path # Write to a specified file (default: stdout, which must be redirected) + --quiet(-q) # Suppress the output + --uncompressed # Accept uncompressed layers when copying OCI images + --help(-h) # Print usage +] + +export complete [podman load] [ + --input(-i): path # Read from specified archive file (default: stdin) + --quiet(-q) # Suppress the output + --help(-h) # Print usage +] + +export complete [podman image load] [ + --input(-i): path # Read from specified archive file (default: stdin) + --quiet(-q) # Suppress the output + --help(-h) # Print usage +] + +export complete [podman history] [ + image: by "nu-complete podman images" # The image + --format: text # Change the output to JSON or a Go template + --human(-H) # Display sizes and dates in human readable format + --no-trunc # Do not truncate the output + --quiet(-q) # Display the numeric IDs only + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman image history] [ + image: by "nu-complete podman images" # The image + --format: text # Change the output to JSON or a Go template + --human(-H) # Display sizes and dates in human readable format + --no-trunc # Do not truncate the output + --quiet(-q) # Display the numeric IDs only + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman image inspect] [ + ...images: by "nu-complete podman images" # The images to inspect + --format(-f): text # Format the output to a Go template or json + --help(-h) # Print usage ] -# Displays the low-level information of an image identified by name or ID. -export extern "podman image inspect" [ - image: string@"nu-complete podman images" - --format: string #Format the output to a Go template or json (default "json") +export complete [podman image exists] [ + image: by "nu-complete podman images" # The image + --help(-h) # Print usage ] -# List images in local storage -export extern "podman image list" [ - --all #Show all images (default hides intermediate images) - --digests #Show digests - --filter(-f): string #Filter output based on conditions provided (default []) - --format: string #Change the output format to JSON or a Go template - --history #Display the image name history - --no-trunc #Do not truncate output - --noheading(-n) #Do not print column headings - --quiet(-q) #Display only image IDs - --sort: string #Sort by created, id, repository, size, tag (default created) +# Inspect changes to an image's file systems +export complete [podman image diff] [ + image: by "nu-complete podman images" # The image + image2?: by "nu-complete podman images" # A second image to compare against + --format: words [json] # Change the output format + --help(-h) # Print usage ] -# Load image(s) from a tar archive -export extern "podman image load" [ - --input(-i): string #Read from specified archive file (default: stdin) - --quiet(-q) #Display only image IDs +# Import a tarball to create a filesystem image +export complete [podman image import] [ + path: path # The tarball (or URL) to import + reference?: text # The name for the new image + --arch: text # Set the architecture of the imported image + --change(-c): text # Apply an instruction to the created image (CMD, ENTRYPOINT, ENV, EXPOSE, LABEL, ONBUILD, STOPSIGNAL, USER, VOLUME, WORKDIR) + --message(-m): text # Set commit message for the imported image + --os: text # Set the OS of the imported image + --quiet(-q) # Suppress output + --variant: text # Set the variant of the imported image + --help(-h) # Print usage ] # Mount an image's root filesystem -export extern "podman image mount" [ - image?: string@"nu-complete podman images" - --all(-a) #Mount all images - --format: string #Print the mounted images in specified format (json) -] - -# Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE -export extern "podman image tag" [ - source?: string@"nu-complete podman images" - target?: string@"nu-complete podman images" -] - -# Download an image from a registry -export extern "podman image pull" [ - image?: string@"nu-complete podman images" - --all-tags(-a) #All tagged images in the repository will be pulled - --arch: string #Use ARCH instead of the host architecture for choosing images - --authfile: string #Path of the authentication file (REGISTRY_AUTH_FILE overrides) - --cert-dir: string #Directory containing TLS certificates and keys - --creds: string #Credentials (USERNAME:PASSWORD) for registry authentication - --decryption-key: string #Key needed to decrypt the image (e.g. /path/to/key.pem) - --disable-content-trust #Docker-specific option; NOOP - --os: string #Use OS instead of the running OS for choosing images - --platform: string #Specify platform for selecting the image (conflicts with arch and os) - --policy: string #Pull image policy ("always"|"missing"|"never"|"newer") - --quiet(-q) #Suppress output information when pulling images - --retry: int #Number of pull retries (default 3) - --retry-delay: string #Delay between retries on pull failure - --tls-verify #Require HTTPS and verify certificates - --variant: string #Use VARIANT instead of the running architecture variant -] - -# Upload an image to a registry -export extern "podman image push" [ - image?: string@"nu-complete podman images" - --authfile: string #Path of the authentication file (REGISTRY_AUTH_FILE overrides) - --cert-dir: string #Path to a directory containing TLS certificates and keys - --compress #Compress tarball image layers when pushing to a directory using the 'dir' transport - --compression-format: string #Compression format to use (default: gzip) - --compression-level: int #Compression level to use - --creds: string #Credentials (USERNAME:PASSWORD) for registry authentication - --digestfile: string #Write the digest of the pushed image to the specified file - --disable-content-trust #Docker-specific option; NOOP - --encrypt-layer: string #Layers to encrypt (0-indexed, supports negative indices) - --encryption-key: string #Encryption key and protocol (e.g. jwe:/path/to/key.pem) - --force-compression #Force specified compression even if destination differs - --format(-f): string #Manifest type (oci, v2s2, v2s1) - --quiet(-q) #Suppress output information when pushing images - --remove-signatures #Discard any pre-existing image signatures - --retry: int #Number of push retries (default: 3) - --retry-delay: string #Delay between retries on push failure - --sign-by: string #Sign image using the specified key - --sign-by-sigstore: string #Sign image using a sigstore parameter file - --sign-by-sigstore-private-key: string #Sign image using a sigstore private key - --sign-by-sq-fingerprint: string #Sign image using a Sequoia-PGP key fingerprint - --sign-passphrase-file: string #Read signing passphrase from file - --tls-verify #Require HTTPS and verify certificates -] - -# Save one or more images to a tar archive (streamed to STDOUT by default) -export extern "podman image save" [ - image?: string@"nu-complete podman images" - --compress #Compress tarball image layers when saving to a directory using the 'dir' transport. (default is same compression type as source) - --format: string #Save image to oci-archive, oci-dir (directory with oci manifest type), docker-archive, docker-dir (directory with v2s2 manifest type) (default "docker-archive") - --multi-image-archive(-m) #Interpret additional arguments as images not tags and create a multi-image-archive (only for docker-archive) - --quiet(-q) #Suppress output - --output(-o): string #Write to a file, instead of STDOUT - --uncompressed #Accept uncompressed layers when copying OCI images -] - -# Delete one or more podman image -export extern "podman image rm" [ - ...image: string@"nu-complete podman images" - --all(-a) #Remove all images - --force(-f) #Force removal of the image - --ignore(-i) #Ignore errors if a specified image does not exist - --no-prune #Do not delete untagged parents -] - -# Tear down entire stack -export extern "podman compose down" [ - --dry-run #Execute command in dry run mode - --remove-orphans #Remove containers for services not defined in the Compose file - --rmi: string@"nu-complete podman remove image" #Remove images used by services. "local" remove only images that don't have a custom tag ("local"|"all") - --timeout(-t): int #Specify a shutdown timeout in seconds - --volumes(-v) #Remove named volumes declared in the "volumes" section of the Compose file and anonymous volumes attached to containers -] - -# Show status of containers -export extern "podman compose ps" [ - --all(-a) #Show all stopped containers (including those created by the run command) - --dry-run #Execute command in dry run mode - --filter: string #Filter services by a property (supported filters: status) - --format: string #Format output using a custom template: 'table': Print output in table; format with column headers (default) 'table TEMPLATE': Print output in table; format using the given Go template 'json': Print in JSON format; 'TEMPLATE': Print output using the given Go template; Refer to https://docs.podman.com/go/formatting/ for more information about formatting output with templates (default "table") - --no-truncate #Don't truncate output - --orphans #Include orphaned services (not declared by project) (default true) - --quite(-q) #Only display IDs - --services #Display services - --status: string@"nu-complete podman compose service status" #Filter services by status. Values: [paused | restarting | removing | running | dead | created | exited] -] - -# Stop specific services -export extern "podman compose stop" [ - --timeout(-t): int #Specify a shutdown timeout in seconds -] - -# Restart service containers -export extern "podman compose restart" [ - --dry-run #Execute command in dry run mode - --no-deps #Don't restart dependent services - --timeout(-t): int #Specify a shutdown timeout in seconds -] - -# Create and start containers -export extern "podman compose up" [ - --help(-h) #Show this help message and exit - --detach(-d) #Detached mode: run container in background; incompatible with --abort-on-container-exit and --abort-on-container-failure - --no-color #Produce monochrome output - --quiet-pull #Pull without printing progress information - --no-deps #Don't start linked services - --force-recreate #Recreate containers even if configuration and image haven't changed - --always-recreate-deps #Recreate dependent containers; incompatible with --no-recreate - --no-recreate #If containers exist, don't recreate; incompatible with --force-recreate and -V - --no-build #Don't build an image even if missing - --no-start #Don't start services after creation - --build #Build images before starting containers - --abort-on-container-exit #Stop all containers if any container stopped; incompatible with -d and --abort-on-container-failure - --abort-on-container-failure #Stop all containers if any container stops with non-zero exit; incompatible with -d and --abort-on-container-exit - --timeout(-t): int #Timeout in seconds for container shutdown (default: 10) - --renew-anon-volumes(-V) #Recreate anonymous volumes instead of using previous container data - --remove-orphans #Remove containers for services not defined in Compose file - --scale: string #Scale SERVICE to NUM instances; overrides Compose file scale setting - --exit-code-from: string #Return exit code of selected service container; implies --abort-on-container-exit - --pull #Attempt to pull a newer version of the image - --pull-always #Attempt to pull newer image; raise error even if image exists locally - --build-arg: string #Set build-time variables for services - --no-cache #Do not use cache when building the image -] - -export extern "podman compose" [ - command?: string@"nu-complete podman compose subcommands" - --help(-h) # Show this help message and exit - --version(-v) # Show version - --in-pod: string # Specify pod usage ('true', 'false', or custom pod name) - --pod-args: string # Custom arguments to be passed to `podman pod` - --env-file: string # Specify an alternate environment file - --file(-f): string # Specify a compose file (default: docker-compose.yml) or '-' to read from stdin - --profile: string # Specify a profile to enable - --project-name(-p): string # Specify an alternate project name (default: directory name) - --podman-path: string # Specify an alternate path to podman (default: use location in $PATH) - --podman-args: string # Custom global arguments to be passed to `podman` - --podman-pull-args: string # Custom arguments to be passed to `podman pull` - --podman-push-args: string # Custom arguments to be passed to `podman push` - --podman-build-args: string # Custom arguments to be passed to `podman build` - --podman-inspect-args: string # Custom arguments to be passed to `podman inspect` - --podman-run-args: string # Custom arguments to be passed to `podman run` - --podman-start-args: string # Custom arguments to be passed to `podman start` - --podman-stop-args: string # Custom arguments to be passed to `podman stop` - --podman-rm-args: string # Custom arguments to be passed to `podman rm` - --podman-volume-args: string # Custom arguments to be passed to `podman volume` - --no-ansi # Do not print ANSI control characters - --no-cleanup # Do not stop and remove existing pod & containers - --dry-run # No action; perform a simulation of commands - --parallel: string # Number of parallel operations - --verbose # Print debugging output -] - -# An open-source container management platform. -export extern "podman" [ - command?: string@"nu-complete podman subcommands" #Subcommands - --cdi-spec-dir: string #Set the CDI spec directory path (may be set multiple times) (default [/etc/cdi,/var/run/cdi]) - --cgroup-manager: string #Cgroup manager to use ("cgroupfs"|"systemd") (default "systemd") - --config: path #Location of client config files (default "/root/.podman") - --conmon: path #Path of the conmon binary - --connection(-c): string #Connection to use for remote Podman service (CONTAINER_CONNECTION) - --events-backend: string #Events backend to use ("file"|"journald"|"none") (default "journald") - --hooks-dir: string #Set the OCI hooks directory path (may be set multiple times) (default [/usr/share/containers/oci/hooks.d]) - --identity: string #path to SSH identity file, (CONTAINER_SSHKEY) - --imagestore: string #Path to the 'image store', different from 'graph root', use this to split storing the image into a separate 'image store', see 'man containers-storage.conf' for details - --log-level: string #Log messages above specified level (trace, debug, info, warn, warning, error, fatal, panic) (default "warn") - --module: string #Load the containers.conf(5) module - --network-cmd-path: string #Path to the command for configuring the network - --network-config-dir: string #Path of the configuration directory for networks - --out: string #Send output (stdout) from podman to a file - --remote(-r) #Access remote Podman service - --root: string #Path to the graph root directory where images, containers, etc. are stored - --runroot: string #Path to the 'run directory' where all state information is stored - --runtime: string #Path to the OCI-compatible binary used to run containers. (default "runc") - --runtime-flag: string #Add global flags for the container runtime - --ssh: string #Define the ssh mode (default "golang") - --storage-driver: string #Select which storage driver is used to manage storage of images and containers - --storage-opt: string #Used to pass an option to the storage driver - --syslog #Output podman-internal logs to syslog as well as the console (default false) - --tls-ca: string #Trust certs signed only by this CA - --tls-cert: string #Path to TLS certificate file - --tls-key: string #Path to TLS key file - --tmpdir: string #Path to the tmp directory for libpod state content. - --transient-store #Enable transient container storage - --url: string #URL to access Podman service (CONTAINER_HOST) (default "unix:///run/user/1000/podman/podman.sock") - --version(-v) #Print version information and quit - --volumepath: string #Path to the volume directory in which volume data is stored -] - -# Attach local standard input, output, and error streams to a running container -export alias "podman attach" = podman container attach -# Create a new image from a container's changes -export alias "podman commit" = podman container commit -export alias "podman cp" = podman container cp -# Create a new container -export alias "podman create" = podman container create -# Inspect changes to files or directories on a container's filesystem -export alias "podman diff" = podman container diff -# Execute a command in a running container -export alias "podman exec" = podman container exec -# Export a container's filesystem as a tar archive -export alias "podman export" = podman container export -# Display detailed information on one or more containers -export alias "podman inspect" = podman container inspect -# Kill one or more running containers -export alias "podman kill" = podman container kill -# Fetch the logs of a container -export alias "podman logs" = podman container logs -# Pause all processes within one or more containers -export alias "podman pause" = podman container pause -# List port mappings or a specific mapping for the container -export alias "podman port" = podman container port -# Rename a container -export alias "podman rename" = podman container rename -# Restart one or more containers -export alias "podman restart" = podman container restart -# List containers -export alias "podman ps" = podman container ls -# Remove one or more containers -export alias "podman rm" = podman container rm -# Run a command in a new container -export alias "podman run" = podman container run -# Start one or more stopped containers -export alias "podman start" = podman container start -# Display a live stream of container(s) resource usage statistics -export alias "podman stats" = podman container stats -# Stop one or more running containers -export alias "podman stop" = podman container stop -# Display the running processes of a container -export alias "podman top" = podman container top -# Unpause all processes within one or more containers -export alias "podman unpause" = podman container unpause -# Update configuration of one or more containers -export alias "podman update" = podman container update -# Block until one or more containers stop, then print their exit codes -export alias "podman wait" = podman container wait - -# Build an image from a Podmanfile -export alias "podman build" = podman image build -# Show the history of an image -export alias "podman history" = podman image history -# Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE -export alias "podman tag" = podman image tag -# List images -export alias "podman images" = podman image ls -# Remove one or more images -export alias "podman rmi" = podman image rm -# Download an image from a registry -export alias "podman pull" = podman image pull -# Upload an image to a registry -export alias "podman push" = podman image push -# Save one or more images to a tar archive (streamed to STDOUT by default) -export alias "podman save" = podman image save - -# Inspect changes to files or directories on a container's filesystem -export alias "podman events" = podman system events +export complete [podman image mount] [ + ...images: by "nu-complete podman images" # The images to mount + --all(-a) # Mount all images + --format: words [json] # Print the mounted images in the specified format + --help(-h) # Print usage +] + +export complete [podman image prune] [ + --all(-a) # Remove all images not in use by containers, not just dangling ones + --build-cache # Remove persistent build cache created by --mount=type=cache + --external # Remove images even when they are used by external containers (e.g., by build containers) + --filter: text # Provide filter values (e.g. 'label=<key>=<value>') + --force(-f) # Do not prompt for confirmation + --help(-h) # Print usage +] + +export complete [podman search] [ + term: text # The search term (registry/term) + --authfile: path # Path of the authentication file + --cert-dir: dir # Path to a directory containing TLS certificates and keys + --compatible # List stars, official and automated columns (Docker compatibility) + --creds: text # Credentials (USERNAME:PASSWORD) to use for authenticating to a registry + --filter(-f): text # Filter output based on conditions provided + --format: text # Change the output format to JSON or a Go template + --limit: text # Limit the number of results + --list-tags # List the tags of the input registry + --no-trunc # Do not truncate the output + --tls-verify # Require HTTPS and verify certificates when contacting registries + --help(-h) # Print usage +] + +# --- Registry, version ------------------------------------------------------------ + +export complete [podman login] [ + registry?: hosts # The registry + --authfile: path # Path of the authentication file + --cert-dir: dir # Use certificates at the specified path to access the registry + --compat-auth-file: path # Path of a Docker-compatible config file to update instead + --get-login # Return the current login user for the registry + --password(-p): text # Password for registry + --password-stdin # Take the password from stdin + --secret: text # Retrieve password from a podman secret + --tls-verify # Require HTTPS and verify certificates when contacting registries + --username(-u): text # Username for registry + --verbose(-v) # Write more detailed information to stdout + --help(-h) # Print usage +] where { + excludes --password --password-stdin +} + +export complete [podman logout] [ + registry?: hosts # The registry + --all(-a) # Remove the cached credentials for all registries in the auth file + --authfile: path # Path of the authentication file + --compat-auth-file: path # Path of a Docker-compatible config file to update instead + --help(-h) # Print usage +] + +export complete [podman version] [ + --format(-f): text # Change the output format to JSON or a Go template + --help(-h) # Print usage +] + +export complete [podman info] [ + --format(-f): text # Change the output format to JSON or a Go template + --help(-h) # Print usage +] + +export complete [podman system info] [ + --format(-f): text # Change the output format to JSON or a Go template + --help(-h) # Print usage +] + +# --- Compose ---------------------------------------------------------------------- + +export complete [podman compose] [ + --dry-run # Execute command in dry run mode + --in-pod: text # podman-compose: pod usage ('true', 'false', or a custom pod name) + --pod-args: text # podman-compose: custom arguments passed to `podman pod` + --podman-path: path # podman-compose: alternate path to podman (default: the one in $PATH) + --podman-args: text # podman-compose: custom global arguments passed to `podman` + --podman-pull-args: text # podman-compose: custom arguments passed to `podman pull` + --podman-push-args: text # podman-compose: custom arguments passed to `podman push` + --podman-build-args: text # podman-compose: custom arguments passed to `podman build` + --podman-inspect-args: text # podman-compose: custom arguments passed to `podman inspect` + --podman-run-args: text # podman-compose: custom arguments passed to `podman run` + --podman-start-args: text # podman-compose: custom arguments passed to `podman start` + --podman-stop-args: text # podman-compose: custom arguments passed to `podman stop` + --podman-rm-args: text # podman-compose: custom arguments passed to `podman rm` + --podman-volume-args: text # podman-compose: custom arguments passed to `podman volume` + --no-ansi # podman-compose: do not print ANSI control characters + --no-cleanup # podman-compose: do not stop and remove existing pod and containers + --parallel: text # podman-compose: number of parallel operations + --verbose # podman-compose: print debugging output + --version(-v) # Show the compose provider's version + --env-file: path # Specify an alternate environment file + --file(-f): path # Compose configuration files + --profile: text # Specify a profile to enable + --project-directory: dir # Specify an alternate working directory + --project-name(-p): text # Project name + --help(-h) # Print usage +] + +export complete [podman compose up] [ + ...services: by "nu-complete podman compose services" # The services to start + --abort-on-container-exit # Stops all containers if any container was stopped + --abort-on-container-failure # Stops all containers if any container stops with a non-zero exit code + --always-recreate-deps # Recreate dependent containers + --build # Build images before starting containers + --build-arg: text # podman-compose: set build-time variables for services + --detach(-d) # Detached mode: Run containers in the background + --exit-code-from: by "nu-complete podman compose services" # Return the exit code of the selected service container + --force-recreate # Recreate containers even if their configuration and image haven't changed + --no-build # Don't build an image, even if it's missing + --no-cache # podman-compose: do not use cache when building the image + --no-color # Produce monochrome output + --no-deps # Don't start linked services + --no-log-prefix # Don't print prefix in logs + --no-recreate # If containers already exist, don't recreate them + --no-start # Don't start the services after creating them + --pull: words [always missing never] # Pull image before running + --pull-always # podman-compose: attempt to pull a newer image, failing even if it exists locally + --quiet-pull # Pull without printing progress information + --remove-orphans # Remove containers for services not defined in the Compose file + --renew-anon-volumes(-V) # Recreate anonymous volumes instead of retrieving data from the previous containers + --scale: text # Scale SERVICE to NUM instances (SERVICE=NUM) + --timeout(-t): text # Use this timeout in seconds for container shutdown + --timestamps # Show timestamps + --wait # Wait for services to be running|healthy. Implies detached mode + --help(-h) # Print usage + --dry-run # Execute command in dry run mode +] where { + at-most-one [--detach --abort-on-container-exit] + at-most-one [--no-build --build] + at-most-one [--force-recreate --no-recreate] +} + +export complete [podman compose down] [ + ...services: by "nu-complete podman compose services" # The services to stop and remove + --remove-orphans # Remove containers for services not defined in the Compose file + --rmi: words [all local] # Remove images used by services + --timeout(-t): text # Specify a shutdown timeout in seconds + --volumes(-v) # Remove named volumes declared in the "volumes" section and anonymous volumes + --help(-h) # Print usage + --dry-run # Execute command in dry run mode +] + +export complete [podman compose ps] [ + ...services: by "nu-complete podman compose services" # The services to list + --all(-a) # Show all stopped containers + --filter: text # Filter services by a property + --format: text # Format output using a custom template + --no-trunc # Don't truncate output + --orphans # Include orphaned services (not declared by project) (default true) + --quiet(-q) # Only display IDs + --services # Display services + --status: words [paused restarting removing running dead created exited] # Filter services by status + --help(-h) # Print usage + --dry-run # Execute command in dry run mode +] where { + at-most-one [--quiet --format] +} + +export complete [podman compose logs] [ + ...services: by "nu-complete podman compose services" # The services whose logs to show + --follow(-f) # Follow log output + --no-color # Produce monochrome output + --no-log-prefix # Don't print prefix in logs + --since: text # Show logs since timestamp or relative (e.g. 42m) + --tail(-n): text # Number of lines to show from the end of the logs for each container + --timestamps(-t) # Show timestamps + --until: text # Show logs before a timestamp or relative time + --help(-h) # Print usage +] + +export complete [podman compose build] [ + ...services: by "nu-complete podman compose services" # The services to build + --build-arg: text # Set build-time variables for services + --no-cache # Do not use cache when building the image + --pull # Always attempt to pull a newer version of the image + --push # Push service images + --quiet(-q) # Don't print anything to STDOUT + --help(-h) # Print usage +] + +export complete [podman compose exec] [ + service: by "nu-complete podman compose services" # The service + ...command: command # The command to run, and its arguments + --detach(-d) # Detached mode: Run command in the background + --env(-e): env-assign # Set environment variables + --index: text # Index of the container if service has multiple replicas + --no-TTY(-T) # Disable pseudo-TTY allocation + --privileged # Give extended privileges to the process + --user(-u): users # Run the command as this user + --workdir(-w): text # Path to workdir directory for this command + --help(-h) # Print usage +] + +export complete [podman compose run] [ + service: by "nu-complete podman compose services" # The service + ...command: command # The command to run, and its arguments + --build # Build image before starting container + --detach(-d) # Run container in background and print container ID + --entrypoint: text # Override the entrypoint of the image + --env(-e): env-assign # Set environment variables + --interactive(-i) # Keep STDIN open even if not attached + --label(-l): text # Add or override a label + --name: text # Assign a name to the container + --no-TTY(-T) # Disable pseudo-TTY allocation + --no-deps # Don't start linked services + --publish(-p): podman.port with { root.proto: by "nu-complete podman protocols" } # Publish a container's port(s) to the host + --remove-orphans # Remove containers for services not defined in the Compose file + --rm # Automatically remove the container when it exits + --service-ports # Run command with all service's ports enabled and mapped to the host + --use-aliases # Use the service's network aliases in the network(s) the container connects to + --user(-u): users # Run as specified username or uid + --volume(-v): text # Bind mount a volume + --workdir(-w): text # Working directory inside the container + --help(-h) # Print usage +] + +export complete [podman compose pull] [ + ...services: by "nu-complete podman compose services" # The services to pull + --ignore-pull-failures # Pull what it can and ignores images with pull failures + --include-deps # Also pull services declared as dependencies + --quiet(-q) # Pull without printing progress information + --help(-h) # Print usage +] + +export complete [podman compose restart] [ + ...services: by "nu-complete podman compose services" # The services to restart + --no-deps # Don't restart dependent services + --timeout(-t): text # Specify a shutdown timeout in seconds + --help(-h) # Print usage + --dry-run # Execute command in dry run mode +] + +export complete [podman compose stop] [ + ...services: by "nu-complete podman compose services" # The services to stop + --timeout(-t): text # Specify a shutdown timeout in seconds + --help(-h) # Print usage + --dry-run # Execute command in dry run mode +] + +export complete [podman compose start] [ + ...services: by "nu-complete podman compose services" # The services to start + --help(-h) # Print usage +] + +# --- Networks --------------------------------------------------------------------- + +export complete [podman network create] [ + name?: text # The name of the new network + --disable-dns # Disable dns plugin + --dns: text # DNS servers this network will use + --driver(-d): words [bridge macvlan ipvlan] # Driver to manage the network + --gateway: text # IPv4 or IPv6 gateway for the subnet + --ignore # Don't fail if network already exists + --interface-name: text # Interface name which is used by the driver + --internal # Restrict external access from this network + --ip-range: text # Allocate container IP from range + --ipam-driver: words [host-local dhcp none] # IP Address Management Driver + --ipv6 # Enable IPv6 networking + --label: text # Set metadata on a network + --opt(-o): text # Set driver specific options + --route: text # Static routes + --subnet: text # Subnets in CIDR format + --help(-h) # Print usage +] + +export complete [podman network ls] [ + --filter(-f): text # Provide filter values (e.g. 'name=podman') + --format: text # Pretty-print networks to JSON or using a Go template + --no-trunc # Display the full network ID + --noheading # Do not print headers + --quiet(-q) # Display only names + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman network list] [ + --filter(-f): text # Provide filter values (e.g. 'name=podman') + --format: text # Pretty-print networks to JSON or using a Go template + --no-trunc # Display the full network ID + --noheading # Do not print headers + --quiet(-q) # Display only names + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman network rm] [ + ...networks: by "nu-complete podman networks" # The networks to remove + --force(-f) # Remove any containers using network + --time(-t): text # Seconds to wait for running containers to stop before killing the container + --help(-h) # Print usage +] + +export complete [podman network remove] [ + ...networks: by "nu-complete podman networks" # The networks to remove + --force(-f) # Remove any containers using network + --time(-t): text # Seconds to wait for running containers to stop before killing the container + --help(-h) # Print usage +] + +export complete [podman network inspect] [ + ...networks: by "nu-complete podman networks" # The networks to inspect + --format(-f): text # Pretty-print network to JSON or using a Go template + --help(-h) # Print usage +] + +export complete [podman network connect] [ + network: by "nu-complete podman networks" # The network + container: by "nu-complete podman all-containers" # The container to connect + --alias: text # Network scoped alias for container + --ip: text # Set a static ipv4 address for this container network + --ip6: text # Set a static ipv6 address for this container network + --mac-address: text # Set a static mac address for this container network + --help(-h) # Print usage +] + +export complete [podman network disconnect] [ + network: by "nu-complete podman networks" # The network + container: by "nu-complete podman all-containers" # The container to disconnect + --force(-f) # Force removal of container from network + --help(-h) # Print usage +] + +export complete [podman network exists] [ + network: by "nu-complete podman networks" # The network + --help(-h) # Print usage +] + +export complete [podman network prune] [ + --filter: text # Provide filter values (e.g. 'label=<key>=<value>') + --force(-f) # Do not prompt for confirmation + --help(-h) # Print usage +] + +# --- Volumes ---------------------------------------------------------------------- + +export complete [podman volume create] [ + name?: text # The name of the new volume + --driver(-d): text # Specify volume driver name + --gid: text # Set a GID for the volume + --ignore # Don't fail if volume already exists + --label(-l): text # Set metadata for a volume + --opt(-o): text # Set driver specific options + --uid: text # Set a UID for the volume + --help(-h) # Print usage +] + +export complete [podman volume ls] [ + --filter(-f): text # Filter volume output + --format: text # Format volume output using JSON or a Go template + --noheading(-n) # Do not print headers + --quiet(-q) # Print volume output in quiet mode + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman volume list] [ + --filter(-f): text # Filter volume output + --format: text # Format volume output using JSON or a Go template + --noheading(-n) # Do not print headers + --quiet(-q) # Print volume output in quiet mode + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman volume rm] [ + ...volumes: by "nu-complete podman volumes" # The volumes to remove + --all(-a) # Remove all volumes + --force(-f) # Remove a volume by force, even if it is being used by a container + --time(-t): text # Seconds to wait for running containers to stop before killing the container + --help(-h) # Print usage +] + +export complete [podman volume remove] [ + ...volumes: by "nu-complete podman volumes" # The volumes to remove + --all(-a) # Remove all volumes + --force(-f) # Remove a volume by force, even if it is being used by a container + --time(-t): text # Seconds to wait for running containers to stop before killing the container + --help(-h) # Print usage +] + +export complete [podman volume inspect] [ + ...volumes: by "nu-complete podman volumes" # The volumes to inspect + --all(-a) # Inspect all volumes + --format(-f): text # Format volume output using Go template + --help(-h) # Print usage +] + +export complete [podman volume exists] [ + volume: by "nu-complete podman volumes" # The volume + --help(-h) # Print usage +] + +export complete [podman volume prune] [ + --filter: text # Provide filter values (e.g. 'label=<key>=<value>') + --force(-f) # Do not prompt for confirmation + --help(-h) # Print usage +] + +# --- System ----------------------------------------------------------------------- + +export complete [podman system df] [ + --format: text # Pretty-print images using a Go template + --verbose(-v) # Show detailed information on disk usage + --help(-h) # Print usage +] + +export complete [podman system prune] [ + --all(-a) # Remove all unused data + --build # Remove build containers + --external # Remove container data in storage not controlled by podman + --filter: text # Provide filter values (e.g. 'label=<key>=<value>') + --force(-f) # Do not prompt for confirmation. The default is false + --volumes # Prune volumes + --help(-h) # Print usage +] + +export complete [podman system events] [ + --filter(-f): text # Filter output + --format: text # Format the output using a Go template + --no-trunc # Do not truncate the output + --since: text # Show all events created since timestamp + --stream # Stream new events; for testing only + --until: text # Show all events until timestamp + --help(-h) # Print usage +] + +export complete [podman events] [ + --filter(-f): text # Filter output + --format: text # Format the output using a Go template + --no-trunc # Do not truncate the output + --since: text # Show all events created since timestamp + --stream # Stream new events; for testing only + --until: text # Show all events until timestamp + --help(-h) # Print usage +] + +export complete [podman system connection ls] [ + --format(-f): text # Custom Go template for printing connections + --quiet(-q) # Print only the connection names + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman system connection list] [ + --format(-f): text # Custom Go template for printing connections + --quiet(-q) # Print only the connection names + --help(-h) # Print usage +] where { + at-most-one [--quiet --format] +} + +export complete [podman system connection default] [ + connection: by "nu-complete podman contexts" # The connection to make the default + --help(-h) # Print usage +] + +export complete [podman system connection rm] [ + connection?: by "nu-complete podman contexts" # The connection to remove + --all(-a) # Remove all connections + --help(-h) # Print usage +] + +export complete [podman system connection remove] [ + connection?: by "nu-complete podman contexts" # The connection to remove + --all(-a) # Remove all connections + --help(-h) # Print usage +] diff --git a/custom-completions/poetry/poetry-completions.nu b/custom-completions/poetry/poetry-completions.nu index 02326177f..c5b1e8975 100644 --- a/custom-completions/poetry/poetry-completions.nu +++ b/custom-completions/poetry/poetry-completions.nu @@ -22,7 +22,8 @@ def "nu-complete poetry default-package-source-urls" []: nothing -> list<string> # Default package sources # # The default sources to use to install the package, beyond the ones defined within pyproject.toml available for the add command -def "nu-complete poetry default-package-sources" []: nothing -> list<string> { +@non-destructive +export def "nu-complete poetry default-package-sources" []: nothing -> list<string> { (nu-complete poetry default-package-source-names) | append ( nu-complete poetry default-package-source-urls ) @@ -38,8 +39,11 @@ def "nu-complete poetry build-formats" []: nothing -> list<string> { # Default usernames # # The current username which is the default suggestion for logging in to services with a username -def "nu-complete poetry default-usernames" []: nothing -> list<string> { - [(whoami)] +@non-destructive +export def "nu-complete poetry default-usernames" []: nothing -> list<string> { + try { + [(whoami)] + } catch { [] } } # Setting keys @@ -58,7 +62,7 @@ def "nu-complete poetry setting-keys" []: nothing -> list<string> { virtualenvs.create virtualenvs.in-project virtualenvs.options.always-copy - virtualenvs.optpoeions.no-pip + virtualenvs.options.no-pip virtualenvs.options.no-setuptools virtualenvs.options.system-site-packages virtualenvs.path @@ -87,8 +91,9 @@ def "nu-complete poetry setting-keys" []: nothing -> list<string> { # Setting keys # # The possible values for the given setting key, that the config command can chenge the respective setting key to -def "nu-complete poetry setting-values" [context: string]: nothing -> list<any> { - let $final_context: string = ($context | str trim | split row " " | last) +@non-destructive +export def "nu-complete poetry setting-values" [key?: string]: nothing -> list<any> { + let $final_context: string = $key | default "" if ( $final_context in [ @@ -180,8 +185,22 @@ def "nu-complete poetry export-formats" []: nothing -> list<string> { # Default dependency groups # # A default selection of dependency groups -def "nu-complete poetry default-dependency-groups" []: nothing -> list<string> { - [main dev deploy test testing tests development developing deployment deploying] +@non-destructive +export def "nu-complete poetry default-dependency-groups" [directory?: string]: nothing -> list<any> { + let p = try { open ($directory | default . | path join pyproject.toml) } catch { {} } + let poetry_groups = $p | get -o tool.poetry.group | default {} | columns + let pep735 = $p | get -o dependency-groups | default {} | columns + [main] ++ $poetry_groups ++ $pep735 | uniq +} + +# Dependencies of pyproject.toml (project.dependencies, tool.poetry.dependencies and groups). +@non-destructive +export def "nu-complete poetry dependencies" [directory?: string]: nothing -> list<any> { + let p = try { open ($directory | default . | path join pyproject.toml) } catch { {} } + let pep621 = $p | get -o project.dependencies | default [] | each {|d| $d | parse --regex '^(?<n>[A-Za-z0-9._-]+)' | get 0?.n } | compact + let main = $p | get -o tool.poetry.dependencies | default {} | columns | where $it != python + let groups = $p | get -o tool.poetry.group | default {} | values | each {|g| $g | get -o dependencies | default {} | columns } | flatten + $pep621 ++ $main ++ $groups | uniq } # Commands @@ -233,8 +252,11 @@ def "nu-complete poetry commands" []: nothing -> list<string> { # Licenses # # The available license IDs for project.toml -def "nu-complete poetry licenses" []: nothing -> list<string> { - http get https://spdx.org/licenses/licenses.json | get licenses | get licenseId +@non-destructive +export def "nu-complete poetry licenses" []: nothing -> list<string> { + try { + http get https://spdx.org/licenses/licenses.json | get licenses | get licenseId + } catch { [] } } # ReadMe file formats @@ -254,30 +276,36 @@ def "nu-complete poetry namespaces" []: nothing -> list<string> { # Default repositories # # The default set of repositories available to publish this projects package to -def "nu-complete poetry default-repositories" []: nothing -> list<string> { +@non-destructive +export def "nu-complete poetry default-repositories" []: nothing -> list<string> { nu-complete poetry default-package-sources } # Default dist directories # # The default set of directories where build artifacts may be stored -def "nu-complete poetry default-dist-directories" []: nothing -> list<string> { - ( - ls | get name | where (($it | path type) == "dir") | each {|it| $it | path expand} - ) | prepend ($env.PWD | path join "dist") +@non-destructive +export def "nu-complete poetry default-dist-directories" []: nothing -> list<string> { + try { + ( + ls | get name | where (($it | path type) == "dir") | each {|it| $it | path expand} + ) | prepend ($env.PWD | path join "dist") + } catch { [] } } # Caches # # The list of available poetry caches, used to remove one that is listed -def "nu-complete poetry caches" []: nothing -> list<string> { +@non-destructive +export def "nu-complete poetry caches" []: nothing -> list<string> { poetry cache list | lines } # Virtual environments # # The list of available virtual environements, used to remove one that is listed -def "nu-complete poetry virtual-environments" []: nothing -> list<string> { +@non-destructive +export def "nu-complete poetry virtual-environments" []: nothing -> list<string> { poetry env list --full-path | lines | each {|| (split row " ").0} } @@ -288,674 +316,825 @@ def "nu-complete poetry source-priorities" []: nothing -> list<string> { [default primary secondary supplemental explicit] } -# Python packaging and dependency management made easy. -export extern poetry [ - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Shows information about Poetry. -export extern "poetry about" [ - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Adds a new dependency to pyproject.toml. -export extern "poetry add" [ - ...name: string # The packages to add. - --group(-G): string@"nu-complete poetry default-dependency-groups" # The group to add the dependency to. [default: "main"] - --editable(-e) # Add vcs/path dependencies as editable. - --extras(-E): string # Extras to activate for the dependency. (multiple values allowed) - --optional # Add as an optional dependency. - --python: string@"nu-complete poetry python-versions" # Python version for which the dependency must be installed. - --platform: string # Platforms for which the dependency must be installed. - --source: string@"nu-complete poetry default-package-sources" # Name of the source to use to install the package. - --allow-prereleases # Accept prereleases. - --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). - --lock # Do not perform operations (only update the lockfile). - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Builds a package, as a tarball and a wheel by default. -export extern "poetry build" [ - --format(-f): string@"nu-complete poetry build-formats" # Limit the format to either sdist or wheel. - --output(-o): path # Set output directory for build artifacts. Default is `dist`. [default: "dist"] - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Checks the validity of the pyproject.toml file. -export extern "poetry check" [ - --lock # Checks that poetry.lock exists for the current version of pyproject.toml. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Manages configuration settings. -export extern "poetry config" [ - key?: string@"nu-complete poetry setting-keys" # Setting key. - ...value: any@"nu-complete poetry setting-values" # Setting value. - --list # List configuration settings. - --unset # Unset configuration setting. - --local # Set/Get from the project's local configuration. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Exports the lock file to alternative formats. -export extern "poetry export" [ - --format(-f): string@"nu-complete poetry export-formats" # Format to export to. Currently, only constraints.txt and requirements.txt are supported. [default: "requirements.txt"] - --output(-o): path # The name of the output file. - --without-hashes # Exclude hashes from the exported file. - --without-urls # Exclude source repository urls from the exported file. - --without: string@"nu-complete poetry default-dependency-groups" # The dependency groups to ignore. (multiple values allowed) - --with: string@"nu-complete poetry default-dependency-groups" # The optional dependency groups to include. (multiple values allowed) - --only: string@"nu-complete poetry default-dependency-groups" # The only dependency groups to include. (multiple values allowed) - --extras(-E): string # Extra sets of dependencies to include. (multiple values allowed) - --all-extras # Include all sets of extra dependencies. - --with-credentials # Include credentials for extra indices. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Displays help for a command. -export extern "poetry help" [ - command_name?: string@"nu-complete poetry commands" # The command name. [default: "help"] - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Creates a basic pyproject.toml file in the current directory. -export extern "poetry init" [ - --name: string # Name of the package. - --description: string # Description of the package. - --author: string # Author name of the package. - --python: string@"nu-complete poetry python-versions" # Compatible Python versions. - --dependency: string # Package to require, with an optional version constraint, e.g. requests:^2.10.0 or requests=2.11.1. (multiple values allowed) - --license(-s): string@"nu-complete poetry licenses" # License of the package. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Installs the project dependencies. -export extern "poetry install" [ - --without: string@"nu-complete poetry default-dependency-groups" # The dependency groups to ignore. (multiple values allowed) - --with: string@"nu-complete poetry default-dependency-groups" # The optional dependency groups to include. (multiple values allowed) - --only: string@"nu-complete poetry default-dependency-groups" # The only dependency groups to include. (multiple values allowed) - --sync # Synchronize the environment with the locked packages and the specified groups. - --no-root # Do not install the root package (the current project). - --no-directory # Do not install any directory path dependencies; useful to install dependencies without source code, e.g. for caching of Docker layers). - --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). - --extras(-E): string # Extra sets of dependencies to include. (multiple values allowed) - --all-extras # Install all extra dependencies. - --only-root # Exclude all dependencies. - --compile # Compile Python source files to bytecode. (This option has no effect if modern-installation is disabled because the old installer always compiles.) - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Lists commands. -export extern "poetry list" [ - namespace?: string@"nu-complete poetry namespaces" # The namespace name. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Locks the project dependencies. -export extern "poetry lock" [ - --no-update # Do not update locked versions, only refresh lock file. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Creates a new Python project at <path>. -export extern "poetry new" [ - path: path # The path to create the project at. - --name: string # Set the resulting package name. - --src # Use the src layout for the project. - --readme: string@"nu-complete poetry readme-file-formats" # Specify the readme file format. Default is md. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Publishes a package to a remote repository. -export extern "poetry publish" [ - --repository(-r): string@"nu-complete poetry default-repositories" # The repository to publish the package to. - --username(-u): string@"nu-complete poetry default-usernames" # The username to access the repository. - --password(-p): string # The password to access the repository. - --cert: string # Certificate authority to access the repository. - --client-cert: string # Client certificate to access the repository. - --dist-dir: path@"nu-complete poetry default-dist-directories" # Dist directory where built artifact are stored. Default is `dist`. [default: "dist"] - --build # Build the package before publishing. - --dry-run # Perform all actions except upload the package. - --skip-existing # Ignore errors from files already existing in the repository. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Removes a package from the project dependencies. -export extern "poetry remove" [ - ...packages: string # The packages to remove. - --group(-G): string # The group to add the dependency to. [default: "main"] - --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). - --lock # Do not perform operations (only update the lockfile). - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Runs a command in the appropriate environment. -export extern "poetry run" [ - ...args: string # The command and arguments/options to run. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Searches for packages on remote repositories. -export extern "poetry search" [ - ...tokens: string # The tokens to search for. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Spawns a shell within the virtual environment. -export extern "poetry shell" [ - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Shows information about packages. -export extern "poetry show" [ - package?: string # The package to inspect. - --without: string@"nu-complete poetry default-dependency-groups" # The dependency groups to ignore. (multiple values allowed) - --with: string@"nu-complete poetry default-dependency-groups" # The optional dependency groups to include. (multiple values allowed) - --only: string@"nu-complete poetry default-dependency-groups" # The only dependency groups to include. (multiple values allowed) - --tree(-t) # List the dependencies as a tree. - --why # When showing the full list, or a --tree for a single package, display whether they are a direct dependency or required by other packages. - --latest(-l) # Show the latest version. - --outdated(-o) # Show the latest version but only for packages that are outdated. - --all(-a) # Show all packages (even those not compatible with current system). - --top-level(-T) # Show only top-level dependencies. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Update the dependencies as according to the pyproject.toml file. -export extern "poetry update" [ - ...packages: string # The packages to update. - --without: string@"nu-complete poetry default-dependency-groups" # The dependency groups to ignore. (multiple values allowed) - --with: string@"nu-complete poetry default-dependency-groups" # The optional dependency groups to include. (multiple values allowed) - --only: string@"nu-complete poetry default-dependency-groups" # The only dependency groups to include. (multiple values allowed) - --sync # Synchronize the environment with the locked packages and the specified groups. - --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). - --lock # Do not perform operations (only update the lockfile). - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Shows the version of the project or bumps it when a valid bump rule is provided. -export extern "poetry version" [ - version?: string # The version number or the rule to update the version. - --short(-s) # Output the version number only. - --dry-run # Do not update pyproject.toml file. - --next-phase # Increment the phase of the current version - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Clears Poetry's cache. -export extern "poetry cache clear" [ - cache: string@"nu-complete poetry caches" # The name of the cache to clear. - --all # Clear all entries in the cache. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# List Poetry's caches. -export extern "poetry cache list" [ - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Shows debug information. -export extern "poetry debug info" [ - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Debugs dependency resolution. -export extern "poetry debug resolve" [ - ...package: string # The packages to resolve. - --extras(-E): string # Extras to activate for the dependency. (multiple values allowed) - --python: string@"nu-complete poetry python-versions" # Python version(s) to use for resolution. - --tree # Display the dependency tree. - --install # Show what would be installed for the current system. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Displays information about the current environment. -export extern "poetry env info" [ - --path(-p) # Only display the environment's path. - --executable(-e) # Only display the environment's python executable path. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Lists all virtualenvs associated with the current project. -export extern "poetry env list" [ - --full-path # Output the full paths of the virtualenvs. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Remove virtual environments associated with the project. -export extern "poetry env remove" [ - ...python: string@"nu-complete poetry virtual-environments" # The python executables associated with, or names of the virtual environments which are to be removed. - --all # Remove all managed virtual environments associated with the project. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Activates or creates a new virtualenv for the current project. -export extern "poetry env use" [ - python: string@"nu-complete poetry virtual-environments" # The python executable to use. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Add additional packages to Poetry's runtime environment. -export extern "poetry self add" [ - ...name: string # The packages to add. - --editable(-e) # Add vcs/path dependencies as editable. - --extras(-E): string # Extras to activate for the dependency. (multiple values allowed) - --source: string@"nu-complete poetry default-package-sources" # Name of the source to use to install the package. - --allow-prereleases # Accept prereleases. - --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Install locked packages (incl. addons) required by this Poetry installation. -export extern "poetry self install" [ - --sync # Synchronize the environment with the locked packages and the specified groups. - --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Lock the Poetry installation's system requirements. -export extern "poetry self lock" [ - --no-update # Do not update locked versions, only refresh lock file. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Remove additional packages from Poetry's runtime environment. -export extern "poetry self remove" [ - ...packages: string # The packages to remove. - --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Show packages from Poetry's runtime environment. -export extern "poetry self show" [ - package?: string # The package to inspect. - --addons # List only add-on packages installed. - --tree(-t) # List the dependencies as a tree. - --latest(-l) # Show the latest version. - --outdated(-o) # Show the latest version but only for packages that are outdated. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Shows information about the currently installed plugins. -export extern "poetry self show plugins" [ - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Updates Poetry to the latest version. -export extern "poetry self update" [ - version?: string # The version to update to. [default: "latest"] - --preview # Allow the installation of pre-release versions. - --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Add source configuration for project. -export extern "poetry source add" [ - name: string@"nu-complete poetry default-package-source-names" # Source repository name. - url?: string@"nu-complete poetry default-package-source-urls" # Source repository URL. Required, except for PyPI, for which it is not allowed. - --priority(-p): string@"nu-complete poetry source-priorities" # Set the priority of this source. One of: default, primary, secondary, supplemental, explicit. Defaults to primary. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Remove source configured for the project. -export extern "poetry source remove" [ - name: string@"nu-complete poetry default-package-source-names" # Source repository name. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] - -# Show information about sources configured for the project. -export extern "poetry source show" [ - ...source: string@"nu-complete poetry default-package-source-names" # Source(s) to show information for. Defaults to showing all sources. - --help(-h) # Display help for the given command. When no command is given display help for the list command. - --quiet(-q) # Do not output any message. - --version(-V) # Display this application version. - --ansi # Force ANSI output. - --no-ansi # Disable ANSI output. - --no-interaction(-n) # Do not ask any interactive question. - --no-plugins # Disables plugins. - --no-cache # Disables Poetry source caches. - --directory(-C): path # The working directory for the Poetry command (defaults to the current working directory). - --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. -] +export complete [poetry] [ + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry about] [ + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry add] [ + ...name: text # The packages to add. + --group(-G): by "nu-complete poetry default-dependency-groups" [directory: --directory] # The group to add the dependency to. [default: "main"] + --editable(-e) # Add vcs/path dependencies as editable. + --extras(-E): text # Extras to activate for the dependency. (multiple values allowed) + --optional # Add as an optional dependency. + --python: words ["3.8" "3.9" "3.10" "3.11" "3.12" "3.13"] # Python version for which the dependency must be installed. + --platform: text # Platforms for which the dependency must be installed. + --source: by "nu-complete poetry default-package-sources" # Name of the source to use to install the package. + --allow-prereleases # Accept prereleases. + --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). + --lock # Do not perform operations (only update the lockfile). + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry build] [ + --format(-f): words ["sdist" "wheel"] # Limit the format to either sdist or wheel. + --output(-o): path # Set output directory for build artifacts. Default is `dist`. [default: "dist"] + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry check] [ + --lock # Checks that poetry.lock exists for the current version of pyproject.toml. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry config] [ + key?: words ["cache-dir" "experimental.system-git-client" "installer.max-workers" "installer.modern-installation" "installer.no-binary" "installer.parallel" "keyring.enabled" "solver.lazy-wheel" "virtualenvs.create" "virtualenvs.in-project" "virtualenvs.options.always-copy" "virtualenvs.options.no-pip" "virtualenvs.options.no-setuptools" "virtualenvs.options.system-site-packages" "virtualenvs.path" "virtualenvs.prefer-active-python" "virtualenvs.prompt" "repositories." "repositories.pypi.url" "repositories.testpypi.url" "http-basic." "http-basic.pypi.username" "http-basic.pypi.password" "http-basic.testpypi.username" "http-basic.testpypi.password" "pypi-token." "pypi-token.pypi" "pypi-token.testpypi" "certificates." "certificates.pypi.cert" "certificates.testpypi.cert" "certificates.pypi.client-cert" "certificates.testpypi.client-cert" "warnings.export"] # Setting key. + ...value: by "nu-complete poetry setting-values" [key: key] # Setting value. + --list # List configuration settings. + --unset # Unset configuration setting. + --local # Set/Get from the project's local configuration. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + at-most-one [--list --unset] + terminal [--help --version] +} + +export complete [poetry export] [ + --format(-f): words ["requirements.txt" "constraints.txt"] # Format to export to. Currently, only constraints.txt and requirements.txt are supported. [default: "requirements.txt"] + --output(-o): path # The name of the output file. + --without-hashes # Exclude hashes from the exported file. + --without-urls # Exclude source repository urls from the exported file. + --without: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The dependency groups to ignore. (multiple values allowed) + --with: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The optional dependency groups to include. (multiple values allowed) + --only: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The only dependency groups to include. (multiple values allowed) + --extras(-E): text # Extra sets of dependencies to include. (multiple values allowed) + --all-extras # Include all sets of extra dependencies. + --with-credentials # Include credentials for extra indices. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + at-most-one [--only --with] + at-most-one [--only --without] + at-most-one [--extras --all-extras] + terminal [--help --version] +} + +export complete [poetry help] [ + command_name?: words ["about" "add" "build" "check" "config" "export" "help" "init" "install" "list" "lock" "new" "publish" "remove" "run" "search" "shell" "show" "update" "version" "cache clear" "cache list" "debug info" "debug resolve" "env info" "env list" "env remove" "env use" "self add" "self install" "self lock" "self remove" "self show" "self show plugins" "self update" "source add" "source remove" "source show"] # The command name. [default: "help"] + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry init] [ + --name: text # Name of the package. + --description: text # Description of the package. + --author: text # Author name of the package. + --python: words ["3.8" "3.9" "3.10" "3.11" "3.12" "3.13"] # Compatible Python versions. + --dependency: text # Package to require, with an optional version constraint, e.g. requests:^2.10.0 or requests=2.11.1. (multiple values allowed) + --license(-s): by "nu-complete poetry licenses" # License of the package. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry install] [ + --without: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The dependency groups to ignore. (multiple values allowed) + --with: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The optional dependency groups to include. (multiple values allowed) + --only: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The only dependency groups to include. (multiple values allowed) + --sync # Synchronize the environment with the locked packages and the specified groups. + --no-root # Do not install the root package (the current project). + --no-directory # Do not install any directory path dependencies; useful to install dependencies without source code, e.g. for caching of Docker layers). + --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). + --extras(-E): text # Extra sets of dependencies to include. (multiple values allowed) + --all-extras # Install all extra dependencies. + --only-root # Exclude all dependencies. + --compile # Compile Python source files to bytecode. (This option has no effect if modern-installation is disabled because the old installer always compiles.) + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + overrides [--directory --no-directory] + at-most-one [--only --with] + at-most-one [--only --without] + at-most-one [--extras --all-extras] + at-most-one [--no-root --only-root] + terminal [--help --version] +} + +export complete [poetry list] [ + namespace?: words ["cache" "debug" "env" "self" "source"] # The namespace name. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry lock] [ + --no-update # Do not update locked versions, only refresh lock file. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry new] [ + path: path # The path to create the project at. + --name: text # Set the resulting package name. + --src # Use the src layout for the project. + --readme: words ["md" "txt" "adoc" "rst" "rft" "pdf" "html" "dbk" "odf" "tex" "latex" "texi" "asciidoc" "markdown" "xhtml" "xht" "htm" "xml"] # Specify the readme file format. Default is md. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry publish] [ + --repository(-r): by "nu-complete poetry default-repositories" # The repository to publish the package to. + --username(-u): by "nu-complete poetry default-usernames" # The username to access the repository. + --password(-p): text # The password to access the repository. + --cert: text # Certificate authority to access the repository. + --client-cert: text # Client certificate to access the repository. + --dist-dir: by "nu-complete poetry default-dist-directories" # Dist directory where built artifact are stored. Default is `dist`. [default: "dist"] + --build # Build the package before publishing. + --dry-run # Perform all actions except upload the package. + --skip-existing # Ignore errors from files already existing in the repository. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + requires --skip-existing --build + terminal [--help --version] +} + +export complete [poetry remove] [ + ...packages: by "nu-complete poetry dependencies" [directory: --directory] # The packages to remove. + --group(-G): by "nu-complete poetry default-dependency-groups" [directory: --directory] # The group to add the dependency to. [default: "main"] + --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). + --lock # Do not perform operations (only update the lockfile). + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry run] [ + ...args: text # The command and arguments/options to run. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry search] [ + ...tokens: text # The tokens to search for. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry shell] [ + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry show] [ + package?: by "nu-complete poetry dependencies" [directory: --directory] # The package to inspect. + --without: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The dependency groups to ignore. (multiple values allowed) + --with: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The optional dependency groups to include. (multiple values allowed) + --only: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The only dependency groups to include. (multiple values allowed) + --tree(-t) # List the dependencies as a tree. + --why # When showing the full list, or a --tree for a single package, display whether they are a direct dependency or required by other packages. + --latest(-l) # Show the latest version. + --outdated(-o) # Show the latest version but only for packages that are outdated. + --all(-a) # Show all packages (even those not compatible with current system). + --top-level(-T) # Show only top-level dependencies. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + requires --why --tree + at-most-one [--only --with] + at-most-one [--only --without] + at-most-one [--latest --outdated] + terminal [--help --version] +} + +export complete [poetry update] [ + ...packages: by "nu-complete poetry dependencies" [directory: --directory] # The packages to update. + --without: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The dependency groups to ignore. (multiple values allowed) + --with: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The optional dependency groups to include. (multiple values allowed) + --only: by "nu-complete poetry default-dependency-groups" [directory: --directory] # The only dependency groups to include. (multiple values allowed) + --sync # Synchronize the environment with the locked packages and the specified groups. + --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). + --lock # Do not perform operations (only update the lockfile). + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + at-most-one [--only --with] + at-most-one [--only --without] + terminal [--help --version] +} + +export complete [poetry version] [ + version?: text # The version number or the rule to update the version. + --short(-s) # Output the version number only. + --dry-run # Do not update pyproject.toml file. + --next-phase # Increment the phase of the current version + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry cache clear] [ + cache: by "nu-complete poetry caches" # The name of the cache to clear. + --all # Clear all entries in the cache. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry cache list] [ + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry debug info] [ + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry debug resolve] [ + ...package: text # The packages to resolve. + --extras(-E): text # Extras to activate for the dependency. (multiple values allowed) + --python: words ["3.8" "3.9" "3.10" "3.11" "3.12" "3.13"] # Python version(s) to use for resolution. + --tree # Display the dependency tree. + --install # Show what would be installed for the current system. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry env info] [ + --path(-p) # Only display the environment's path. + --executable(-e) # Only display the environment's python executable path. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry env list] [ + --full-path # Output the full paths of the virtualenvs. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry env remove] [ + ...python: by "nu-complete poetry virtual-environments" # The python executables associated with, or names of the virtual environments which are to be removed. + --all # Remove all managed virtual environments associated with the project. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry env use] [ + python: by "nu-complete poetry virtual-environments" # The python executable to use. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry env activate] [ + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry self add] [ + ...name: text # The packages to add. + --editable(-e) # Add vcs/path dependencies as editable. + --extras(-E): text # Extras to activate for the dependency. (multiple values allowed) + --source: by "nu-complete poetry default-package-sources" # Name of the source to use to install the package. + --allow-prereleases # Accept prereleases. + --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry self install] [ + --sync # Synchronize the environment with the locked packages and the specified groups. + --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry self lock] [ + --no-update # Do not update locked versions, only refresh lock file. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry self remove] [ + ...packages: text # The packages to remove. + --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry self show] [ + package?: text # The package to inspect. + --addons # List only add-on packages installed. + --tree(-t) # List the dependencies as a tree. + --latest(-l) # Show the latest version. + --outdated(-o) # Show the latest version but only for packages that are outdated. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + at-most-one [--latest --outdated] + terminal [--help --version] +} + +export complete [poetry self show plugins] [ + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry self update] [ + version?: text # The version to update to. [default: "latest"] + --preview # Allow the installation of pre-release versions. + --dry-run # Output the operations but do not execute anything (implicitly enables --verbose). + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry source add] [ + name: words ["pypi" "test" "test.pypi.org" "internal-pypi"] # Source repository name. + url?: words ["https://" "https://test.pypi.org/legacy/" "https://pypi.org/legacy"] # Source repository URL. Required, except for PyPI, for which it is not allowed. + --priority(-p): words ["default" "primary" "secondary" "supplemental" "explicit"] # Set the priority of this source. One of: default, primary, secondary, supplemental, explicit. Defaults to primary. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry source remove] [ + name: words ["pypi" "test" "test.pypi.org" "internal-pypi"] # Source repository name. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} + +export complete [poetry source show] [ + ...source: words ["pypi" "test" "test.pypi.org" "internal-pypi"] # Source(s) to show information for. Defaults to showing all sources. + --help(-h) # Display help for the given command. When no command is given display help for the list command. + --quiet(-q) # Do not output any message. + --version(-V) # Display this application version. + --ansi # Force ANSI output. + --no-ansi # Disable ANSI output. + --no-interaction(-n) # Do not ask any interactive question. + --no-plugins # Disables plugins. + --no-cache # Disables Poetry source caches. + --directory(-C): dir cwd # The working directory for the Poetry command (defaults to the current working directory). + --verbose(-v) # Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +] where { + at-most-one [--verbose --quiet] + overrides [--ansi --no-ansi] + terminal [--help --version] +} diff --git a/custom-completions/pre-commit/pre-commit-completions.nu b/custom-completions/pre-commit/pre-commit-completions.nu index 32a29d11c..33b493878 100644 --- a/custom-completions/pre-commit/pre-commit-completions.nu +++ b/custom-completions/pre-commit/pre-commit-completions.nu @@ -21,7 +21,6 @@ def "nu-complete --colors" [] { [ "auto", "always", "never" ] } - def "nu-complete --hook-stage" [] { [ "commit-msg", @@ -38,7 +37,6 @@ def "nu-complete --hook-stage" [] { ] } - def "nu-complete --hook-type" [] { [ "pre-commit", @@ -54,160 +52,198 @@ def "nu-complete --hook-type" [] { } -# A framework for managing and maintaining multi-language pre-commit hooks. -export extern "pre-commit" [ - --help(-h) # Show this help message and exit. - --version(-V) # Show program's version number and exit. -] - -# Auto-update pre-commit config to the latest repos' versions. -export extern "pre-commit autoupdate" [ - --config(-c): path # Path to alternate config file. - --jobs(-j): number # Number of threads to use. (default 1). - --repo: string # Only update this repository -- may be specified multiple times. - --bleeding-edge # Update to the bleeding edge of `HEAD` instead of the latest tagged version (the default behavior). - --freeze # Store "frozen" hashes in `rev` instead of tag names. - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. Defaults to `auto`. -] - -# Clean out pre-commit files. -export extern "pre-commit clean" [ - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] - -# Clean unused cached repos. -export extern "pre-commit gc" [ - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] - -# Show help for a specific command. -export extern "pre-commit help" [ - help_cmd?: string@"nu-complete pre-commit help" # Command to show help for. - --help(-h) # Show this help message and exit. -] - -# Install hook script in a directory intended for use with `git config init.templateDir`. -export extern "pre-commit init-templatedir" [ - directory: string # The directory in which to write the hook script. - --config(-c): path # Path to alternate config file. - --no-allow-missing-config # Assume cloned repos should have a `pre-commit` config. - --hook-type: string@"nu-complete --hook-type" # Hook type to use. - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] - -# Install the pre-commit script. -export extern "pre-commit install" [ - --config(-c): path # Path to alternate config file. - --no-allow-missing-config # Assume cloned repos should have a `pre-commit` config. - --overwrite(-f) # Overwrite existing hooks / remove migration mode. - --install-hooks # Whether to install hook environments for all environments in the config file. - --hook-type: string@"nu-complete --hook-type" # Hook type to use. - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] - - -# Install hook environments for all environments in the config file. You may find `pre-commit install --install-hooks` more useful. -export extern "pre-commit install-hooks" [ - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] - -# Migrate list configuration to new map configuration. -export extern "pre-commit migrate-config" [ - --config(-c): path # Path to alternate config file. - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] - -# Run hooks. -export extern "pre-commit run" [ - hook?: string # A single hook-id to run - --config(-c): path # Path to alternate config file. +# Hook ids of .pre-commit-config.yaml (or of the file given with `--config`). +@non-destructive +export def "nu-complete pre-commit hooks" [config?: string] { + try { + open ($config | default .pre-commit-config.yaml) + | get repos + | each {|r| $r.hooks | each {|h| {value: $h.id, description: ($h.name? | default $r.repo)} } } + | flatten + | uniq-by value + } catch { [] } +} + +# Repositories of .pre-commit-config.yaml, for `autoupdate --repo`. +@non-destructive +export def "nu-complete pre-commit repos" [config?: string] { + try { open ($config | default .pre-commit-config.yaml) | get repos.repo | where $it not-in [local meta] } catch { [] } +} + +export complete [pre-commit] [ + --help(-h) # Show this help message and exit. + --version(-V) # Show program's version number and exit. +] where { + terminal [--help --version] +} + +export complete [pre-commit autoupdate] [ + --config(-c): path # Path to alternate config file. + --jobs(-j): text # Number of threads to use. (default 1). + --repo: by "nu-complete pre-commit repos" [config: --config] # Only update this repository -- may be specified multiple times. + --bleeding-edge # Update to the bleeding edge of `HEAD` instead of the latest tagged version (the default behavior). + --freeze # Store "frozen" hashes in `rev` instead of tag names. + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. Defaults to `auto`. +] where { + at-most-one [--bleeding-edge --freeze] + terminal [--help] +} + +export complete [pre-commit clean] [ + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + terminal [--help] +} + +export complete [pre-commit gc] [ + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + terminal [--help] +} + +export complete [pre-commit help] [ + help_cmd?: words ["autoupdate" "clean" "init-templatedir" "gc" "install" "install-hooks" "migrate-config" "run" "try-repo" "uninstall" "validate-config" "validate-manifest" "sample-config" "help"] # Command to show help for. + --help(-h) # Show this help message and exit. +] where { + terminal [--help] +} + +export complete [pre-commit init-templatedir] [ + directory: text # The directory in which to write the hook script. + --config(-c): path # Path to alternate config file. + --no-allow-missing-config # Assume cloned repos should have a `pre-commit` config. + --hook-type: words ["pre-commit" "pre-merge-commit" "pre-push" "prepare-commit-msg" "commit-msg" "post-commit" "post-checkout" "post-merge" "post-rewrite"] # Hook type to use. + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + terminal [--help] +} + +export complete [pre-commit install] [ + --config(-c): path # Path to alternate config file. + --no-allow-missing-config # Assume cloned repos should have a `pre-commit` config. + --overwrite(-f) # Overwrite existing hooks / remove migration mode. + --install-hooks # Whether to install hook environments for all environments in the config file. + --hook-type: words ["pre-commit" "pre-merge-commit" "pre-push" "prepare-commit-msg" "commit-msg" "post-commit" "post-checkout" "post-merge" "post-rewrite"] # Hook type to use. + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + terminal [--help] +} + +export complete [pre-commit install-hooks] [ + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + terminal [--help] +} + +export complete [pre-commit migrate-config] [ + --config(-c): path # Path to alternate config file. + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + terminal [--help] +} + +export complete [pre-commit run] [ + hook?: by "nu-complete pre-commit hooks" [config: --config] # A single hook-id to run + --config(-c): path # Path to alternate config file. --verbose(-v) - --all-files(-a) # Run on all the files in the repo. - --files: path # Specific filenames to run hooks on. - --show-diff-on-failure # When hooks fail, run `git diff` directly afterward - --hook-stage@"nu-complete --hook-stage" # The stage during which the hook is fired. - --remote-branch: string # Remote branch ref used by `git push`. - --local-branch: string # Local branch ref used by `git push`. - --from-ref: string # (for usage with `--to-ref`) -- this option represents the original ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch you are pushing to. For `post-checkout` hooks, this represents the branch that was previously checked out. - --source(-s): string # (for usage with `--to-ref`) -- this option represents the original ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch you are pushing to. For `post-checkout` hooks, this represents the branch that was previously checked out. - --to-ref: string # for usage with `--from-ref`) -- this option represents the destination ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch being pushed. For `post-checkout` hooks, this represents the branch that is now checked out. - --origin(-o): string # for usage with `--from-ref`) -- this option represents the destination ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch being pushed. For `post-checkout` hooks, this represents the branch that is now checked out. - --pre-rebase-upstream: string # The upstream from which the series was forked. - --pre-rebase-branch: string # The branch being rebased, and is not set when rebasing the current branch. - --commit-msg-filename: string # Filename to check when running during `commit-msg` - --prepare-commit-message-source: string # Source of the commit message (typically the second argument to .git/hooks/prepare-commit-msg) - --commit-object-name: string # Commit object name (typically the third argument to .git/hooks/prepare-commit-msg) - --remote-name: string # Remote name used by `git push`. - --remote-url: string # Remote url used by `git push`. - --checkout-type: string # Indicates whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0). - --is-squash-merge: string # During a post-merge hook, indicates whether the merge was a squash merge - --rewrite-command: string # During a post-rewrite hook, specifies the command that invoked the rewrite - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] - -# Produce a sample .pre-commit-config.yaml file. -export extern "pre-commit sample-config" [ - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] - -# Try the hooks in a repository, useful for developing new hooks. -export extern "pre-commit try-repo" [ - repo: path # Repository to source hooks from. - hook?: string # A single hook-id to run - --config(-c): path # Path to alternate config file. + --all-files(-a) # Run on all the files in the repo. + --files: path # Specific filenames to run hooks on. + --show-diff-on-failure # When hooks fail, run `git diff` directly afterward + --hook-stage: words ["commit-msg" "post-checkout" "post-commit" "post-merge" "post-rewrite" "pre-commit" "pre-merge-commit" "pre-push" "pre-rebase" "prepare-commit-msg" "manual"] # The stage during which the hook is fired. + --remote-branch: text # Remote branch ref used by `git push`. + --local-branch: text # Local branch ref used by `git push`. + --from-ref: text # (for usage with `--to-ref`) -- this option represents the original ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch you are pushing to. For `post-checkout` hooks, this represents the branch that was previously checked out. + --source(-s): text # (for usage with `--to-ref`) -- this option represents the original ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch you are pushing to. For `post-checkout` hooks, this represents the branch that was previously checked out. + --to-ref: text # for usage with `--from-ref`) -- this option represents the destination ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch being pushed. For `post-checkout` hooks, this represents the branch that is now checked out. + --origin(-o): text # for usage with `--from-ref`) -- this option represents the destination ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch being pushed. For `post-checkout` hooks, this represents the branch that is now checked out. + --pre-rebase-upstream: text # The upstream from which the series was forked. + --pre-rebase-branch: text # The branch being rebased, and is not set when rebasing the current branch. + --commit-msg-filename: text # Filename to check when running during `commit-msg` + --prepare-commit-message-source: text # Source of the commit message (typically the second argument to .git/hooks/prepare-commit-msg) + --commit-object-name: text # Commit object name (typically the third argument to .git/hooks/prepare-commit-msg) + --remote-name: text # Remote name used by `git push`. + --remote-url: text # Remote url used by `git push`. + --checkout-type: text # Indicates whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0). + --is-squash-merge: text # During a post-merge hook, indicates whether the merge was a squash merge + --rewrite-command: text # During a post-rewrite hook, specifies the command that invoked the rewrite + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + at-most-one [--all-files --files] + requires --from-ref --to-ref + requires --to-ref --from-ref + requires --source --origin + requires --origin --source + terminal [--help] +} + +export complete [pre-commit sample-config] [ + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + terminal [--help] +} + +export complete [pre-commit try-repo] [ + repo: path # Repository to source hooks from. + hook?: text # A single hook-id to run + --config(-c): path # Path to alternate config file. --verbose(-v) - --ref: string # Manually select a rev to run against, otherwise the `HEAD` revision will be used. - --all-files(-a) # Run on all the files in the repo. - --files: path # Specific filenames to run hooks on. - --show-diff-on-failure # When hooks fail, run `git diff` directly afterward - --hook-stage@"nu-complete --hook-stage" # The stage during which the hook is fired. - --remote-branch: string # Remote branch ref used by `git push`. - --local-branch: string # Local branch ref used by `git push`. - --from-ref: string # (for usage with `--to-ref`) -- this option represents the original ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch you are pushing to. For `post-checkout` hooks, this represents the branch that was previously checked out. - --source(-s): string # (for usage with `--to-ref`) -- this option represents the original ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch you are pushing to. For `post-checkout` hooks, this represents the branch that was previously checked out. - --to-ref: string # for usage with `--from-ref`) -- this option represents the destination ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch being pushed. For `post-checkout` hooks, this represents the branch that is now checked out. - --origin(-o): string # for usage with `--from-ref`) -- this option represents the destination ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch being pushed. For `post-checkout` hooks, this represents the branch that is now checked out. - --pre-rebase-upstream: string # The upstream from which the series was forked. - --pre-rebase-branch: string # The branch being rebased, and is not set when rebasing the current branch. - --commit-msg-filename: string # Filename to check when running during `commit-msg` - --prepare-commit-message-source: string # Source of the commit message (typically the second argument to .git/hooks/prepare-commit-msg) - --commit-object-name: string # Commit object name (typically the third argument to .git/hooks/prepare-commit-msg) - --remote-name: string # Remote name used by `git push`. - --remote-url: string # Remote url used by `git push`. - --checkout-type: string # Indicates whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0). - --is-squash-merge: string # During a post-merge hook, indicates whether the merge was a squash merge - --rewrite-command: string # During a post-rewrite hook, specifies the command that invoked the rewrite - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] - -# Uninstall the pre-commit script. -export extern "pre-commit uninstall" [ - --config(-c): path # Path to alternate config file. - --hook-type: string@"nu-complete --hook-type" # Hook type to use. - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] - -# Validate .pre-commit-config.yaml files. -export extern "pre-commit validate-config" [ - ...filenames: path # Paths to config files. - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] - -# Validate .pre-commit-hooks.yaml files. -export extern "pre-commit validate-manifest" [ - ...filenames: path # Paths to manifest files. - --help(-h) # Show this help message and exit. - --color: string@"nu-complete --colors" # Whether to use color in output. -] + --ref: text # Manually select a rev to run against, otherwise the `HEAD` revision will be used. + --all-files(-a) # Run on all the files in the repo. + --files: path # Specific filenames to run hooks on. + --show-diff-on-failure # When hooks fail, run `git diff` directly afterward + --hook-stage: words ["commit-msg" "post-checkout" "post-commit" "post-merge" "post-rewrite" "pre-commit" "pre-merge-commit" "pre-push" "pre-rebase" "prepare-commit-msg" "manual"] # The stage during which the hook is fired. + --remote-branch: text # Remote branch ref used by `git push`. + --local-branch: text # Local branch ref used by `git push`. + --from-ref: text # (for usage with `--to-ref`) -- this option represents the original ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch you are pushing to. For `post-checkout` hooks, this represents the branch that was previously checked out. + --source(-s): text # (for usage with `--to-ref`) -- this option represents the original ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch you are pushing to. For `post-checkout` hooks, this represents the branch that was previously checked out. + --to-ref: text # for usage with `--from-ref`) -- this option represents the destination ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch being pushed. For `post-checkout` hooks, this represents the branch that is now checked out. + --origin(-o): text # for usage with `--from-ref`) -- this option represents the destination ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch being pushed. For `post-checkout` hooks, this represents the branch that is now checked out. + --pre-rebase-upstream: text # The upstream from which the series was forked. + --pre-rebase-branch: text # The branch being rebased, and is not set when rebasing the current branch. + --commit-msg-filename: text # Filename to check when running during `commit-msg` + --prepare-commit-message-source: text # Source of the commit message (typically the second argument to .git/hooks/prepare-commit-msg) + --commit-object-name: text # Commit object name (typically the third argument to .git/hooks/prepare-commit-msg) + --remote-name: text # Remote name used by `git push`. + --remote-url: text # Remote url used by `git push`. + --checkout-type: text # Indicates whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0). + --is-squash-merge: text # During a post-merge hook, indicates whether the merge was a squash merge + --rewrite-command: text # During a post-rewrite hook, specifies the command that invoked the rewrite + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + terminal [--help] +} + +export complete [pre-commit uninstall] [ + --config(-c): path # Path to alternate config file. + --hook-type: words ["pre-commit" "pre-merge-commit" "pre-push" "prepare-commit-msg" "commit-msg" "post-commit" "post-checkout" "post-merge" "post-rewrite"] # Hook type to use. + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + terminal [--help] +} + +export complete [pre-commit validate-config] [ + ...filenames: path # Paths to config files. + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + terminal [--help] +} + +export complete [pre-commit validate-manifest] [ + ...filenames: path # Paths to manifest files. + --help(-h) # Show this help message and exit. + --color: words ["auto" "always" "never"] # Whether to use color in output. +] where { + terminal [--help] +} diff --git a/custom-completions/pytest/pytest-completions.nu b/custom-completions/pytest/pytest-completions.nu index 8a7624a64..3f9e80bb6 100644 --- a/custom-completions/pytest/pytest-completions.nu +++ b/custom-completions/pytest/pytest-completions.nu @@ -7,104 +7,131 @@ def "nu-complete --code-highlight" [] { ["yes", "no"] } def "nu-complete --pastebin" [] { ["failed", "all"] } def "nu-complete --import-mode" [] { ["prepend", "append", "importlib"] } def "nu-complete --doctest-report" [] { ["none", "cdiff", "ndiff", "udiff", "only_first_failure"] } -def "nu-complete --log-file-mode" [] { ["w", "a"] } -def "nu-complete --assert" [] { ["plain", "rewrite"] } +def "nu-complete --log-file-mode" [] { ["w" "a"] } +def "nu-complete --assert" [] { ["plain" "rewrite"] } def "nu-complete --log-level" [] { ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] } -export extern pytest [ - file_or_dir?: path # List of files or directories to use for test discovery. - -k: string # Only run tests which match the given substring expression. - --markers(-m): string # Register new markers for test functions - --exitfirst(-x) # Exit instantly on first error or failed test - --fixtures # Show available fixtures, sorted by plugin appearance (fixtures with leading '_' are only shown with '-v') - --fixtures-per-test # Show fixtures per test - --pdb # Start the interactive Python debugger on errors or KeyboardInterrupt - --pdbcls:string # Specify a custom interactive Python debugger for use with --pdb - --trace # Immediately break when running each test - --capture:string@"nu-complete --capture" # Per-test capturing method - -s # Shortcut for --capture=no - --runxfail # Report the results of xfail tests as if they were not marked - --last-failed # Rerun only the tests that failed at the last run (or all if none failed) - --failed-first # Run all tests, but run the last failures first. This may re-order tests and thus lead to repeated fixture setup/teardown. - --new-first # Run tests from new files first, then the rest of the tests sorted by file mtime - --cache-show?:string # Show cache contents, don't perform collection or tests. Optional argument: glob (default: '*'). - --cache-clear # Remove all cache contents at start of test run - --last-failed-no-failures:string@"nu-complete --last-failed-no-failures" # Determines whether to execute tests when there are no previously (known) failures or when no - # cached ``lastfailed`` data was found. ``all`` (the default) runs the full test suite again. ``none`` just - # emits a message about no known failures and exits successfully. - --stepwise # Exit on test failure and continue from last failing test next time - --stepwise-skip # Ignore the first failing test but stop on the next failing test. Implicitly enables --stepwise. - --durations:int # Show N slowest setup/test durations (N=0 for all) - --durations-min?:int # Minimal duration in seconds for inclusion in slowest list. Default: 0.005. - --verbose(-v) # Increase verbosity - --no-header # Disable header - --no-summary # Disable summary - --no-fold-skipped # Do not fold skipped tests in short summary. - --quiet(-q) # Decrease verbosity - --verbosity:int # Set verbosity. Default: 0. - -r:string # Show extra test summary info as specified (f)ailed, (E)rror, (s)kipped, (x)failed, (X)passed, - # (p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. (w)arnings are enabled by default (see - # --disable-warnings), 'N' can be used to reset the list. (default: 'fE'). - --disable-warnings # Disable warnings summary - --showlocals(-l) # Show locals in tracebacks (disabled by default) - --no-showlocals # Hide locals in tracebacks (negate --showlocals passed through addopts) - --tb:string@"nu-complete --tb" # Traceback print mode - --xfail-tb # Show tracebacks for xfail (as long as --tb != no) - --show-capture:string@"nu-complete --show-capture" # Controls how captured stdout/stderr/log is shown on failed tests. Default: all. - --full-trace # Don't cut any tracebacks (default is to cut) - --color:string@"nu-complete --color" # Color terminal output - --code-highlight:string@"nu-complete --code-highlight" # Whether code should be highlighted (only if --color is also enabled). Default: yes. - --pastebin:string@"nu-complete --pastebin" # Send failed|all info to bpaste.net pastebin service - --junit-xml:path # Create junit-xml style report file at given path - --junit-prefix:string # Prepend prefix to classnames in junit-xml output - --pythonwarnings(-W): string # Set which warnings to report, see -W option of Python itself - --maxfail:int # Exit after first num failures or errors - --strict-config # Any warnings encountered while parsing the `pytest` section of the configuration file raise errors - --strict-markers # Markers not registered in the `markers` section of the configuration file raise errors - --config-file(-c):path # Load configuration from `FILE` instead of trying to locate one of the implicit configuration files. - --continue-on-collection-errors # Force test execution even if collection errors occur - --rootdir:path # Define root directory for tests. Can be relative path: 'root_dir', './root_dir', 'root_dir/another_dir/'; - # absolute path: '/home/user/root_dir'; path with variables: '$HOME/root_dir'. - --collect-only # Only collect tests, don't execute them - --pyargs # Try to interpret all arguments as Python packages - --ignore:path # Ignore path during collection (multi-allowed) - --ignore-glob:path # Ignore path pattern during collection (multi-allowed) - --deselect:string # Deselect item (via node id prefix) during collection (multi-allowed) - --confcutdir:string # Only load conftest.py's relative to specified dir - --noconftest # Don't load any conftest.py files - --keep-duplicates # Keep duplicate tests - --collect-in-virtualenv # Don't ignore tests in a local virtualenv directory - --import-mode:string@"nu-complete --import-mode" # Prepend/append to sys.path when importing test modules and conftest files. Default: prepend. - --doctest-modules # Run doctests in all .py modules - --doctest-report:string@"nu-complete --doctest-report" # Choose another output format for diffs on doctest failure - --doctest-glob:string # Doctests file matching pattern, default: test*.txt - --doctest-ignore-import-errors # Ignore doctest collection errors - --doctest-continue-on-failure # For a given doctest, continue to run after the first failure - --basetemp:path # Base temporary directory for this test run. (Warning: this directory is removed if it exists.) - --version(-V) # Display pytest version and information about plugins. When given twice, also display information about plugins. - --help(-h) # Show help message and configuration info - -p:string # Early-load given plugin module name or entry point (multi-allowed). To avoid loading of plugins, use the #`no:` prefix, e.g. `no:doctest`. - --trace-config # Trace considerations of conftest.py files - --debug?:path # Store internal tracing debug information in this log file. This file is opened with 'w' and truncated as a - # result, care advised. Default: pytestdebug.log. - --override-ini(-i): string # Override ini option with "option=value" style, e.g. `-o xfail_strict=True -o cache_dir=cache`. - --assert:string@"nu-complete --assert" # Control assertion debugging tools. 'plain' performs no assertion debugging. - # 'rewrite' (the default) rewrites assert statements in test modules on import to provide assert expression information. - --setup-only # Only setup fixtures, do not execute tests - --setup-show # Show setup of fixtures while executing tests - --setup-plan # Show what fixtures and tests would be executed but don't execute anything - --log-level:string@"nu-complete --log-level" # Level of messages to catch/display. Not set by default, so it depends on the root/parent log handler's - # effective level, where it is "WARNING" by default. - --log-format:string # Log format used by the logging module - --log-date-format:string # Log date format used by the logging module - --log-cli-level:string@"nu-complete --log-level" # CLI logging level - --log-cli-format:string # Log format used by the logging module - --log-cli-date-format:string # Log date format used by the logging module - --log-file:path # Path to a file when logging will be written to - --log-file-mode:string@"nu-complete --log-file-mode" # Log file open mode - --log-file-level:string@"nu-complete --log-level" # Log file logging level - --log-file-format:string # Log format used by the logging module - --log-file-date-format:string # Log date format used by the logging module - --log-auto-indent:int # Auto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer. - --log-disable:string # Disable a logger by name. Can be passed multiple times. -] + +# Markers registered in pytest.ini / pyproject.toml / setup.cfg / tox.ini (read, never collected). +@non-destructive +export def "nu-complete pytest markers" [] { + try { + let from_pyproject = try { open pyproject.toml | get -o tool.pytest.ini_options.markers | default [] } catch { [] } + let from_ini = [pytest.ini tox.ini setup.cfg] + | where {|f| $f | path exists } + | each {|f| open --raw $f | lines | skip until {|l| $l =~ '^\s*markers\s*=' } | skip 1 | take while {|l| $l =~ '^\s+\S' } | str trim } + | flatten + $from_pyproject ++ $from_ini + | each {|m| $m | parse --regex '^(?<value>[\w.]+)(?:\([^)]*\))?\s*:?\s*(?<description>.*)$' } + | flatten + | uniq-by value + } catch { [] } +} + +# Test files and directories discovered below the current directory (test_*.py, *_test.py). +@non-destructive +export def "nu-complete pytest targets" [] { + try { + let files = glob --depth 4 '**/{test_*,*_test}.py' --exclude ['**/.*/**' '**/node_modules/**' '**/__pycache__/**'] | each {|f| $f | path relative-to $env.PWD } + let dirs = $files | each {|f| $f | path dirname } | where $it != '' | uniq | each {|d| $"($d)/" } + $dirs ++ $files + } catch { [] } +} + +export complete [pytest] [ + ...file_or_dir: by "nu-complete pytest targets" # List of files or directories to use for test discovery. + -k: text # Only run tests which match the given substring expression. + -m: by "nu-complete pytest markers" # Only run tests matching the given mark expression + --markers # Show the markers that are registered + --exitfirst(-x) # Exit instantly on first error or failed test + --fixtures # Show available fixtures, sorted by plugin appearance (fixtures with leading '_' are only shown with '-v') + --fixtures-per-test # Show fixtures per test + --pdb # Start the interactive Python debugger on errors or KeyboardInterrupt + --pdbcls: text # Specify a custom interactive Python debugger for use with --pdb + --trace # Immediately break when running each test + --capture: words ["fd" "sys" "no" "tee-sys"] # Per-test capturing method + -s # Shortcut for --capture=no + --runxfail # Report the results of xfail tests as if they were not marked + --last-failed # Rerun only the tests that failed at the last run (or all if none failed) + --failed-first # Run all tests, but run the last failures first. This may re-order tests and thus lead to repeated fixture setup/teardown. + --new-first # Run tests from new files first, then the rest of the tests sorted by file mtime + --cache-show?: text # Show cache contents, don't perform collection or tests. Optional argument: glob (default: '*'). + --cache-clear # Remove all cache contents at start of test run + --last-failed-no-failures: words ["all" "none"] # Determines whether to execute tests when there are no previously (known) failures or when no + --stepwise # Exit on test failure and continue from last failing test next time + --stepwise-skip # Ignore the first failing test but stop on the next failing test. Implicitly enables --stepwise. + --durations: text # Show N slowest setup/test durations (N=0 for all) + --durations-min?: text # Minimal duration in seconds for inclusion in slowest list. Default: 0.005. + --verbose(-v) # Increase verbosity + --no-header # Disable header + --no-summary # Disable summary + --no-fold-skipped # Do not fold skipped tests in short summary. + --quiet(-q) # Decrease verbosity + --verbosity: text # Set verbosity. Default: 0. + -r: text # Show extra test summary info as specified (f)ailed, (E)rror, (s)kipped, (x)failed, (X)passed, + --disable-warnings # Disable warnings summary + --showlocals(-l) # Show locals in tracebacks (disabled by default) + --no-showlocals # Hide locals in tracebacks (negate --showlocals passed through addopts) + --tb: words ["auto" "long" "short" "line" "native" "no"] # Traceback print mode + --xfail-tb # Show tracebacks for xfail (as long as --tb != no) + --show-capture: words ["no" "stdout" "stderr" "log" "all"] # Controls how captured stdout/stderr/log is shown on failed tests. Default: all. + --full-trace # Don't cut any tracebacks (default is to cut) + --color: words ["yes" "no" "auto"] # Color terminal output + --code-highlight: words ["yes" "no"] # Whether code should be highlighted (only if --color is also enabled). Default: yes. + --pastebin: words ["failed" "all"] # Send failed|all info to bpaste.net pastebin service + --junit-xml: path # Create junit-xml style report file at given path + --junit-prefix: text # Prepend prefix to classnames in junit-xml output + --pythonwarnings(-W): text # Set which warnings to report, see -W option of Python itself + --maxfail: text # Exit after first num failures or errors + --strict-config # Any warnings encountered while parsing the `pytest` section of the configuration file raise errors + --strict-markers # Markers not registered in the `markers` section of the configuration file raise errors + --config-file(-c): path # Load configuration from `FILE` instead of trying to locate one of the implicit configuration files. + --continue-on-collection-errors # Force test execution even if collection errors occur + --rootdir: path # Define root directory for tests. Can be relative path: 'root_dir', './root_dir', 'root_dir/another_dir/'; + --collect-only # Only collect tests, don't execute them + --pyargs # Try to interpret all arguments as Python packages + --ignore: path # Ignore path during collection (multi-allowed) + --ignore-glob: path # Ignore path pattern during collection (multi-allowed) + --deselect: text # Deselect item (via node id prefix) during collection (multi-allowed) + --confcutdir: text # Only load conftest.py's relative to specified dir + --noconftest # Don't load any conftest.py files + --keep-duplicates # Keep duplicate tests + --collect-in-virtualenv # Don't ignore tests in a local virtualenv directory + --import-mode: words ["prepend" "append" "importlib"] # Prepend/append to sys.path when importing test modules and conftest files. Default: prepend. + --doctest-modules # Run doctests in all .py modules + --doctest-report: words ["none" "cdiff" "ndiff" "udiff" "only_first_failure"] # Choose another output format for diffs on doctest failure + --doctest-glob: text # Doctests file matching pattern, default: test*.txt + --doctest-ignore-import-errors # Ignore doctest collection errors + --doctest-continue-on-failure # For a given doctest, continue to run after the first failure + --basetemp: path # Base temporary directory for this test run. (Warning: this directory is removed if it exists.) + --version(-V) # Display pytest version and information about plugins. When given twice, also display information about plugins. + --help(-h) # Show help message and configuration info + -p: text # Early-load given plugin module name or entry point (multi-allowed). To avoid loading of plugins, use the #`no:` prefix, e.g. `no:doctest`. + --trace-config # Trace considerations of conftest.py files + --debug?: path # Store internal tracing debug information in this log file. This file is opened with 'w' and truncated as a + --override-ini(-i): text # Override ini option with "option=value" style, e.g. `-o xfail_strict=True -o cache_dir=cache`. + --assert: words ["plain" "rewrite"] # Control assertion debugging tools. 'plain' performs no assertion debugging. + --setup-only # Only setup fixtures, do not execute tests + --setup-show # Show setup of fixtures while executing tests + --setup-plan # Show what fixtures and tests would be executed but don't execute anything + --log-level: words ["DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"] # Level of messages to catch/display. Not set by default, so it depends on the root/parent log handler's + --log-format: text # Log format used by the logging module + --log-date-format: text # Log date format used by the logging module + --log-cli-level: words ["DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"] # CLI logging level + --log-cli-format: text # Log format used by the logging module + --log-cli-date-format: text # Log date format used by the logging module + --log-file: path # Path to a file when logging will be written to + --log-file-mode: words ["w" "a"] # Log file open mode + --log-file-level: words ["DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"] # Log file logging level + --log-file-format: text # Log format used by the logging module + --log-file-date-format: text # Log date format used by the logging module + --log-auto-indent: text # Auto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer. + --log-disable: text # Disable a logger by name. Can be passed multiple times. +] where { + at-most-one [--verbose --quiet] + overrides [--showlocals --no-showlocals] + at-most-one [--last-failed --failed-first --new-first] + at-most-one [--stepwise --stepwise-skip] + requires --code-highlight --color + terminal [--help --version --markers --fixtures --fixtures-per-test --cache-show] +} diff --git a/custom-completions/reflector/reflector-completions.nu b/custom-completions/reflector/reflector-completions.nu index 85bc7deab..ece3c05c1 100644 --- a/custom-completions/reflector/reflector-completions.nu +++ b/custom-completions/reflector/reflector-completions.nu @@ -1,33 +1,31 @@ -def "nu-complete sort" [] { - ["age" "rate" "country" "score" "delay"] +# reflector: retrieve and filter the latest Arch Linux pacman mirror list. + +export complete [reflector] [ + --help(-h) # Show help and exit + --connection-timeout: text # Seconds before a connection times out [default: 5] + --download-timeout: text # Seconds before a download times out [default: 5] + --list-countries # Show the distribution of servers by country + --cache-timeout: text # Mirror status cache timeout in seconds [default: 300] + --url: text # URL of the mirror status JSON + --save: path # Save the mirrorlist to this path + --sort: words [age: "Last synchronization" rate: "Download rate" country: "Country name" score: "MirrorStatus score" delay: "MirrorStatus delay"] # Sort the mirrorlist + --threads: text # Threads used to rate mirrors + --verbose # Print extra information to stderr + --info # Print mirror information instead of a list + --exclude(-x): text # Exclude servers matching this regex + --include(-i): text # Include servers matching this regex + --age(-a): text # Only mirrors synced in the last N hours + --delay: text # Only mirrors with a sync delay of N hours or less + --country(-c): text # Restrict to these countries (names or codes, comma-separated) + --fastest(-f): text # Return the N fastest mirrors + --latest(-l): text # Return the N most recently synced mirrors + --score: text # Return the N highest-scoring mirrors + --number(-n): text # Return at most N mirrors + --protocol(-p): words [http https ftp rsync] # Allowed protocols (comma-separated or repeated) + --completion-percent: text # Minimum completion percent [default: 100] + --isos # Only mirrors that host ISOs + --ipv4 # Only mirrors that support IPv4 + --ipv6 # Only mirrors that support IPv6 +] where { + terminal [--help --list-countries] } -def "nu-complete protocol" [] { - ["http", "https", "ftp"] -} -export extern "reflector" [ - --help(-h) # show this help message and exit - --connection-timeout: int # The number of seconds to wait before a connection times out. Default: 5 - --download-timeout: int # The number of seconds to wait before a download times out. Default: 5 - --list-countries # Display a table of the distribution of servers by country. - --cache-timeout: int # The cache timeout in seconds for the data retrieved from the Arch Linux Mirror Status API. The default is 300. - --url: string # The URL from which to retrieve the mirror data in JSON format. If different from the default, it must follow the same format. Default: https://archlinux.org/mirrors/status/json/ - --save: string # Save the mirrorlist to the given path. - --sort: string@"nu-complete sort" # Sort the mirrorlist. "age": last server synchronization; "rate": download rate; "country": country name, either alphabetically or in the order given by the --country option; "score": MirrorStatus score; "delay": MirrorStatus delay. - --threads: int # Use n threads for rating mirrors. This option will speed up the rating step but the results will be inaccurate if the local bandwidth is saturated at any point during the operation. If rating takes too long without this option then you should probably apply more filters to reduce the number of rated servers before using this option. - --verbose # Print extra information to STDERR. Only works with some options. - --info # Print mirror information instead of a mirror list. Filter options apply. - --exclude(-x) # Exclude servers that match <regex>, where <regex> is a Python regular express. - --include(-i) # Include servers that match <regex>, where <regex> is a Python regular express. - --age(-a) # Only return mirrors that have synchronized in the last n hours. n may be an integer or a decimal number. - --delay: int # Only return mirrors with a reported sync delay of n hours or less, where n is a float. For example. to limit the results to mirrors with a reported delay of 15 minutes or less, pass 0.25. - --country(-c): string # Restrict mirrors to selected countries. Countries may be given by name or country code, or a mix of both. The case is ignored. Multiple countries may be selected using commas (e.g. --country France,Germany) or by passing this option multiple times (e.g. -c fr -c de). - --fastest(-f): int # Return the n fastest mirrors that meet the other criteria. Do not use this option without other filtering options. - --latest(-l): int # Limit the list to the n most recently synchronized servers. - --score: int # Limit the list to the n servers with the highest score. - --number(-n): int # Return at most n mirrors. - --protocol(-p): string@"nu-complete protocol" # Match one of the given protocols, e.g. "https" or "ftp". Multiple protocols may be selected using commas (e.g. "https,http") or by passing this option multiple times. - --completion-percent: int # Set the minimum completion percent for the returned mirrors. Check the mirrorstatus webpage for the meaning of this parameter. Default value: 100.0. - --isos # Only return mirrors that host ISOs. - --ipv4 # Only return mirrors that support IPv4. - --ipv6 # Only return mirrors that support IPv6. -] diff --git a/custom-completions/rex/rex-completions.nu b/custom-completions/rex/rex-completions.nu new file mode 100644 index 000000000..a0aed3bb4 --- /dev/null +++ b/custom-completions/rex/rex-completions.nu @@ -0,0 +1,1672 @@ +# Rex terminal multiplexer completions for Nushell. +# Covers every subcommand, with dynamic completers for sessions, windows and blocks. + +# ── Data commands ──────────────────────────────────────────────────────────── + +# The sessions on the server, one row each: `id`, `label` and `state`. +# `rex-sessions | where state == running | get label` completes the labels. +@non-destructive +@example "Labels of the live sessions" { rex-sessions | get label } +@example "Sessions that are still running" { rex-sessions | where state == running } +export def rex-sessions []: nothing -> table<id: string, label: string, state: string> { + ^rex ls --json + | from json + | each {|s| {id: ($s.id? | default ''), label: ($s.label? | default ''), state: ($s.state? | default '')} } +} + +# The windows across all sessions: `id`, `label`, `session` and `position`. +@non-destructive +@example "Windows in the 'work' session" { rex-windows | where session == work } +@example "Find a window by label" { rex-windows | where label == editor } +export def rex-windows []: nothing -> table<id: string, label: string, session: string, position: int> { + ^rex window ls --json + | from json + | each {|w| {id: ($w.id? | default ''), label: ($w.label? | default ''), session: ($w.session? | default ''), position: ($w.position? | default 0)} } +} + +# The blocks across all sessions: `id`, `label`, `type`, `session` and `window`. +@non-destructive +@example "Terminal blocks only" { rex-blocks | where type == terminal } +@example "Blocks in a specific window" { rex-blocks | where window == editor } +export def rex-blocks []: nothing -> table<id: string, label: string, type: string, session: string, window: string> { + ^rex block ls --json + | from json + | each {|b| {id: ($b.id? | default ''), label: ($b.label? | default ''), type: ($b.type? | default ''), session: ($b.session? | default ''), window: ($b.window? | default '')} } +} + +# ── Dynamic completers ────────────────────────────────────────────────────── + +@non-destructive +export def "nu-complete rex sessions" [] { + try { + rex-sessions + | each {|s| {value: $s.label, description: $"($s.state) · ($s.id)"} } + } catch { [] } +} + +@non-destructive +export def "nu-complete rex windows" [] { + try { + rex-windows + | each {|w| {value: $w.label, description: $"pos ($w.position) · ($w.session)"} } + } catch { [] } +} + +@non-destructive +export def "nu-complete rex blocks" [] { + try { + rex-blocks + | each {|b| {value: $b.label, description: $"($b.type) · ($b.session)/($b.window)"} } + } catch { [] } +} + +# Directions plus the live windows and blocks that can take focus. +@non-destructive +export def "nu-complete rex focus-target" [] { + try { + let directions = [ + {value: left, description: "Move focus left"} + {value: right, description: "Move focus right"} + {value: up, description: "Move focus up"} + {value: down, description: "Move focus down"} + {value: next, description: "Next block in layout order"} + {value: prev, description: "Previous block in layout order"} + ] + let blocks = try { nu-complete rex blocks } catch { [] } + let windows = try { nu-complete rex windows } catch { [] } + [...$directions ...$blocks ...$windows] + } catch { [] } +} + +# ── Top-level rex command ──────────────────────────────────────────────────── + +# The multiplexer for all work +export complete [rex] [ + --autostart # Start a missing local server (default true) + --client(-C): text # Act on client CLIENT, given as a label or ID + --color: words [auto always never] # Set color output: auto, always, or never + --help(-h) # Show help + --server(-S): text # Connect to SERVER, a host label or address + --timeout: text # Limit each request to DURATION (default 10s) + --verbose(-v) # Increase diagnostic verbosity (repeatable) +] + +# ── Common commands ────────────────────────────────────────────────────────── + +# Create a session +export complete [rex new] [ + label?: text # Label for the new session + --cwd(-c): path # Working directory for the terminal + --keep-open # Keep the terminal open after its command exits + --shell: text # Run COMMAND through SHELL's login environment + --interactive # Read the shell's interactive startup files too + --window: text # Label for the first window + --json # Output the created session as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity + ...command: text # Command to run (after --) +] + +# List sessions +export complete [rex ls] [ + --json # Output sessions as JSON + --quiet(-q) # Print IDs only, one per line + --short # Show short IDs (default true) + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List sessions (alias) +export complete [rex list] [ + --json # Output sessions as JSON + --quiet(-q) # Print IDs only, one per line + --short # Show short IDs (default true) + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Run a command in a new terminal block +export complete [rex run] [ + --split: words [right: "Place the new block to the right" left: "Place the new block to the left" above: "Place the new block above" below: "Place the new block below"] # Place the new block in DIRECTION relative to anchor + --ratio: text # Give the new block PCT percent of the split (default 50) + --block(-b): by "nu-complete rex blocks" # Use BLOCK as the split anchor + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --cwd(-c): path # Working directory for the terminal + --keep-open # Keep the terminal open after its command exits + --shell: text # Run COMMAND through SHELL's login environment + --interactive # Read the shell's interactive startup files too + --label: text # Set the new block label + --focus # Focus the new block (default true) + --json # Output the creation result as JSON + --wait # Wait and return the exit status + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity + ...command: text # Command to run (after --) +] + +# Split the focused block +export complete [rex split] [ + --split: words [right: "Place the new block to the right" left: "Place the new block to the left" above: "Place the new block above" below: "Place the new block below"] # Direction to split (default right) + --ratio: text # Give the new block PCT percent of the split (default 50) + --block(-b): by "nu-complete rex blocks" # Use BLOCK as the split anchor + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --cwd(-c): path # Working directory for the terminal + --keep-open # Keep the terminal open after its command exits + --shell: text # Run COMMAND through SHELL's login environment + --interactive # Read the shell's interactive startup files too + --label: text # Set the new block label + --focus # Focus the new block (default true) + --json # Output the creation result as JSON + --wait # Wait and return the exit status + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity + ...command: text # Command to run (after --) +] + +# Perform an action or run a Lua script +export complete [rex do] [ + action_or_script?: text # Action name or Lua script path + --block(-b): by "nu-complete rex blocks" # Target block + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --all # Hear every session, including future ones + -e: text # Inline Lua script + --action: text # Run the named action from the script + --for: text # Stop after DURATION + --fail-fast # Exit on first handler failure + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Send input to a terminal +export complete [rex send] [ + text?: text # Text to send + --block(-b): by "nu-complete rex blocks" # Send to block BLOCK + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Send key presses to a terminal +export complete [rex send-key] [ + ...keys: text # Key presses in Rex binding syntax + --block(-b): by "nu-complete rex blocks" # Send to block BLOCK + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --action: words [press release repeat] # Send one ACTION: press, release, or repeat + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Print a terminal's screen and scrollback +export complete [rex capture] [ + --block(-b): by "nu-complete rex blocks" # Select block BLOCK + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --format: words [text: "Plain text (default)" html: "Styled HTML" vt: "Terminal control sequences"] # Output format: text, html, or vt + --trim # Remove trailing blank lines + --unwrap # Join soft-wrapped lines + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Kill sessions +export complete [rex kill] [ + ...sessions: by "nu-complete rex sessions" # Sessions to kill + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Forward ────────────────────────────────────────────────────────────────── + +# Forward TCP ports +export complete [rex forward] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Forward ports until interrupted +export complete [rex forward new] [ + ...specs: text # Port forwarding specs + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Forward a local port to a server-side target and open it +export complete [rex forward open] [ + ...specs: text # Port forwarding specs + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Forward a server port to a target on this machine +export complete [rex forward share] [ + ...specs: text # Port forwarding specs + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List forwards +export complete [rex forward ls] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List forwards (alias) +export complete [rex forward list] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Close forwards +export complete [rex forward close] [ + ...forwards: text # Forwards to close + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Forward TCP ports (fwd alias) +export complete [rex fwd] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +export complete [rex fwd new] [ + ...specs: text + --help(-h) + --server(-S): text + --client(-C): text + --autostart + --timeout: text + --color: words [auto always never] + --verbose(-v) +] + +export complete [rex fwd open] [ + ...specs: text + --help(-h) + --server(-S): text + --client(-C): text + --autostart + --timeout: text + --color: words [auto always never] + --verbose(-v) +] + +export complete [rex fwd share] [ + ...specs: text + --help(-h) + --server(-S): text + --client(-C): text + --autostart + --timeout: text + --color: words [auto always never] + --verbose(-v) +] + +export complete [rex fwd ls] [ + --help(-h) + --server(-S): text + --client(-C): text + --autostart + --timeout: text + --color: words [auto always never] + --verbose(-v) +] + +export complete [rex fwd list] [ + --help(-h) + --server(-S): text + --client(-C): text + --autostart + --timeout: text + --color: words [auto always never] + --verbose(-v) +] + +export complete [rex fwd close] [ + ...forwards: text + --help(-h) + --server(-S): text + --client(-C): text + --autostart + --timeout: text + --color: words [auto always never] + --verbose(-v) +] + +# ── Layout ─────────────────────────────────────────────────────────────────── + +# Focus a block or window +export complete [rex focus] [ + target?: by "nu-complete rex focus-target" # Block, window, or direction to focus + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --wrap # Continue from the other side at the edge + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Zoom a block to fill its window +export complete [rex zoom] [ + block?: by "nu-complete rex blocks" # Block to zoom + --block(-b): by "nu-complete rex blocks" # Select block BLOCK + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --on # Enable zoom + --off # Disable zoom + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Move a block next to an anchor block +export complete [rex move] [ + block_or_direction?: text # BLOCK or DIRECTION + direction_or_anchor?: text # DIRECTION or ANCHOR + anchor?: by "nu-complete rex blocks" # ANCHOR block + --ratio: text # Give the moved block PCT percent of the split (default 50) + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Swap the layout positions of two visible blocks +export complete [rex swap] [ + block: by "nu-complete rex blocks" # First block + other: by "nu-complete rex blocks" # Second block + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Resize a block +export complete [rex resize] [ + block?: by "nu-complete rex blocks" # Block to resize + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Resources: session ─────────────────────────────────────────────────────── + +# Manage sessions +export complete [rex session] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Create a session +export complete [rex session new] [ + label?: text # Label for the new session + --cwd(-c): path # Working directory for the terminal + --keep-open # Keep the terminal open after its command exits + --shell: text # Run COMMAND through SHELL's login environment + --interactive # Read the shell's interactive startup files too + --window: text # Label for the first window + --json # Output the created session as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity + ...command: text # Command to run (after --) +] + +# List sessions +export complete [rex session ls] [ + --json # Output sessions as JSON + --quiet(-q) # Print IDs only + --short # Show short IDs (default true) + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List sessions (alias) +export complete [rex session list] [ + --json + --quiet(-q) + --short + --help(-h) + --server(-S): text + --client(-C): text + --autostart + --timeout: text + --color: words [auto always never] + --verbose(-v) +] + +# Inspect a session +export complete [rex session inspect] [ + session?: by "nu-complete rex sessions" # Session to inspect + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Rename a session +export complete [rex session rename] [ + session?: by "nu-complete rex sessions" # Session to rename + name?: text # New name + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Move a session +export complete [rex session move] [ + session?: by "nu-complete rex sessions" # Session to move + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Kill sessions +export complete [rex session kill] [ + ...sessions: by "nu-complete rex sessions" # Sessions to kill + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Resources: window ──────────────────────────────────────────────────────── + +# Manage windows +export complete [rex window] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Create a window +export complete [rex window new] [ + label?: text # Label for the new window + --session(-s): by "nu-complete rex sessions" # Scope to session + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List windows +export complete [rex window ls] [ + --session(-s): by "nu-complete rex sessions" # Scope to session + --json # Output as JSON + --quiet(-q) # Print IDs only + --short # Show short IDs + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List windows (alias) +export complete [rex window list] [ + --session(-s): by "nu-complete rex sessions" + --json + --quiet(-q) + --short + --help(-h) + --server(-S): text + --client(-C): text + --autostart + --timeout: text + --color: words [auto always never] + --verbose(-v) +] + +# Inspect a window +export complete [rex window inspect] [ + window?: by "nu-complete rex windows" # Window to inspect + --session(-s): by "nu-complete rex sessions" # Scope to session + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Focus a window +export complete [rex window focus] [ + window?: by "nu-complete rex windows" # Window to focus + --session(-s): by "nu-complete rex sessions" # Scope to session + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Move a window +export complete [rex window move] [ + window?: by "nu-complete rex windows" # Window to move + --session(-s): by "nu-complete rex sessions" # Scope to session + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Rename a window +export complete [rex window rename] [ + window?: by "nu-complete rex windows" # Window to rename + name?: text # New name + --session(-s): by "nu-complete rex sessions" # Scope to session + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Close windows +export complete [rex window close] [ + ...windows: by "nu-complete rex windows" # Windows to close + --session(-s): by "nu-complete rex sessions" # Scope to session + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Resources: block ───────────────────────────────────────────────────────── + +# Manage blocks +export complete [rex block] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Create a block +export complete [rex block new] [ + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --split: words [right: "Place the new block to the right" left: "Place the new block to the left" above: "Place the new block above" below: "Place the new block below"] # Split direction + --ratio: text # Split ratio + --block(-b): by "nu-complete rex blocks" # Anchor block + --label: text # Label for the new block + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List blocks +export complete [rex block ls] [ + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --json # Output as JSON + --quiet(-q) # Print IDs only + --short # Show short IDs + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List blocks (alias) +export complete [rex block list] [ + --session(-s): by "nu-complete rex sessions" + --window(-w): by "nu-complete rex windows" + --json + --quiet(-q) + --short + --help(-h) + --server(-S): text + --client(-C): text + --autostart + --timeout: text + --color: words [auto always never] + --verbose(-v) +] + +# Inspect a block +export complete [rex block inspect] [ + block?: by "nu-complete rex blocks" # Block to inspect + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Focus a block +export complete [rex block focus] [ + block?: by "nu-complete rex blocks" # Block to focus + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List block types +export complete [rex block types] [ + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Send input to a terminal block +export complete [rex block send] [ + block?: by "nu-complete rex blocks" # Block to send to + text?: text # Text to send + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Send key presses to a terminal block +export complete [rex block send-key] [ + block?: by "nu-complete rex blocks" # Block to send keys to + ...keys: text # Key presses + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --action: words [press release repeat] # Key action + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Capture a block's terminal output +export complete [rex block capture] [ + block?: by "nu-complete rex blocks" # Block to capture + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --format: words [text: "Plain text (default)" html: "Styled HTML" vt: "Terminal control sequences"] # Output format + --trim # Remove trailing blank lines + --unwrap # Join soft-wrapped lines + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Zoom a block +export complete [rex block zoom] [ + block?: by "nu-complete rex blocks" # Block to zoom + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --on # Enable zoom + --off # Disable zoom + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Move a block next to another +export complete [rex block move] [ + block?: by "nu-complete rex blocks" # Block to move + direction?: words [right: "Place the new block to the right" left: "Place the new block to the left" above: "Place the new block above" below: "Place the new block below"] # Direction + anchor?: by "nu-complete rex blocks" # Anchor block + --ratio: text # Split ratio + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Swap two blocks +export complete [rex block swap] [ + block: by "nu-complete rex blocks" # First block + other: by "nu-complete rex blocks" # Second block + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Stream block data +export complete [rex block stream] [ + block?: by "nu-complete rex blocks" # Block to stream + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Call a block method +export complete [rex block call] [ + block?: by "nu-complete rex blocks" # Block to call on + method?: text # Method name + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Rename a block +export complete [rex block rename] [ + block?: by "nu-complete rex blocks" # Block to rename + name?: text # New name + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Close blocks +export complete [rex block close] [ + ...blocks: by "nu-complete rex blocks" # Blocks to close + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Resources: client ──────────────────────────────────────────────────────── + +# Manage clients +export complete [rex client] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List clients +export complete [rex client ls] [ + --json # Output as JSON + --quiet(-q) # Print IDs only + --short # Show short IDs + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List clients (alias) +export complete [rex client list] [ + --json + --quiet(-q) + --short + --help(-h) + --server(-S): text + --client(-C): text + --autostart + --timeout: text + --color: words [auto always never] + --verbose(-v) +] + +# Inspect a client +export complete [rex client inspect] [ + client?: text # Client to inspect + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Automation ─────────────────────────────────────────────────────────────── + +# Stream server events as they occur +export complete [rex events] [ + --session(-s): by "nu-complete rex sessions" # Scope to session + --all # Follow every server event including clients + --json # Output events as newline-delimited JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Wait for a block, window, or session to end +export complete [rex wait] [ + target?: text # Block, window, or session to wait for + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --for: text # Give up after DURATION + --json # Output the terminating payload as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Inspect and call the server API +export complete [rex api] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Call a server API method +export complete [rex api call] [ + method?: text # API method name + --session(-s): by "nu-complete rex sessions" # Scope to session + --window(-w): by "nu-complete rex windows" # Scope to window + --block(-b): by "nu-complete rex blocks" # Target block + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List server API methods +export complete [rex api list] [ + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List server API methods (alias) +export complete [rex api ls] [ + --json + --help(-h) + --server(-S): text + --client(-C): text + --autostart + --timeout: text + --color: words [auto always never] + --verbose(-v) +] + +# Describe a server API method +export complete [rex api describe] [ + method?: text # API method to describe + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List actions a client or the server offers +export complete [rex actions] [ + --json # Output actions as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Server ─────────────────────────────────────────────────────────────────── + +# Manage the Rex server +export complete [rex server] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Run a foreground server +export complete [rex server run] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Start a persistent server +export complete [rex server start] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Show server status +export complete [rex server status] [ + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Show detached server logs +export complete [rex server logs] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Manage the server's Tailscale node +export complete [rex server tailscale] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Stop the server +export complete [rex server stop] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Start your server at boot and keep it running +export complete [rex server install] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Stop starting your server on its own +export complete [rex server uninstall] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Config ─────────────────────────────────────────────────────────────────── + +# Work with Rex's config file +export complete [rex config] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Load the config file and report what it found +export complete [rex config check] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Make the server read the config file again +export complete [rex config reload] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Keymap ─────────────────────────────────────────────────────────────────── + +# Show what each key does +export complete [rex keymap] [ + --request: path # Send the client.keymap request in FILE + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Login server ───────────────────────────────────────────────────────────── + +# Run the multi-account login server +export complete [rex login-server] [ + --listen: text # Listen on the root-only Unix ENDPOINT + --extra-listen: text # Also listen on another ENDPOINT (repeatable) + --allow-anonymous # Admit anonymous callers on plain TCP + --tailscaled-socket: path # Path to tailscaled LocalAPI socket + --accounts: path # Map callers to accounts with this HuJSON FILE + --runtime-root: path # Keep socket and accounts below DIR + --pam # Open PAM sessions (default true) + --pam-service: text # PAM policy service NAME (default rex-login-server) + --log-format: words [text json] # Log format: text or json + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Home ───────────────────────────────────────────────────────────────────── + +# Show or choose your home server +export complete [rex home] [ + --json # Output home and identity as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Follow ENDPOINT for hosts and shortcuts +export complete [rex home set] [ + endpoint?: text # Endpoint to follow + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Follow this machine again +export complete [rex home unset] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Hosts ──────────────────────────────────────────────────────────────────── + +# List and change your hosts +export complete [rex hosts] [ + --json # Output hosts as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# List your hosts +export complete [rex hosts list] [ + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Add a host +export complete [rex hosts add] [ + label?: text # Label for the host + address?: text # Address of the host + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Edit a host +export complete [rex hosts edit] [ + label?: text # Host label to edit + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Remove a host +export complete [rex hosts remove] [ + label?: text # Host label to remove + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Check which hosts can be reached +export complete [rex hosts check] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Whoami ─────────────────────────────────────────────────────────────────── + +# Show your identity, server, and Rex location +export complete [rex whoami] [ + --json # Output as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Completion ─────────────────────────────────────────────────────────────── + +# Generate shell completion scripts +export complete [rex completion] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Generate Bash completion +export complete [rex completion bash] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Generate Zsh completion +export complete [rex completion zsh] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Generate Fish completion +export complete [rex completion fish] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Generate PowerShell completion +export complete [rex completion powershell] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Generate Nushell completion +export complete [rex completion nu] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Terminfo ───────────────────────────────────────────────────────────────── + +# Set up and report Rex's terminal type +export complete [rex terminfo] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Report the TERM a new terminal would be given +export complete [rex terminfo status] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Install Rex's terminfo entry and ssh guard +export complete [rex terminfo setup] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Remove the ssh guard +export complete [rex terminfo remove] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Print the terminfo source +export complete [rex terminfo show] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Install Rex's terminfo entry on other machines +export complete [rex terminfo host] [ + ...hosts: text # Hosts to install on + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Skill ──────────────────────────────────────────────────────────────────── + +# Set up agents (Claude Code, Codex, etc.) to use Rex +export complete [rex skill] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Report whether Rex's skill and hooks are installed +export complete [rex skill status] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Install Rex's skill and hooks into agents +export complete [rex skill setup] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Remove Rex's skill and hooks from agents +export complete [rex skill remove] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# Print the guide that Rex's skill gives agents +export complete [rex skill show] [ + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + +# ── Version ────────────────────────────────────────────────────────────────── + +# Print version information +export complete [rex version] [ + --json # Output version as JSON + --help(-h) # Show help + --server(-S): text # Connect to SERVER + --client(-C): text # Act on client CLIENT + --autostart # Start a missing local server (default true) + --timeout: text # Limit each request to DURATION (default 10s) + --color: words [auto always never] # Set color output + --verbose(-v) # Increase diagnostic verbosity +] + diff --git a/custom-completions/rg/rg-completions.nu b/custom-completions/rg/rg-completions.nu index 20c420e9a..00885e358 100644 --- a/custom-completions/rg/rg-completions.nu +++ b/custom-completions/rg/rg-completions.nu @@ -1,72 +1,131 @@ -# This are completions for most of the flags of `ripgrep` -# There are some missing flags, but I prefer to have less flags in the completion -# given that rg has currently (14.1.0) has 103 flags +# nu-version: 0.116.2 +# Declarative completions for ripgrep 15.x, generated from `rg -h` and tuned by hand. +# Load with `use rg-completions.nu *`. -# ripgrep (rg) recursively searches the current directory for lines matching a regex pattern -export extern "rg" [ - pattern?: string # file to print / concatenate. Use `-` to read from stdin - --help # Print help (see a summary with '-h') - -h # Print help (see more with '--help') - --version # Print version - --regexp(-e): string # A pattern to search for - --file(-f): path # Search for patterns from the given file - --pre: string # For each input PATH, this flag causes ripgrep to search the standard output of COMMAND PATH instead of the contents of PATH - --pre-glob: string # Include or exclude files from a preprocessor - --search-zip(-z) # Search in compressed files - --case-sensitive(-s) # Execute the search case sensitively. This is the default mode - --crfl # Use CRLF line terminators (nice for Windows) - --dfa-size-limit: number # The upper size limit of the regex DFA - --encoding(-E): string # Specify the text encoding that ripgrep will use on all files searched. The default value is auto - --engine: string@"nu-complete regex-engine" # Specify which regular expression engine to use - --fixed-strings(-F) # Treat all patterns as literals instead of as regular expressions - --ignore-case(-i) # Case insensitive match - --invert-match(-v) # This flag inverts matching. That is, instead of printing lines that match, ripgrep will print lines that don't match - --line-regexp(-x) # This is equivalent to surrounding every pattern with ^ and $ - --max-count(-m): number # Limit the number of matching lines per file searched to NUM - --mmap # When enabled, ripgrep will search using memory maps when possible. This is enabled by default when ripgrep thinks it will be faster - --multiline(-U) # This flag enable searching across multiple lines - --multiline-dotall # This flag enables "dot all" mode in all regex patterns. This causes . to match line terminators when multiline searching is enabledThis flag enable searching across multiple lines - --no-unicode # This flag disables Unicode mode for all patterns given to ripgrep - --null-data # Enabling this flag causes ripgrep to use NUL as a line terminator instead of the default of \n - --pcre2(-P) # When this flag is present, ripgrep will use the PCRE2 regex engine instead of its default regex engine - --regex-size-limit: string # NUM+SUFFIX? The size limit of the compiled regex - --smart-case(-S) # This flag instructs ripgrep to searches case insensitively if the pattern is all lowercase - --stop-on-nonmatch # Enabling this option will cause ripgrep to stop reading a file once it encounters a non-matching line after it has encountered a matching line - --text(-a) # This flag instructs ripgrep to search binary files as if they were text - --threads(-j): number # This flag sets the approximate number of threads to use - --word-regexp(-w) # This is equivalent to surrounding every pattern with \b{start-half} and \b{end-half} - --binary # Enabling this flag will cause ripgrep to search binary files - --follow(-L) # This flag instructs ripgrep to follow symbolic links while traversing directories - --glob(-g): string # Include or exclude files and directories for searching that match the given glob - --glob-case-insensitive # Process all glob patterns case insensitively - --hidden(-.) # Search hidden files and directories. By default, hidden files and directories are skipped - --iglob: string # Include/exclude paths case insensitively - --ignore-file: path # Specify additional ignore files - --ignore-file-case-insensitive # Process ignore files case insensitively - --max-depth(-d): number # Descend at most NUM directories - --max-filesize: number # Ignore files larger than NUM in size - --no-ignore # Don't use ignore files - --type(-t): string # Only search files matching TYPE - --type-not(-T): string # Do not search files matching TYPE - --after-context(-A): number # Show NUM lines after each match - --before-context(-B): number # Show NUM lines before each match - --context(-C): number # Show NUM lines before and after each match - --no-line-number(-N) # Suppress line numbers - --replace(-r): string # Replace matches with the given text - --only-matching(-o) # Print only matched parts of a line - --sort: string@"nu-complete sort-options" # Sort results in ascending order - --sortr: string@"nu-complete sort-options" # Sort results in descending order - --count(-c) # Show count of matching lines for each file - --count-matches # Show count of every match for each file - --files-with-matches(-l) # Print the paths with at least one match - --files-without-match # Print the paths that contain zero matches - --json # Show search results in a JSON Lines format -] - -def "nu-complete regex-engine" [] { - ['default', 'pcre2', 'auto'] +# The file types ripgrep knows (`rg --type-list`), each described by its globs. +@non-destructive +export def "nu-complete rg types" [...rest: string]: nothing -> list<record<value: string, description: string>> { + try { + ^rg --type-list | lines | parse '{value}: {description}' + } catch { [] } } -def "nu-complete sort-options" [] { - ['none', 'path', 'modified', 'accessed', 'created'] -} \ No newline at end of file +# Recursively search the current directory for lines matching a regex pattern. +export complete [rg] [ + --regexp(-e): text # A pattern to search for. + --file(-f): path # Search for patterns from the given file. + --pre: command # Search output of COMMAND for each PATH. + --pre-glob: text # Include or exclude files from a preprocessor. + --search-zip(-z) # Search in compressed files. + --case-sensitive(-s) # Search case sensitively (default). + --crlf # Use CRLF line terminators (nice for Windows). + --dfa-size-limit: text # The upper size limit of the regex DFA. + --encoding(-E): words [auto none utf-8 utf-16 utf-16le utf-16be latin1 windows-1252 shift_jis euc-jp gbk big5 euc-kr] # Specify the text encoding of files to search. + --engine: words [default: "Rust regex engine" pcre2: "PCRE2 (lookaround, backreferences)" auto: "Pick per pattern"] # Specify which regex engine to use. + --fixed-strings(-F) # Treat all patterns as literals. + --ignore-case(-i) # Case insensitive search. + --invert-match(-v) # Invert matching. + --line-regexp(-x) # Show matches surrounded by line boundaries. + --max-count(-m): text # Limit the number of matching lines. + --mmap # Search with memory maps when possible. + --multiline(-U) # Enable searching across multiple lines. + --multiline-dotall # Make '.' match line terminators. + --no-unicode # Disable Unicode mode. + --null-data # Use NUL as a line terminator. + --pcre2(-P) # Enable PCRE2 matching. + --regex-size-limit: text # The size limit of the compiled regex. + --smart-case(-S) # Smart case search. + --stop-on-nonmatch # Stop searching after a non-match. + --text(-a) # Search binary files as if they were text. + --threads(-j): text # Set the approximate number of threads to use. + --word-regexp(-w) # Show matches surrounded by word boundaries. + --auto-hybrid-regex # (DEPRECATED) Use PCRE2 if appropriate. + --no-pcre2-unicode # (DEPRECATED) Disable Unicode mode for PCRE2. + --binary # Search binary files. + --follow(-L) # Follow symbolic links. + --glob(-g): text # Include or exclude file paths. + --glob-case-insensitive # Process all glob patterns case insensitively. + --hidden # Search hidden files and directories. + --iglob: text # Include/exclude paths case insensitively. + --ignore-file: path # Specify additional ignore files. + --ignore-file-case-insensitive # Process ignore files case insensitively. + --max-depth(-d): text # Descend at most NUM directories. + --max-filesize: text # Ignore files larger than NUM in size. + --no-ignore # Don't use ignore files. + --no-ignore-dot # Don't use .ignore or .rgignore files. + --no-ignore-exclude # Don't use local exclusion files. + --no-ignore-files # Don't use --ignore-file arguments. + --no-ignore-global # Don't use global ignore files. + --no-ignore-parent # Don't use ignore files in parent directories. + --no-ignore-vcs # Don't use ignore files from source control. + --no-require-git # Use .gitignore outside of git repositories. + --one-file-system # Skip directories on other file systems. + --type(-t): by "nu-complete rg types" # Only search files matching TYPE. + --type-not(-T): by "nu-complete rg types" # Do not search files matching TYPE. + --type-add: text # Add a new glob for a file type. + --type-clear: by "nu-complete rg types" # Clear globs for a file type. + --unrestricted(-u) # Reduce the level of "smart" filtering. + --after-context(-A): text # Show NUM lines after each match. + --before-context(-B): text # Show NUM lines before each match. + --block-buffered # Force block buffering. + --byte-offset(-b) # Print the byte offset for each matching line. + --color: words [never auto always ansi] # When to use color. + --colors: text # Configure color settings and styles. + --column # Show column numbers. + --context(-C): text # Show NUM lines before and after each match. + --context-separator: text # Set the separator for contextual chunks. + --field-context-separator: text # Set the field context separator. + --field-match-separator: text # Set the field match separator. + --heading # Print matches grouped by each file. + --help(-h) # Show help output. + --hostname-bin: text # Run a program to get this system's hostname. + --hyperlink-format: words [default none file grep+ kitty macvim textmate vscode vscode-insiders vscodium] # Set the format of hyperlinks. + --include-zero # Include zero matches in summary output. + --line-buffered # Force line buffering. + --line-number(-n) # Show line numbers. + --no-line-number(-N) # Suppress line numbers. + --max-columns(-M): text # Omit lines longer than this limit. + --max-columns-preview # Show preview for lines exceeding the limit. + --null(-0) # Print a NUL byte after file paths. + --only-matching(-o) # Print only matched parts of a line. + --path-separator: text # Set the path separator for printing paths. + --passthru # Print both matching and non-matching lines. + --pretty(-p) # Alias for colors, headings and line numbers. + --quiet(-q) # Do not print anything to stdout. + --replace(-r): text # Replace matches with the given text. + --sort: words [none path modified accessed created] # Sort results in ascending order. + --sortr: words [none path modified accessed created] # Sort results in descending order. + --trim # Trim prefix whitespace from matches. + --vimgrep # Print results in a vim compatible format. + --with-filename(-H) # Print the file path with each matching line. + --no-filename(-I) # Never print the path with each matching line. + --sort-files # (DEPRECATED) Sort results by file path. + --count(-c) # Show count of matching lines for each file. + --count-matches # Show count of every match for each file. + --files-with-matches(-l) # Print the paths with at least one match. + --files-without-match # Print the paths that contain zero matches. + --json # Show search results in a JSON Lines format. + --debug # Show debug messages. + --no-ignore-messages # Suppress gitignore parse error messages. + --no-messages # Suppress some error messages. + --stats # Print statistics about the search. + --trace # Show trace messages. + --files # Print each file that would be searched. + --generate: words [man complete-bash complete-zsh complete-fish complete-powershell] # Generate man pages and completion scripts. + --no-config # Never read configuration files. + --pcre2-version # Print the version of PCRE2 that ripgrep uses. + --type-list # Show all supported file types. + --version(-V) # Print ripgrep's version. + pattern?: text # The regex to search for (unless -e or -f is given) + ...paths: path # Files and directories to search +] where { + at-most-one [--ignore-case --case-sensitive --smart-case] + at-most-one [--files-with-matches --files-without-match --count --count-matches --files] + at-most-one [--json --vimgrep --heading] + at-most-one [--line-number --no-line-number] + at-most-one [--with-filename --no-filename] + at-most-one [--sort --sortr] + at-most-one [--fixed-strings --pcre2] + at-most-one [--json --replace] + terminal [--help --version --type-list --pcre2-version --generate] +} diff --git a/custom-completions/rsync/rsync-completions.nu b/custom-completions/rsync/rsync-completions.nu new file mode 100644 index 000000000..7b80155c2 --- /dev/null +++ b/custom-completions/rsync/rsync-completions.nu @@ -0,0 +1,192 @@ +# nu-version: 0.116.2 +# Declarative completions for rsync 3.x (flags from `rsync --help`). `bundled-v1` lets `rsync -avz` +# count as `-a -v -z` for the rules below. Load with `use rsync-completions.nu *`. + +# The `--info` flags, read live from this rsync when possible. +@non-destructive +export def "nu-complete rsync info" [...rest: string]: nothing -> list<record<value: string, description: string>> { + try { + ^rsync --info=help | lines | parse --regex '^(?<value>[A-Z0-9]+)\s+(?<description>.+)$' | update value { str lowercase } + } catch { [] } +} + +# The `--debug` flags, read live from this rsync when possible. +@non-destructive +export def "nu-complete rsync debug" [...rest: string]: nothing -> list<record<value: string, description: string>> { + try { + ^rsync --debug=help | lines | parse --regex '^(?<value>[A-Z0-9]+)\s+(?<description>.+)$' | update value { str lowercase } + } catch { [] } +} + +# The checksum algorithms this rsync was built with (`rsync --version`). +@non-destructive +export def "nu-complete rsync checksums" [...rest: string]: nothing -> list<string> { + try { + ^rsync --version | lines | skip until {|l| $l =~ '^Checksum list' } | get 1 | str replace --all --regex '\(.*?\)' '' | split row ' ' | where $it != '' + } catch { [xxh128 xxh3 xxh64 md5 md4 sha1 none] } +} + +# Synchronise files and directories, locally or over a remote shell. +export complete [rsync] profile bundled-v1 [ + --verbose(-v) # Increase verbosity + --info: by "nu-complete rsync info" # Fine-grained informational verbosity + --debug: by "nu-complete rsync debug" # Fine-grained debug verbosity + --stderr: words [errors all client] # Change stderr output mode: errors, all or client + --quiet(-q) # Suppress non-error messages + --no-motd # Suppress the daemon's message of the day + --checksum(-c) # Skip files on checksum, not modification time and size + --archive(-a) # Archive mode: -rlptgoD + --recursive(-r) # Recurse into directories + --relative(-R) # Use relative path names + --no-implied-dirs # Do not send implied directories with --relative + --backup(-b) # Make backups of replaced files + --backup-dir: dir # Make backups into this directory + --suffix: text # Backup suffix + --update(-u) # Skip files that are newer on the receiver + --inplace # Update destination files in place + --append # Append data onto shorter files + --append-verify # Append, checking the old data + --dirs(-d) # Transfer directories without recursing + --mkpath # Create the missing parts of the destination path + --links(-l) # Copy symlinks as symlinks + --copy-links(-L) # Copy what symlinks point to + --copy-unsafe-links # Copy the targets of unsafe symlinks only + --safe-links # Ignore symlinks that point outside the tree + --copy-dirlinks(-k) # Copy what symlinks to directories point to + --keep-dirlinks(-K) # Keep symlinked directories on the receiver + --hard-links(-H) # Preserve hard links + --perms(-p) # Preserve permissions + --executability(-E) # Preserve executability + --chmod: text # Change the permissions of transferred files + --acls(-A) # Preserve ACLs + --xattrs(-X) # Preserve extended attributes + --owner(-o) # Preserve the owner + --group(-g) # Preserve the group + --devices # Preserve device files + --specials # Preserve special files + -D # Same as --devices --specials + --times(-t) # Preserve modification times + --atimes(-U) # Preserve access times + --omit-dir-times(-O) # Omit directories from --times + --super # Make the receiver attempt super-user activities + --sparse(-S) # Turn sequences of nulls into sparse blocks + --dry-run(-n) # Show what would be done, and change nothing + --whole-file(-W) # Copy whole files, without the delta algorithm + --one-file-system(-x) # Do not cross filesystem boundaries + --block-size(-B): text # Fixed checksum block size + --rsh(-e): words [ssh rsh "ssh -p"] # Remote shell to use + --rsync-path: text # The rsync to run on the remote machine + --existing # Skip creating new files on the receiver + --ignore-existing # Skip updating files that exist on the receiver + --remove-source-files # Remove synchronised source files + --delete # Delete files from the destination that the source lacks + --delete-before # Delete before the transfer + --delete-during # Delete during the transfer + --delete-delay # Find deletions during, delete after + --delete-after # Delete after the transfer + --delete-excluded # Also delete excluded files from the destination + --ignore-errors # Delete even if there are I/O errors + --force # Delete directories even if not empty + --max-delete: text # Delete no more than this many files + --max-size: text # Transfer no file larger than this + --min-size: text # Transfer no file smaller than this + --partial # Keep partially transferred files + --partial-dir: dir # Keep partially transferred files in this directory + --delay-updates # Put all updated files into place at the end + --prune-empty-dirs(-m) # Prune empty directory chains from the file list + --numeric-ids # Do not map uid/gid values by name + --usermap: text # Custom user name mapping + --groupmap: text # Custom group name mapping + --chown: users # Set the owner and group of transferred files: USER:GROUP + --timeout: text # I/O timeout in seconds + --contimeout: text # Daemon connection timeout in seconds + --ignore-times(-I) # Do not skip files that match in size and time + --size-only # Skip files that match in size + --modify-window: text # Accuracy for modification times + --temp-dir(-T): dir # Create temporary files in this directory + --fuzzy(-y) # Find a similar file for the delta basis + --compare-dest: dir # Also compare against this directory + --copy-dest: dir # Like --compare-dest, copying unchanged files from it + --link-dest: dir # Hard link unchanged files to this directory + --compress(-z) # Compress data during the transfer + --compress-level: text # Compression level + --skip-compress: text # Suffixes of files not to compress + --cvs-exclude(-C) # Ignore files the way CVS does + --filter(-f): text # Add a file-filtering rule + -F # Read per-directory .rsync-filter files + --exclude: text # Exclude files that match the pattern + --exclude-from: path # Read exclude patterns from a file + --include: text # Do not exclude files that match the pattern + --include-from: path # Read include patterns from a file + --files-from: path # Read the list of source files from a file + --from0(-0) # Read lists with NUL, not newline, as separator + --old-args # Disable the modern argument-protection idiom + --secluded-args(-s) # Send arguments over the protocol, not the shell + --trust-sender # Trust the remote sender's file list + --copy-as: users # Run the transfer as this user[:group] + --address: text # Local address to bind to + --port: text # Port of the daemon to connect to + --sockopts: text # Socket options + --blocking-io # Use blocking I/O for the remote shell + --outbuf: words [None Line Block] # Buffering of output: none, line or block + --stats # Show file-transfer statistics + --human-readable(-h) # Output numbers in a human-readable format + --progress # Show progress during the transfer + -P # Same as --partial --progress + --itemize-changes(-i) # Output a change summary for all updates + --out-format: text # Output updates in this format + --log-file: path # Log what is done to this file + --log-file-format: text # Format of the log file lines + --password-file: path # Read the daemon password from a file + --list-only # List the files instead of copying them + --bwlimit: text # Limit the I/O bandwidth, in KiB/s + --stop-after: text # Stop after this many minutes + --stop-at: text # Stop at this date and time + --fsync # Fsync every written file + --write-batch: path # Write a batched update to a file + --only-write-batch: path # Write a batched update to a file, and do not update + --read-batch: path # Read a batched update from a file + --protocol: text # Force an older protocol version + --iconv: text # Convert file names between character sets + --ipv4(-4) # Prefer IPv4 + --ipv6(-6) # Prefer IPv6 + --checksum-choice: by "nu-complete rsync checksums" # Checksum algorithm + --version(-V) # Show the version and exit + --old-dirs # Works like --dirs when talking to old rsync + --inc-recursive # Enable incremental recursion + --no-inc-recursive # Disable incremental recursion + --insecure-links # Follow attacker-owned symlinks in operator paths + --confine-root: dir # Refuse operator paths resolving outside DIR + --munge-links # Munge symlinks to make them safe & unusable + --copy-devices # Copy device contents as a regular file + --write-devices # Write to devices as files (implies --inplace) + --open-noatime # Avoid changing the atime on opened files + --crtimes(-N) # Preserve create times (newness) + --omit-link-times(-J) # Omit symlinks from --times + --fake-super # Store/recover privileged attrs using xattrs + --preallocate # Allocate dest files before writing them + --no-whole-file # Use the delta-xfer algorithm + --ignore-non-existing # Skip creating new files on receiver + --del # An alias for --delete-during + --ignore-missing-args # Ignore missing source arguments without error + --delete-missing-args # Delete missing source arguments from destination + --max-alloc: text # Change a limit relating to memory alloc + --compress-choice: words [zstd lz4 zlibx zlib none] # Choose the compression algorithm + --compress-threads: text # Explicitly set compression threads + --8-bit-output(-8) # Leave high-bit chars unescaped in output + --remote-option(-M): text # Send OPTION to the remote side only + --early-input: path # Use FILE for daemon's early exec input + --checksum-seed: text # Set block/file checksum seed (advanced) + --help # Show this help + ...paths: path # Sources, then the destination: a path, or [user@]host:path +] where { + at-most-one [--delete-before --delete-during --delete-delay --delete-after --del] + at-most-one [--quiet --verbose] + at-most-one [--ipv4 --ipv6] + at-most-one [--whole-file --no-whole-file] + at-most-one [--inc-recursive --no-inc-recursive] + at-most-one [--existing --ignore-existing] + at-most-one [--write-batch --only-write-batch --read-batch] + at-most-one [--links --copy-links] + terminal [--help --version] +} diff --git a/custom-completions/rustup/rustup-completions.nu b/custom-completions/rustup/rustup-completions.nu index 2055eff67..397b726e6 100644 --- a/custom-completions/rustup/rustup-completions.nu +++ b/custom-completions/rustup/rustup-completions.nu @@ -1,52 +1,29 @@ -# ------------------ helpers ------------------ +# rustup — the Rust toolchain installer. +# Declarative completions (`export complete`), verified against `rustup --help` (rustup 1.29). +# Providers run rustup with RUSTUP_AUTO_INSTALL=0, so completing never installs a toolchain. -const CHANNELS = [stable beta nightly] +# ------------------ live providers ------------------ -# Crates whose docs `rustup doc` finds by topic path -const DOC_CRATES = [std core alloc test] - -# A `name` or `name (status, ...)` line from rustup's list commands -const STATUS_LINE = '^(?<value>\S+)(?: \((?<description>[^)]+)\))?$' - -# Lines rustup prints for `args`, or none when it fails, so completion never shows its errors +# Lines rustup prints for `args`, or none when it fails, so completion never shows its errors. +# A toolchain name typed on the line must never start a download, so auto-install is off. def --wrapped rustup-lines [...args: string]: nothing -> list<string> { - # A toolchain name typed on the line must never start a download from `<tab>` - $env.RUSTUP_AUTO_INSTALL = '0' - let result = ^rustup ...$args | complete + let result = with-env {RUSTUP_AUTO_INSTALL: '0'} { ^rustup ...$args | complete } if $result.exit_code == 0 { $result.stdout | lines } else { [] } } -# Rows parsed from a rustup list command that prints `name (status)` lines -def --wrapped status-rows [...args: string]: nothing -> table { - rustup-lines ...$args | parse --regex $STATUS_LINE -} - -def installed-toolchains []: nothing -> table { - status-rows toolchain list | default 'installed' description +# `--toolchain <name>` for rustup, when a toolchain was given on the line. +def toolchain-args [toolchain?: string]: nothing -> list<string> { + if ($toolchain | is-empty) { [] } else { [--toolchain $toolchain] } } -def installable-toolchains []: nothing -> table { - installed-toolchains - | append ($CHANNELS | each {|channel| {value: $channel, description: 'release channel'} }) +# Rows of a rustup list command that prints `name` or `name (status, ...)` lines. +def --wrapped status-rows [...args: string]: nothing -> table<name: string, flags: string> { + rustup-lines ...$args + | parse --regex '^(?<name>\S+)(?: \((?<flags>[^)]*)\))?$' + | each {|row| {name: $row.name, flags: ($row.flags | default '')} } } -# Completions read from rustup's current state, kept out of nushell's cross-prompt -# completion cache so installs and removals show up on the next `<tab>` -def fresh []: any -> record { - {completions: $in, options: {cache: false}} -} - -# `--toolchain <name>` as typed on the command line being completed -def toolchain-args [tokens: list<string>]: nothing -> list<string> { - $tokens - | window 2 - | where {|pair| $pair.0 == '--toolchain' } - | last 1 - | each {|pair| ['--toolchain' $pair.1] } - | flatten -} - -# Directory `subdir` inside the selected toolchain, or nothing when it doesn't exist +# Directory `subdir` inside the selected toolchain, or nothing when it doesn't exist. def toolchain-dir [toolchain_args: list<string>, ...subdir: string]: nothing -> any { let rustc = rustup-lines which rustc ...$toolchain_args if ($rustc | is-empty) { return null } @@ -54,593 +31,736 @@ def toolchain-dir [toolchain_args: list<string>, ...subdir: string]: nothing -> if ($dir | path exists) { $dir } } -# Names of the entries under `subdir` of the selected toolchain, without extensions +# Names of the entries under `subdir` of the selected toolchain, without extensions. def toolchain-entries [toolchain_args: list<string>, ...subdir: string]: nothing -> list<string> { let dir = toolchain-dir $toolchain_args ...$subdir if $dir == null { return [] } - ls --short-names $dir | get name | path parse | get stem -} - -# Doc topics inside one module directory of the rendered docs, each named after `prefix` -def doc-items [dir: string, prefix: string] { - if not ($dir | path exists) { return [] } - ls --short-names $dir - | each {|entry| - if $entry.type == dir { - # Modules end in `::` and take no space, so another `<tab>` descends into them - {value: $'($prefix)($entry.name)::', description: module, append_whitespace: false} - } else { - # Item pages are `kind.Name.html`; macros also have a `kind.Name!.html` copy, skipped here - $entry.name - | parse --regex '^(?<kind>[a-z]+)\.(?<name>\w+)\.html$' - | where kind not-in [attr attribute derive] - | each {|item| - let suffix = if $item.kind == macro { '!' } else { '' } - {value: $'($prefix)($item.name)($suffix)', description: $item.kind} - } - } - } - | flatten + ls --short-names $dir | get name | path parse | get stem | uniq } -# How `words` complete as a command line of their own, with `toolchain` active -def complete-as [toolchain: string, ...words: string] { - let line = $words | str join ' ' - let token_start = ($line | str length) - ($words | last | str length) - # Completers for the inner command may call cargo or rustc, which must not auto-install either - with-env {RUSTUP_TOOLCHAIN: $toolchain, RUSTUP_AUTO_INSTALL: '0'} { - $line | commandline complete --detailed - } - | each {|suggestion| - # A command name replaces from the command's start; keep only the part under the cursor - let skip = [($token_start - ($suggestion.span?.start? | default $token_start)) 0] | math max - $suggestion | reject --optional span match_indices | update value { str substring $skip.. } - } +# The installed toolchains, one row each: `name`, whether it is the `default` and whether it is +# the `active` one in this directory. Reads only. +@non-destructive +export def rustup-toolchains []: nothing -> table<name: string, default: bool, active: bool> { + try { + status-rows toolchain list + | each {|row| {name: $row.name, default: ($row.flags | str contains 'default'), active: ($row.flags | str contains 'active')} } + } catch { [] } } -# The entry after those already typed in a comma-separated flag value -def comma-list [text: string, candidates: list<string>]: nothing -> list<string> { - let typed = $text | split row ',' | drop - let prefix = $typed | each { $'($in),' } | str join - $candidates | where $it not-in $typed | each { $'($prefix)($in)' } +# The targets a toolchain (the active one by default) can build for, one row each: `name` and +# whether it is `installed`. Reads only. +@non-destructive +export def rustup-targets [toolchain?: string]: nothing -> table<name: string, installed: bool> { + try { + status-rows target list ...(toolchain-args $toolchain) + | each {|row| {name: $row.name, installed: ($row.flags | str contains 'installed')} } + } catch { [] } } -# ------------------ nu-complete commands ------------------ - -def "nu-complete rustup toolchains" [] { - installed-toolchains | fresh +# The components of a toolchain (the active one by default), one row each: `name` and whether it +# is `installed`. +@non-destructive +export def rustup-components [toolchain?: string]: nothing -> table<name: string, installed: bool> { + try { + status-rows component list ...(toolchain-args $toolchain) + | each {|row| {name: $row.name, installed: ($row.flags | str contains 'installed')} } + } catch { [] } } -# Installed toolchains plus the release channels, for the commands that install them -def "nu-complete rustup installable" [] { - installable-toolchains | fresh +# Installed toolchains (default/active marked). +@non-destructive +export def "nu-complete rustup toolchains installed" [] { + try { + rustup-toolchains | each {|t| + {value: $t.name, description: ([(if $t.default { 'default' }) (if $t.active { 'active' })] | compact | str join ', ' | if $in == '' { 'installed' } else { $in })} + } + } catch { [] } } -def "nu-complete rustup default" [] { - installable-toolchains - | append {value: none, description: 'unset the default toolchain'} - | fresh +# Installed toolchains plus the release channels, for commands that install on demand. +@non-destructive +export def "nu-complete rustup toolchains" [] { + try { + let installed = rustup-toolchains | each {|t| {value: $t.name, description: (if $t.default { 'installed, default' } else { 'installed' })} } + let channels = [stable beta nightly] | where {|c| $installed | all {|i| not ($i.value starts-with $c) } } | each {|c| {value: $c, description: 'release channel'} } + $installed ++ $channels + } catch { [stable beta nightly] } } -# The `+toolchain` override, offered only once a `+` is typed so `rustup <tab>` lists commands -def "nu-complete rustup plus-toolchain" [token: record] { - if not ($token.text starts-with '+') { return [] } - installed-toolchains | update value { $'+($in)' } | fresh +# Toolchains accepted by `rustup default`: also `none`. +@non-destructive +export def "nu-complete rustup default" [] { + try { (nu-complete rustup toolchains) ++ [{value: none, description: 'unset the default toolchain'}] } catch { [] } } -def "nu-complete rustup profiles" [] { - [minimal default complete] +# Targets not yet installed in the selected toolchain (for `target add`); `all` installs every target. +@non-destructive +export def "nu-complete rustup targets available" [toolchain?: string] { + try { rustup-targets $toolchain | where not installed | get name | prepend all } catch { [] } } -def "nu-complete rustup targets" [place: record] { - status-rows target list ...(toolchain-args $place.command) | fresh +# Targets installed in the selected toolchain (for `target remove`). +@non-destructive +export def "nu-complete rustup targets installed" [toolchain?: string] { + try { rustup-targets $toolchain | where installed | get name } catch { [] } } -def "nu-complete rustup targets add" [place: record] { - status-rows target list ...(toolchain-args $place.command) - | append {value: all, description: 'every available target'} - | fresh +# Every target of the selected toolchain, installed ones marked. +@non-destructive +export def "nu-complete rustup targets" [toolchain?: string] { + try { rustup-targets $toolchain | each {|t| {value: $t.name, description: (if $t.installed { 'installed' } else { '' })} } } catch { [] } } -def "nu-complete rustup targets installed" [place: record] { - rustup-lines target list --installed --quiet ...(toolchain-args $place.command) | fresh +# Components of the selected toolchain not yet installed (for `component add`). +@non-destructive +export def "nu-complete rustup components available" [toolchain?: string] { + try { rustup-components $toolchain | where not installed | get name } catch { [] } } -def "nu-complete rustup components" [place: record] { - status-rows component list ...(toolchain-args $place.command) | fresh +# Components installed in the selected toolchain (for `component remove`). +@non-destructive +export def "nu-complete rustup components installed" [toolchain?: string] { + try { rustup-components $toolchain | where installed | get name } catch { [] } } -def "nu-complete rustup components installed" [place: record] { - rustup-lines component list --installed --quiet ...(toolchain-args $place.command) | fresh +# Every component of the selected toolchain, installed ones marked. +@non-destructive +export def "nu-complete rustup components" [toolchain?: string] { + try { rustup-components $toolchain | each {|c| {value: $c.name, description: (if $c.installed { 'installed' } else { '' })} } } catch { [] } } -# Components for `--component`, named without the host suffix as rustup's docs spell them -def "nu-complete rustup component-list" [token: record] { - let host = rustup-lines show | parse 'Default host: {host}' | get 0?.host? - let components = rustup-lines component list --quiet - | each {|name| if $host == null { $name } else { $name | str replace --regex $'-($host)$' '' } } - comma-list $token.text $components | fresh +# Components for `--component`, named without the host suffix as rustup's docs spell them. +@non-destructive +export def "nu-complete rustup component names" [] { + try { + let host = rustup-lines show | parse 'Default host: {host}' | get 0?.host? + rustup-lines component list --quiet + | each {|name| if $host == null { $name } else { $name | str replace --regex $'-($host)$' '' } } + } catch { [] } } -def "nu-complete rustup target-list" [token: record] { - comma-list $token.text (rustup-lines target list --quiet) | fresh +# Directories that currently have an override, with the toolchain they use. +@non-destructive +export def "nu-complete rustup overrides" [] { + try { + rustup-lines override list | parse "{value}\t{description}" + } catch { [] } } -# Directories with an override, quoted so a path with spaces stays one argument -def "nu-complete rustup overrides" [] { - rustup-lines override list - | parse "{path}\t{toolchain}" - | each {|override| - {value: ($override.path | to nuon), display_override: $override.path, description: $override.toolchain} - } - | fresh +# Binaries in the selected toolchain's `bin` directory (for `rustup which` and `rustup run`). +@non-destructive +export def "nu-complete rustup binaries" [toolchain?: string] { + try { + toolchain-entries (toolchain-args $toolchain) bin + | if ($in | is-empty) { [cargo rustc rustdoc rust-gdb rust-lldb rust-analyzer rustfmt cargo-fmt cargo-clippy clippy-driver cargo-miri] } else { $in } + } catch { [] } } -def "nu-complete rustup binaries" [place: record] { - toolchain-entries (toolchain-args $place.command) bin | fresh +# Man pages shipped with the selected toolchain (for `rustup man`). +@non-destructive +export def "nu-complete rustup man-pages" [toolchain?: string] { + try { toolchain-entries (toolchain-args $toolchain) share man man1 } catch { [] } } -def "nu-complete rustup man-pages" [place: record] { - toolchain-entries (toolchain-args $place.command) share man man1 | fresh +# Topics for `rustup doc`, read from the selected toolchain's rendered docs: the doc crates and +# their top-level modules, and std's keywords, primitives and macros by bare name. +@non-destructive +export def "nu-complete rustup doc-topics" [toolchain?: string] { + try { + let html = toolchain-dir (toolchain-args $toolchain) share doc rust html + if $html == null { return [] } + let crates = [std core alloc test] | where {|c| ($html | path join $c) | path exists } + let modules = $crates | each {|crate| + ls --short-names ($html | path join $crate) | where type == dir + | each {|dir| {value: $'($crate)::($dir.name)', description: module} } + } | flatten + let bare = ls --short-names ($html | path join std) | where type == file | get name + | parse --regex '^(?<kind>keyword|primitive|macro)\.(?<name>\w+)\.html$' + | each {|item| {value: $'($item.name)(if $item.kind == macro { "!" } else { "" })', description: $item.kind} } + $crates | each {|c| {value: $c, description: crate} } | append $modules | append $bare + } catch { [] } } -# The command for `rustup run`, then its arguments as that command completes them -def "nu-complete rustup run-command" [place: record] { - let args = $place.command | skip 1 - let toolchain_at = $args | enumerate | where not ($it.item starts-with '-') | get 0?.index? - if $toolchain_at == null { return null } - let toolchain = $args | get $toolchain_at - let command = $args | skip ($toolchain_at + 1) - if ($command | length) == 1 { - toolchain-entries [--toolchain $toolchain] bin - } else { - complete-as $toolchain ...$command - } - | fresh -} +# ------------------ specs ------------------ -# Everything after `rustup +toolchain`, completed as the same command without the override -def "nu-complete rustup after-toolchain" [place: record] { - let override = $place.command.1 - if not ($override starts-with '+') { return null } - complete-as ($override | str substring 1..) rustup ...($place.command | skip 2) | fresh +export complete [rustup] [ + --verbose(-v) # Set log level to 'DEBUG' if 'RUSTUP_LOG' is unset + --quiet(-q) # Disable progress output + --help(-h) # Print help + --version(-V) # Print version +] where { + at-most-one [--verbose --quiet] + terminal [--help --version] } -# Topics for `rustup doc`, read from the selected toolchain's rendered docs one `::` level at a time -def "nu-complete rustup doc-topics" [token: record, place: record] { - let html = toolchain-dir (toolchain-args $place.command) share doc rust html - if $html == null { return [] } - let module = $token.text | split row '::' | drop - if ($module | is-empty) { - # rustup looks up keywords, primitives and macros by bare name in std - $DOC_CRATES - | each {|crate| {value: $'($crate)::', description: crate, append_whitespace: false} } - | append (doc-items ($html | path join std) '' | where description in [keyword primitive macro]) - } else { - # rustup finds macros only at a crate's root - doc-items ($html | path join ...$module) ($module | each { $'($in)::' } | str join) - | where ($module | length) == 1 or $it.description != macro - } - | fresh +export complete [rustup help] [ + command?: words [install uninstall toolchain default show update check target component override run which doc man self set completions] +] + +export complete [rustup install] [ + ...toolchain: by "nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' + --profile: words [minimal default complete] + --component(-c): by "nu-complete rustup component names" # Comma-separated list of components to add + --target(-t): by "nu-complete rustup targets" # Comma-separated list of targets to add + --no-self-update # Don't perform self update + --no-update # Don't try to update the installed toolchain + --force # Force an update, even if some components are missing + --allow-downgrade # Allow rustup to downgrade the toolchain + --force-non-host # Install toolchains that require an emulator + --override # Set the installed toolchain as the directory override + --default # Set the installed toolchain as the default + --help(-h) # Print help +] where { + terminal [--help] } -# Subcommands of the rustup command named so far, for `rustup help` and its nested forms -def "nu-complete rustup subcommands" [place: record] { - let parent = $place.command.0 | str replace --regex ' help$' '' - let prefix = $place.command | skip 1 | drop | prepend $parent | append '' | str join ' ' - scope commands - | where name starts-with $prefix - | each {|command| {value: ($command.name | str replace $prefix ''), description: $command.description} } - | where value !~ ' ' -} - -# The flags of a command that takes no positional arguments, so `<tab>` lists them instead of files -def "nu-complete rustup flags" [place: record] { - # Once a `-` is typed, nushell's own flag completion answers - if $place.kind != positional { return null } - let command = scope commands | where name == $place.command.0 - if ($command | is-empty) { return null } - $command.0.signatures - | values - | first - | where parameter_type in [switch named] - | append {parameter_name: help, short_flag: h, description: 'Print help'} - | each {|flag| - [$'--($flag.parameter_name)' ($flag.short_flag | if $in != null { $'-($in)' })] - | compact - | each {|name| {value: $name, description: $flag.description} } - } - | flatten -} - -# ------------------ export extern commands ------------------ - -# The Rust toolchain installer -export extern "rustup" [ - toolchain?: string@"nu-complete rustup plus-toolchain" # Release channel (e.g. +stable) or custom toolchain to set override - ...args: string@"nu-complete rustup after-toolchain" - --verbose(-v) # Set log level to 'DEBUG' if 'RUSTUP_LOG' is unset - --quiet(-q) # Disable progress output, set log level to 'WARN' if 'RUSTUP_LOG' is unset - --help(-h) # Print help - --version(-V) # Print version -] - -# Print the help of rustup or the given subcommand(s) -export extern "rustup help" [ - ...command: string@"nu-complete rustup subcommands" -] +export complete [rustup uninstall] [ + ...toolchain: by "nu-complete rustup toolchains installed" + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup update] [ + ...toolchain: by "nu-complete rustup toolchains" # Toolchains to update (default: all) + --no-self-update # Don't perform self update + --force # Force an update, even if some components are missing + --force-non-host # Install toolchains that require an emulator + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup check] [ + --no-self-update # Don't check for self update + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup default] [ + toolchain?: by "nu-complete rustup default" # 'none' or a toolchain name + --force-non-host # Install toolchains that require an emulator + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup show] [ + --verbose(-v) # Enable verbose output with rustc information for all toolchains + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup show active-toolchain] [ + --verbose(-v) # Enable verbose output + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup show home] [ --help(-h) ] where { terminal [--help] } +export complete [rustup show profile] [ --help(-h) ] where { terminal [--help] } + +export complete [rustup toolchain] [ + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup toolchain list] [ + --verbose(-v) # Enable verbose output with toolchain information + --quiet(-q) # Force the output to be a single column + --help(-h) # Print help +] where { + at-most-one [--verbose --quiet] + terminal [--help] +} -# Install or update the given toolchains, or by default the active toolchain -export extern "rustup install" [ - ...toolchain: string@"nu-complete rustup installable" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' - --profile: string@"nu-complete rustup profiles" - --component(-c): string@"nu-complete rustup component-list" # Comma-separated list of components to be added on installation - --target(-t): string@"nu-complete rustup target-list" # Comma-separated list of targets to be added on installation - --no-self-update # Don't perform self update when running the `rustup toolchain install` command - --no-update # Don't try to update the installed toolchain - --force # Force an update, even if some components are missing - --allow-downgrade # Allow rustup to downgrade the toolchain to satisfy your component choice - --force-non-host # Install toolchains that require an emulator - --override # Set the installed toolchain as the override for the current directory - --default # Set the installed toolchain as the default toolchain - --help(-h) # Print help -] +export complete [rustup toolchain install] [ + ...toolchain: by "nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' + --profile: words [minimal default complete] + --component(-c): by "nu-complete rustup component names" # Comma-separated list of components to add + --target(-t): by "nu-complete rustup targets" # Comma-separated list of targets to add + --no-self-update # Don't perform self update + --no-update # Don't try to update the installed toolchain + --force # Force an update, even if some components are missing + --allow-downgrade # Allow rustup to downgrade the toolchain + --force-non-host # Install toolchains that require an emulator + --override # Set the installed toolchain as the directory override + --default # Set the installed toolchain as the default + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup toolchain uninstall] [ + ...toolchain: by "nu-complete rustup toolchains installed" + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup toolchain link] [ + toolchain: text # Custom toolchain name + path: dir # Path to the directory + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup target] [ + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup target list] [ + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --installed # List only installed targets + --quiet(-q) # Force the output to be a single column + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup target add] [ + ...target: by "nu-complete rustup targets available" [toolchain: --toolchain] # Targets to install; "all" installs all + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup target remove] [ + ...target: by "nu-complete rustup targets installed" [toolchain: --toolchain] + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup component] [ + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup component list] [ + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --installed # List only installed components + --quiet(-q) # Force the output to be a single column + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup component add] [ + ...component: by "nu-complete rustup components available" [toolchain: --toolchain] + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --target: by "nu-complete rustup targets" [toolchain: --toolchain] # Target triple of the component + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup component remove] [ + ...component: by "nu-complete rustup components installed" [toolchain: --toolchain] + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --target: by "nu-complete rustup targets installed" [toolchain: --toolchain] # Target triple of the component + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup override] [ + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup override list] [ --help(-h) ] where { terminal [--help] } + +export complete [rustup override set] [ + toolchain: by "nu-complete rustup toolchains" # Toolchain name + --path: dir # Path to the directory + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup override unset] [ + --path: by "nu-complete rustup overrides" # Path to the directory + --nonexistent # Remove override toolchain for all nonexistent directories + --help(-h) # Print help +] where { + at-most-one [--path --nonexistent] + terminal [--help] +} -# Uninstall the given toolchains -export extern "rustup uninstall" [ - ...toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name - --help(-h) # Print help -] +export complete [rustup run] [ + toolchain: by "nu-complete rustup toolchains" # Toolchain name or absolute path + ...command: command # The command to run with that toolchain + --install # Install the requested toolchain if needed + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup which] [ + command: by "nu-complete rustup binaries" [toolchain: --toolchain] # Binary to locate + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup doc] [ + topic?: by "nu-complete rustup doc-topics" [toolchain: --toolchain] # Topic such as 'core', 'fn', 'std::fs', 'eprintln!' + --path # Only print the path to the documentation + --serve # Serve the documentation over a local HTTP server + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --alloc # The Rust core allocation and collections library + --book # The Rust Programming Language book + --cargo # The Cargo Book + --clippy # The Clippy Documentation + --core # The Rust Core Library + --edition-guide # The Rust Edition Guide + --embedded-book # The Embedded Rust Book + --error-codes # The Rust Error Codes Index + --nomicon # The Dark Arts of Advanced and Unsafe Rust Programming + --proc_macro # A support library for macro authors + --reference # The Rust Reference + --releases # Rust Release Notes + --rust-by-example # A collection of runnable examples + --rustc # The compiler for the Rust programming language + --rustc-docs # The API documentation for the Rust compiler + --rustdoc # Documentation generator for Rust projects + --std # Standard library API documentation + --style-guide # The Rust Style Guide + --test # Support code for rustc's built in test framework + --unstable-book # The Unstable Book + --help(-h) # Print help +] where { + at-most-one [--path --serve] + at-most-one [--alloc --book --cargo --clippy --core --edition-guide --embedded-book --error-codes --nomicon --proc_macro --reference --releases --rust-by-example --rustc --rustc-docs --rustdoc --std --style-guide --test --unstable-book] + terminal [--help] +} -# Install, uninstall, or list toolchains -export extern "rustup toolchain" [ - --help(-h) # Print help -] +export complete [rustup man] [ + command: by "nu-complete rustup man-pages" [toolchain: --toolchain] # Command whose man page to view + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup self] [ --help(-h) ] where { terminal [--help] } +export complete [rustup self update] [ --help(-h) ] where { terminal [--help] } +export complete [rustup self uninstall] [ + --yes(-y) # Disable confirmation prompt + --no-modify-path # Do not clean up the `PATH` environment variable + --help(-h) # Print help +] where { terminal [--help] } +export complete [rustup self upgrade-data] [ --help(-h) ] where { terminal [--help] } + +export complete [rustup set] [ --help(-h) ] where { terminal [--help] } +export complete [rustup set default-host] [ + host_tuple: by "nu-complete rustup targets" # Host tuple used to identify toolchains + --help(-h) # Print help +] where { terminal [--help] } +export complete [rustup set profile] [ + profile_name?: words [minimal default complete] + --help(-h) # Print help +] where { terminal [--help] } +export complete [rustup set auto-self-update] [ + auto_self_update_mode?: words [enable disable check-only] + --help(-h) # Print help +] where { terminal [--help] } +export complete [rustup set auto-install] [ + auto_install_mode?: words [enable disable] + --help(-h) # Print help +] where { terminal [--help] } + +export complete [rustup completions] [ + shell: words [bash elvish fish powershell zsh] + command?: words [rustup cargo] + --help(-h) # Print help +] where { terminal [--help] } + +# ------------------ nested help ------------------ # Print the help of the given toolchain subcommand(s) -export extern "rustup toolchain help" [ - ...command: string@"nu-complete rustup subcommands" -] - -# List installed toolchains -export extern "rustup toolchain list" [ - ...flags: string@"nu-complete rustup flags" - --verbose(-v) # Enable verbose output with toolchain information - --quiet(-q) # Force the output to be a single column - --help(-h) # Print help -] - -# Install or update the given toolchains, or by default the active toolchain -export extern "rustup toolchain install" [ - ...toolchain: string@"nu-complete rustup installable" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' - --profile: string@"nu-complete rustup profiles" - --component(-c): string@"nu-complete rustup component-list" # Comma-separated list of components to be added on installation - --target(-t): string@"nu-complete rustup target-list" # Comma-separated list of targets to be added on installation - --no-self-update # Don't perform self update when running the `rustup toolchain install` command - --no-update # Don't try to update the installed toolchain - --force # Force an update, even if some components are missing - --allow-downgrade # Allow rustup to downgrade the toolchain to satisfy your component choice - --force-non-host # Install toolchains that require an emulator - --override # Set the installed toolchain as the override for the current directory - --default # Set the installed toolchain as the default toolchain - --help(-h) # Print help -] - -# Uninstall the given toolchains -export extern "rustup toolchain uninstall" [ - ...toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name - --help(-h) # Print help -] - -# Create a custom toolchain by symlinking to a directory -export extern "rustup toolchain link" [ - toolchain: string # Custom toolchain name - path: path # Path to the directory - --help(-h) # Print help -] - -# Set the default toolchain -export extern "rustup default" [ - toolchain?: string@"nu-complete rustup default" # 'none', a toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name - --force-non-host # Install toolchains that require an emulator - --help(-h) # Print help -] - -# Show the active and installed toolchains or profiles -export extern "rustup show" [ - --verbose(-v) # Enable verbose output with rustc information for all installed toolchains - --help(-h) # Print help +export complete [rustup toolchain help] [ + command?: words [list install uninstall link help] ] # Print the help of the given show subcommand(s) -export extern "rustup show help" [ - ...command: string@"nu-complete rustup subcommands" -] - -# Show the active toolchain -export extern "rustup show active-toolchain" [ - ...flags: string@"nu-complete rustup flags" - --verbose(-v) # Enable verbose output with rustc information - --help(-h) # Print help -] - -# Display the computed value of RUSTUP_HOME -export extern "rustup show home" [ - ...flags: string@"nu-complete rustup flags" - --help(-h) # Print help -] - -# Show the default profile used for the `rustup install` command -export extern "rustup show profile" [ - ...flags: string@"nu-complete rustup flags" - --help(-h) # Print help -] - -# Update Rust toolchains and rustup -export extern "rustup update" [ - ...toolchain: string@"nu-complete rustup installable" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' - --no-self-update # Don't perform self update when running the `rustup update` command - --force # Force an update, even if some components are missing - --force-non-host # Install toolchains that require an emulator - --help(-h) # Print help -] - -# Check for updates to Rust toolchains and rustup -export extern "rustup check" [ - ...flags: string@"nu-complete rustup flags" - --no-self-update # Don't check for self update when running the `rustup check` command - --help(-h) # Print help -] - -# Modify a toolchain's supported targets -export extern "rustup target" [ - --help(-h) # Print help +export complete [rustup show help] [ + command?: words [active-toolchain home profile help] ] # Print the help of the given target subcommand(s) -export extern "rustup target help" [ - ...command: string@"nu-complete rustup subcommands" -] - -# List installed and available targets -export extern "rustup target list" [ - ...flags: string@"nu-complete rustup flags" - --toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' - --installed # List only installed targets - --quiet(-q) # Force the output to be a single column - --help(-h) # Print help -] - -# Add a target to a Rust toolchain -export extern "rustup target add" [ - ...target: string@"nu-complete rustup targets add" # Targets to install; "all" installs all available targets - --toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' - --help(-h) # Print help -] - -# Remove a target from a Rust toolchain -export extern "rustup target remove" [ - ...target: string@"nu-complete rustup targets installed" # Targets to uninstall - --toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' - --help(-h) # Print help -] - -# Modify a toolchain's installed components -export extern "rustup component" [ - --help(-h) # Print help +export complete [rustup target help] [ + command?: words [list add remove help] ] # Print the help of the given component subcommand(s) -export extern "rustup component help" [ - ...command: string@"nu-complete rustup subcommands" -] - -# List installed and available components -export extern "rustup component list" [ - ...flags: string@"nu-complete rustup flags" - --toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' - --installed # List only installed components - --quiet(-q) # Force the output to be a single column - --help(-h) # Print help -] - -# Add a component to a Rust toolchain -export extern "rustup component add" [ - ...component: string@"nu-complete rustup components" - --toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' - --target: string@"nu-complete rustup targets" # Target to add the component for - --help(-h) # Print help -] - -# Remove a component from a Rust toolchain -export extern "rustup component remove" [ - ...component: string@"nu-complete rustup components installed" - --toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' - --target: string@"nu-complete rustup targets installed" # Target to remove the component for - --help(-h) # Print help -] - -# Modify toolchain overrides for directories -export extern "rustup override" [ - --help(-h) # Print help +export complete [rustup component help] [ + command?: words [list add remove help] ] # Print the help of the given override subcommand(s) -export extern "rustup override help" [ - ...command: string@"nu-complete rustup subcommands" -] - -# List directory toolchain overrides -export extern "rustup override list" [ - ...flags: string@"nu-complete rustup flags" - --help(-h) # Print help -] - -# Set the override toolchain for a directory -export extern "rustup override set" [ - toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name - --path: path # Path to the directory - --help(-h) # Print help -] - -# Remove the override toolchain for a directory -export extern "rustup override unset" [ - ...flags: string@"nu-complete rustup flags" - --path: string@"nu-complete rustup overrides" # Path to the directory - --nonexistent # Remove override toolchain for all nonexistent directories - --help(-h) # Print help -] - -# Run a command with an environment configured for a given toolchain -export extern "rustup run" [ - toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name, or an absolute path - ...command: string@"nu-complete rustup run-command" # Command to run and its arguments - --install # Install the requested toolchain if needed -] - -# Display which binary will be run for a given command -export extern "rustup which" [ - command: string@"nu-complete rustup binaries" - --toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name - --help(-h) # Print help -] - -# Open the documentation for the current toolchain -export extern "rustup doc" [ - topic?: string@"nu-complete rustup doc-topics" # Topic such as 'core', 'fn', 'usize', 'eprintln!', 'core::arch', 'std::fs', 'std::io::Bytes' - --path # Only print the path to the documentation - --serve # Serve the documentation over a local HTTP server instead of opening it directly as a `file://` URL - --toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' - --alloc # The Rust core allocation and collections library - --book # The Rust Programming Language book - --cargo # The Cargo Book - --clippy # The Clippy Documentation - --core # The Rust Core Library - --edition-guide # The Rust Edition Guide - --embedded-book # The Embedded Rust Book - --error-codes # The Rust Error Codes Index - --nomicon # The Dark Arts of Advanced and Unsafe Rust Programming - --proc_macro # A support library for macro authors when defining new macros - --reference # The Rust Reference - --releases # Rust Release Notes - --rust-by-example # A collection of runnable examples that illustrate various Rust concepts and standard libraries - --rustc # The compiler for the Rust programming language - --rustc-docs # The API documentation for the Rust compiler and other toolchain components - --rustdoc # Documentation generator for Rust projects - --std # Standard library API documentation - --style-guide # The Rust Style Guide - --test # Support code for rustc's built in unit-test and micro-benchmarking framework - --unstable-book # The Unstable Book - --help(-h) # Print help -] - -# View the man page for a given command -export extern "rustup man" [ - command: string@"nu-complete rustup man-pages" - --toolchain: string@"nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' - --help(-h) # Print help -] - -# Modify the rustup installation -export extern "rustup self" [ - --help(-h) # Print help +export complete [rustup override help] [ + command?: words [list set unset help] ] # Print the help of the given self subcommand(s) -export extern "rustup self help" [ - ...command: string@"nu-complete rustup subcommands" -] - -# Download and install updates to rustup -export extern "rustup self update" [ - ...flags: string@"nu-complete rustup flags" - --help(-h) # Print help -] - -# Uninstall rustup -export extern "rustup self uninstall" [ - ...flags: string@"nu-complete rustup flags" - --yes(-y) # Disable confirmation prompt - --no-modify-path # Do not clean up the `PATH` environment variable - --help(-h) # Print help -] - -# Upgrade the internal data format -export extern "rustup self upgrade-data" [ - ...flags: string@"nu-complete rustup flags" - --help(-h) # Print help -] - -# Alter rustup settings -export extern "rustup set" [ - --help(-h) # Print help +export complete [rustup self help] [ + command?: words [update uninstall upgrade-data help] ] # Print the help of the given set subcommand(s) -export extern "rustup set help" [ - ...command: string@"nu-complete rustup subcommands" +export complete [rustup set help] [ + command?: words [default-host profile auto-self-update auto-install help] ] -# The tuple used to identify toolchains when not specified -export extern "rustup set default-host" [ - host_tuple: string@"nu-complete rustup targets" - --help(-h) # Print help -] +# ------------------ subcommand aliases rustup accepts ------------------ -# The default components installed with a toolchain -export extern "rustup set profile" [ - profile_name?: string@"nu-complete rustup profiles" - --help(-h) # Print help -] +# Alias of `rustup install` +export complete [rustup add] [ + ...toolchain: by "nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' + --profile: words [minimal default complete] + --component(-c): by "nu-complete rustup component names" # Comma-separated list of components to add + --target(-t): by "nu-complete rustup targets" # Comma-separated list of targets to add + --no-self-update # Don't perform self update + --no-update # Don't try to update the installed toolchain + --force # Force an update, even if some components are missing + --allow-downgrade # Allow rustup to downgrade the toolchain + --force-non-host # Install toolchains that require an emulator + --override # Set the installed toolchain as the directory override + --default # Set the installed toolchain as the default + --help(-h) # Print help +] where { + terminal [--help] +} -# The rustup auto self update mode -export extern "rustup set auto-self-update" [ - auto_self_update_mode?: string@[enable disable check-only] - --help(-h) # Print help -] +# Alias of `rustup update` +export complete [rustup up] [ + ...toolchain: by "nu-complete rustup toolchains" # Toolchains to update (default: all) + --no-self-update # Don't perform self update + --force # Force an update, even if some components are missing + --force-non-host # Install toolchains that require an emulator + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup update` +export complete [rustup upgrade] [ + ...toolchain: by "nu-complete rustup toolchains" # Toolchains to update (default: all) + --no-self-update # Don't perform self update + --force # Force an update, even if some components are missing + --force-non-host # Install toolchains that require an emulator + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup uninstall` +export complete [rustup remove] [ + ...toolchain: by "nu-complete rustup toolchains installed" + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup uninstall` +export complete [rustup rm] [ + ...toolchain: by "nu-complete rustup toolchains installed" + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup uninstall` +export complete [rustup delete] [ + ...toolchain: by "nu-complete rustup toolchains installed" + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup uninstall` +export complete [rustup del] [ + ...toolchain: by "nu-complete rustup toolchains installed" + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup doc` +export complete [rustup docs] [ + topic?: by "nu-complete rustup doc-topics" [toolchain: --toolchain] # Topic such as 'core', 'fn', 'std::fs', 'eprintln!' + --path # Only print the path to the documentation + --serve # Serve the documentation over a local HTTP server + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --alloc # The Rust core allocation and collections library + --book # The Rust Programming Language book + --cargo # The Cargo Book + --clippy # The Clippy Documentation + --core # The Rust Core Library + --edition-guide # The Rust Edition Guide + --embedded-book # The Embedded Rust Book + --error-codes # The Rust Error Codes Index + --nomicon # The Dark Arts of Advanced and Unsafe Rust Programming + --proc_macro # A support library for macro authors + --reference # The Rust Reference + --releases # Rust Release Notes + --rust-by-example # A collection of runnable examples + --rustc # The compiler for the Rust programming language + --rustc-docs # The API documentation for the Rust compiler + --rustdoc # Documentation generator for Rust projects + --std # Standard library API documentation + --style-guide # The Rust Style Guide + --test # Support code for rustc's built in test framework + --unstable-book # The Unstable Book + --help(-h) # Print help +] where { + at-most-one [--path --serve] + at-most-one [--alloc --book --cargo --clippy --core --edition-guide --embedded-book --error-codes --nomicon --proc_macro --reference --releases --rust-by-example --rustc --rustc-docs --rustdoc --std --style-guide --test --unstable-book] + terminal [--help] +} -# The auto toolchain install mode -export extern "rustup set auto-install" [ - auto_install_mode?: string@[enable disable] - --help(-h) # Print help -] +# Alias of `rustup toolchain install` +export complete [rustup toolchain add] [ + ...toolchain: by "nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' + --profile: words [minimal default complete] + --component(-c): by "nu-complete rustup component names" # Comma-separated list of components to add + --target(-t): by "nu-complete rustup targets" # Comma-separated list of targets to add + --no-self-update # Don't perform self update + --no-update # Don't try to update the installed toolchain + --force # Force an update, even if some components are missing + --allow-downgrade # Allow rustup to downgrade the toolchain + --force-non-host # Install toolchains that require an emulator + --override # Set the installed toolchain as the directory override + --default # Set the installed toolchain as the default + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup toolchain install` +export complete [rustup toolchain update] [ + ...toolchain: by "nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' + --profile: words [minimal default complete] + --component(-c): by "nu-complete rustup component names" # Comma-separated list of components to add + --target(-t): by "nu-complete rustup targets" # Comma-separated list of targets to add + --no-self-update # Don't perform self update + --no-update # Don't try to update the installed toolchain + --force # Force an update, even if some components are missing + --allow-downgrade # Allow rustup to downgrade the toolchain + --force-non-host # Install toolchains that require an emulator + --override # Set the installed toolchain as the directory override + --default # Set the installed toolchain as the default + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup toolchain install` +export complete [rustup toolchain up] [ + ...toolchain: by "nu-complete rustup toolchains" # Toolchain name, such as 'stable', 'nightly', or '1.8.0' + --profile: words [minimal default complete] + --component(-c): by "nu-complete rustup component names" # Comma-separated list of components to add + --target(-t): by "nu-complete rustup targets" # Comma-separated list of targets to add + --no-self-update # Don't perform self update + --no-update # Don't try to update the installed toolchain + --force # Force an update, even if some components are missing + --allow-downgrade # Allow rustup to downgrade the toolchain + --force-non-host # Install toolchains that require an emulator + --override # Set the installed toolchain as the directory override + --default # Set the installed toolchain as the default + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup toolchain uninstall` +export complete [rustup toolchain remove] [ + ...toolchain: by "nu-complete rustup toolchains installed" + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup toolchain uninstall` +export complete [rustup toolchain rm] [ + ...toolchain: by "nu-complete rustup toolchains installed" + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup toolchain uninstall` +export complete [rustup toolchain delete] [ + ...toolchain: by "nu-complete rustup toolchains installed" + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup toolchain uninstall` +export complete [rustup toolchain del] [ + ...toolchain: by "nu-complete rustup toolchains installed" + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup target add` +export complete [rustup target install] [ + ...target: by "nu-complete rustup targets available" [toolchain: --toolchain] # Targets to install; "all" installs all + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup target remove` +export complete [rustup target uninstall] [ + ...target: by "nu-complete rustup targets installed" [toolchain: --toolchain] + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup target remove` +export complete [rustup target rm] [ + ...target: by "nu-complete rustup targets installed" [toolchain: --toolchain] + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup target remove` +export complete [rustup target delete] [ + ...target: by "nu-complete rustup targets installed" [toolchain: --toolchain] + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup target remove` +export complete [rustup target del] [ + ...target: by "nu-complete rustup targets installed" [toolchain: --toolchain] + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup component remove` +export complete [rustup component uninstall] [ + ...component: by "nu-complete rustup components installed" [toolchain: --toolchain] + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --target: by "nu-complete rustup targets installed" [toolchain: --toolchain] # Target triple of the component + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup component remove` +export complete [rustup component rm] [ + ...component: by "nu-complete rustup components installed" [toolchain: --toolchain] + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --target: by "nu-complete rustup targets installed" [toolchain: --toolchain] # Target triple of the component + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup component remove` +export complete [rustup component delete] [ + ...component: by "nu-complete rustup components installed" [toolchain: --toolchain] + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --target: by "nu-complete rustup targets installed" [toolchain: --toolchain] # Target triple of the component + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup component remove` +export complete [rustup component del] [ + ...component: by "nu-complete rustup components installed" [toolchain: --toolchain] + --toolchain: by "nu-complete rustup toolchains installed" # Toolchain name + --target: by "nu-complete rustup targets installed" [toolchain: --toolchain] # Target triple of the component + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup override set` +export complete [rustup override add] [ + toolchain: by "nu-complete rustup toolchains" # Toolchain name + --path: dir # Path to the directory + --help(-h) # Print help +] where { terminal [--help] } + +# Alias of `rustup override unset` +export complete [rustup override remove] [ + --path: by "nu-complete rustup overrides" # Path to the directory + --nonexistent # Remove override toolchain for all nonexistent directories + --help(-h) # Print help +] where { + at-most-one [--path --nonexistent] + terminal [--help] +} -# Generate tab-completion scripts for your shell -export extern "rustup completions" [ - shell: string@[bash elvish fish powershell zsh] - command?: string@[rustup cargo] - --help(-h) # Print help -] +# Alias of `rustup override unset` +export complete [rustup override rm] [ + --path: by "nu-complete rustup overrides" # Path to the directory + --nonexistent # Remove override toolchain for all nonexistent directories + --help(-h) # Print help +] where { + at-most-one [--path --nonexistent] + terminal [--help] +} -# ------------------ subcommand aliases rustup accepts ------------------ +# Alias of `rustup override unset` +export complete [rustup override delete] [ + --path: by "nu-complete rustup overrides" # Path to the directory + --nonexistent # Remove override toolchain for all nonexistent directories + --help(-h) # Print help +] where { + at-most-one [--path --nonexistent] + terminal [--help] +} + +# Alias of `rustup override unset` +export complete [rustup override del] [ + --path: by "nu-complete rustup overrides" # Path to the directory + --nonexistent # Remove override toolchain for all nonexistent directories + --help(-h) # Print help +] where { + at-most-one [--path --nonexistent] + terminal [--help] +} -export alias "rustup add" = rustup install -export alias "rustup up" = rustup update -export alias "rustup upgrade" = rustup update -export alias "rustup remove" = rustup uninstall -export alias "rustup rm" = rustup uninstall -export alias "rustup delete" = rustup uninstall -export alias "rustup del" = rustup uninstall -export alias "rustup docs" = rustup doc -export alias "rustup toolchain add" = rustup toolchain install -export alias "rustup toolchain update" = rustup toolchain install -export alias "rustup toolchain up" = rustup toolchain install -export alias "rustup toolchain remove" = rustup toolchain uninstall -export alias "rustup toolchain rm" = rustup toolchain uninstall -export alias "rustup toolchain delete" = rustup toolchain uninstall -export alias "rustup toolchain del" = rustup toolchain uninstall -export alias "rustup target install" = rustup target add -export alias "rustup target uninstall" = rustup target remove -export alias "rustup target rm" = rustup target remove -export alias "rustup target delete" = rustup target remove -export alias "rustup target del" = rustup target remove -export alias "rustup component uninstall" = rustup component remove -export alias "rustup component rm" = rustup component remove -export alias "rustup component delete" = rustup component remove -export alias "rustup component del" = rustup component remove -export alias "rustup override add" = rustup override set -export alias "rustup override remove" = rustup override unset -export alias "rustup override rm" = rustup override unset -export alias "rustup override delete" = rustup override unset -export alias "rustup override del" = rustup override unset -export alias "rustup self up" = rustup self update +# Alias of `rustup self update` +export complete [rustup self up] [ --help(-h) ] where { terminal [--help] } diff --git a/custom-completions/rye/rye-completions.nu b/custom-completions/rye/rye-completions.nu index 0310109f3..423ce2a57 100644 --- a/custom-completions/rye/rye-completions.nu +++ b/custom-completions/rye/rye-completions.nu @@ -1,170 +1,379 @@ -export extern "rye" [ - command?: string@"nu-complete rye" -] - -def "nu-complete rye" [] { - ^rye --help - | lines - | where { str starts-with " " } - | each {str trim} - | parse "{value} {description}" - | str trim -} - -export extern "rye add" [ - package: string # package to add (PEP 508 string) - --git: string # Install the given package from this git repository - --url: string # Install the given package from this URL - --path: path # Install the given package from this local path - --absolute # Force non interpolated absolute paths - --tag: string # Install a specific tag - --rev: string # Update to a specific git rev - --branch: string # Update to a specific git branch - --features: string # Adds a dependency with a specific feature - --dev # Add this as dev dependency - --excluded # Add this as an excluded dependency that will not be installed even if it's a sub dependency - --optional: string # Add this to an optional dependency group - --pre # Include pre-releases when finding a package version - --pin: string # Overrides the pin operator [possible values: equal, tilde-equal, greater-than-equal] - --sync # Runs `sync` even if auto-sync is disabled - --no-sync # Does not run `sync` even if auto-sync is enabled - --verbose(-v) # Enables verbose diagnostics - --quiet(-q) # Turns off all output - --help(-h) # Print help -] - -export extern "rye config" [ - --show-path # Print the path to the config - --format: string@"nu-complete config format" # Request parseable output format rather than lines [possible values: json] - --get: string # Reads a config key - --set: string # Sets a config key to a string - --set-in: string # Sets a config key to an integer - --set-boo: string # Sets a config key to a bool - --unse: string # Remove a config key - --help(-h) # Print help (see more with '--help') -] +@non-destructive +export def "nu-complete rye" [] { + try { + ^rye --help + | lines + | where { str starts-with " " } + | each {str trim} + | parse "{value} {description}" + | str trim + } catch { [] } +} def "nu-complete config format" [] { ["json"] } -export extern "rye fmt" [ - path?: path # List of files or directories to limit the operation to - --all(-a) # Perform the operation on all packages - --package(-p) # Perform the operation on a specific package - --pyproject: path # Use this pyproject.toml file - --verbose(-v) # Enables verbose diagnostics - --quiet(-q) # Turns off all output - --check # Run format in check mode - --help(-h) # Print help (see a summary with '-h') -] - -export extern "rye init" [ - path?: path # Where to place the project (defaults to current path . ) - --lib # Generate a library project (default) - --script # Generate an executable project - --min-py: string # Minimal Python version supported by this project - --py(-p) # Python version to use for the virtualenv - --no-readme # Do not create a readme - --no-pin # Do not create .python-version file (requires-python will be used) - --build-system: string@"nu-complete build-system" # Which build system should be used (defaults to hatchling)? [possible values: hatchling, setuptools, flit, pdm, maturin] - --license: string # Which license should be used (SPDX identifier)? - --name: string # The name of the package - --private # Set "Private :: Do Not Upload" classifier, used for private projects - --no-import # Don't import from setup.cfg, setup.py, or requirements files - --virtual # Initialize this as a virtual package. A virtual package can have dependencies but is itself not installed as a Python package. It also cannot be published. - --requirements(-r): path # Requirements files to initialize pyproject.toml with - --dev-requirements: path # Development requirements files to initialize pyproject.toml with - --verbose(-v) # Enables verbose diagnostics - --quiet(-q) # Turns off all output - --help(-h) # Print help (see a summary with '-h') -] - def "nu-complete build-system" [] { ['hatchling', 'setuptools', 'flit', 'pdm', 'maturin'] } -export extern "rye lint" [ - path?: path # List of files or directories to limit the operation to - --all(-a) # Perform the operation on all packages - --package(-p): string # Perform the operation on a specific package - --pyproject: path # Use this pyproject.toml file - --verbose(-v) # Enables verbose diagnostics - --quiet(-q) # Turns off all output - --fix # Apply fixes - --help(-h) # Print help (see a summary with '-h') -] +@non-destructive +export def "nu-complete rye run" [] { + try { + open pyproject.toml | get project.scripts | transpose value description + } catch { [] } +} -export extern "rye run" [ - script?: string@"nu-complete rye run" - --list(-l) # List all commands - --pyproject: path # Use this pyproject.toml file - --help # Print help -] +@non-destructive +export def "nu-complete rye tools" [] { + try { + ^rye tools --help + | lines + | drop 1 + | where { str starts-with " " } + | each {str trim} + | parse "{value} {description}" + | str trim + } catch { [] } +} -def "nu-complete rye run" [] { - open pyproject.toml | get project.scripts | transpose value description +@non-destructive +export def "nu-complete rye self" [] { + try { + ^rye self --help + | lines + | drop 1 + | where { str starts-with " " } + | each {str trim} + | parse "{value} {description}" + | str trim + } catch { [] } } -export extern "rye test" [ - --all(-a) # Perform the operation on all packages - --package(-p): string # Perform the operation on a specific package - --pyproject: path # Use this pyproject.toml file - --no-capture(-s) # - --verbose(-v) # Enables verbose diagnostics - --quiet(-q) # Turns off all output - --help(-h) # Print help (see a summary with '-h') -] +@non-destructive +export def "nu-complete rye toolchain" [] { + try { + ^rye toolchain --help + | lines + | drop 1 + | where { str starts-with " " } + | each {str trim} + | parse "{value} {description}" + | str trim + } catch { [] } +} -def "nu-complete rye tools" [] { - ^rye tools --help - | lines - | drop 1 - | where { str starts-with " " } - | each {str trim} - | parse "{value} {description}" - | str trim +@non-destructive +def "nu-complete .env files" [] { + ls *.env | select name | rename value } -export extern "rye tools" [ - command?: string@"nu-complete rye tools" - --help(-h) # Print help (see more with '--help') -] -def "nu-complete rye self" [] { - ^rye self --help - | lines - | drop 1 - | where { str starts-with " " } - | each {str trim} - | parse "{value} {description}" - | str trim +# Dependencies declared in pyproject.toml (project + tool.rye.dev-dependencies), names only. +@non-destructive +export def "nu-complete rye dependencies" [pyproject?: string] { + try { + let p = open ($pyproject | default pyproject.toml) + let main = $p | get -o project.dependencies | default [] | each {|d| {spec: $d, kind: 'dependency'} } + let dev = $p | get -o tool.rye.dev-dependencies | default [] | each {|d| {spec: $d, kind: 'dev-dependency'} } + $main ++ $dev | each {|d| {value: ($d.spec | parse --regex '^(?<n>[A-Za-z0-9._-]+)' | get 0.n), description: $"($d.spec) · ($d.kind)"} } | uniq-by value + } catch { [] } +} + +# Workspace member packages (tool.rye.workspace.members), for `--package`. +@non-destructive +export def "nu-complete rye packages" [] { + try { + open pyproject.toml | get -o tool.rye.workspace.members | default [] | each {|g| glob $g } | flatten + | each {|dir| try { open ($dir | path join pyproject.toml) | get project.name } catch { null } } | compact + } catch { [] } } -export extern "rye self" [ - command?: string@"nu-complete rye self" - --help(-h) # Print help (see more with '--help') +export complete [rye] [ + ] -def "nu-complete rye toolchain" [] { - ^rye toolchain --help - | lines - | drop 1 - | where { str starts-with " " } - | each {str trim} - | parse "{value} {description}" - | str trim +export complete [rye add] [ + package: text # package to add (PEP 508 string) + --git: text # Install the given package from this git repository + --url: text # Install the given package from this URL + --path: path # Install the given package from this local path + --absolute # Force non interpolated absolute paths + --tag: text # Install a specific tag + --rev: text # Update to a specific git rev + --branch: text # Update to a specific git branch + --features: text # Adds a dependency with a specific feature + --dev # Add this as dev dependency + --excluded # Add this as an excluded dependency that will not be installed even if it's a sub dependency + --optional: text # Add this to an optional dependency group + --pre # Include pre-releases when finding a package version + --pin: text # Overrides the pin operator [possible values: equal, tilde-equal, greater-than-equal] + --sync # Runs `sync` even if auto-sync is disabled + --no-sync # Does not run `sync` even if auto-sync is enabled + --verbose(-v) # Enables verbose diagnostics + --quiet(-q) # Turns off all output + --help(-h) # Print help +] where { + at-most-one [--verbose --quiet] + overrides [--sync --no-sync] + requires --tag --git + requires --rev --git + requires --branch --git + requires --absolute --path + at-most-one [--git --url --path] + at-most-one [--tag --rev --branch] + at-most-one [--dev --optional --excluded] + terminal [--help] } -export extern "rye toolchain" [ - command?: string@"nu-complete rye toolchain" - --help(-h) # Print help (see more with '--help') -] +export complete [rye config] [ + --show-path # Print the path to the config + --format: words ["json"] # Request parseable output format rather than lines [possible values: json] + --get: text # Reads a config key + --set: text # Sets a config key to a string + --set-int: text # Sets a config key to an integer + --set-bool: text # Sets a config key to a bool + --unset: text # Remove a config key + --help(-h) # Print help (see more with '--help') +] where { + at-most-one [--show-path --get --set --set-int --set-bool --unset] + terminal [--help] +} -def "nu-complete .env files" [] { - ls *.env | select name | rename value +export complete [rye fmt] [ + path?: path # List of files or directories to limit the operation to + --all(-a) # Perform the operation on all packages + --package(-p): by "nu-complete rye packages" # Perform the operation on a specific package + --pyproject: path # Use this pyproject.toml file + --verbose(-v) # Enables verbose diagnostics + --quiet(-q) # Turns off all output + --check # Run format in check mode + --help(-h) # Print help (see a summary with '-h') +] where { + at-most-one [--verbose --quiet] + at-most-one [--all --package] + terminal [--help] +} + +export complete [rye init] [ + path?: path # Where to place the project (defaults to current path . ) + --lib # Generate a library project (default) + --script # Generate an executable project + --min-py: text # Minimal Python version supported by this project + --py(-p): text # Python version to use for the virtualenv + --no-readme # Do not create a readme + --no-pin # Do not create .python-version file (requires-python will be used) + --build-system: words ["hatchling" "setuptools" "flit" "pdm" "maturin"] # Which build system should be used (defaults to hatchling)? [possible values: hatchling, setuptools, flit, pdm, maturin] + --license: text # Which license should be used (SPDX identifier)? + --name: text # The name of the package + --private # Set "Private :: Do Not Upload" classifier, used for private projects + --no-import # Don't import from setup.cfg, setup.py, or requirements files + --virtual # Initialize this as a virtual package. A virtual package can have dependencies but is itself not installed as a Python package. It also cannot be published. + --requirements(-r): path # Requirements files to initialize pyproject.toml with + --dev-requirements: path # Development requirements files to initialize pyproject.toml with + --verbose(-v) # Enables verbose diagnostics + --quiet(-q) # Turns off all output + --help(-h) # Print help (see a summary with '-h') +] where { + at-most-one [--verbose --quiet] + at-most-one [--lib --script] + terminal [--help] +} + +export complete [rye lint] [ + path?: path # List of files or directories to limit the operation to + --all(-a) # Perform the operation on all packages + --package(-p): by "nu-complete rye packages" # Perform the operation on a specific package + --pyproject: path # Use this pyproject.toml file + --verbose(-v) # Enables verbose diagnostics + --quiet(-q) # Turns off all output + --fix # Apply fixes + --help(-h) # Print help (see a summary with '-h') +] where { + at-most-one [--verbose --quiet] + at-most-one [--all --package] + terminal [--help] +} + +export complete [rye run] [ + script?: by "nu-complete rye run" + --list(-l) # List all commands + --pyproject: path # Use this pyproject.toml file + --help # Print help +] where { + terminal [--help] } -export extern "rye --env-file" [ - file: path@"nu-complete .env files" # env file -] \ No newline at end of file +export complete [rye test] [ + --all(-a) # Perform the operation on all packages + --package(-p): by "nu-complete rye packages" # Perform the operation on a specific package + --pyproject: path # Use this pyproject.toml file + --no-capture(-s) + --verbose(-v) # Enables verbose diagnostics + --quiet(-q) # Turns off all output + --help(-h) # Print help (see a summary with '-h') +] where { + at-most-one [--verbose --quiet] + at-most-one [--all --package] + terminal [--help] +} + +export complete [rye tools] [ + command?: by "nu-complete rye tools" + --help(-h) # Print help (see more with '--help') +] where { + terminal [--help] +} + +export complete [rye self] [ + command?: by "nu-complete rye self" + --help(-h) # Print help (see more with '--help') +] where { + terminal [--help] +} + +export complete [rye toolchain] [ + command?: by "nu-complete rye toolchain" + --help(-h) # Print help (see more with '--help') +] where { + terminal [--help] +} + +export complete [rye sync] [ + --update # Update the dependencies before syncing + --no-dev # Do not install the development dependencies + --no-lock # Do not update the lock file + --force # Force the virtualenv to be recreated + --pyproject: path # Use this pyproject.toml file + --verbose(-v) # Enables verbose diagnostics + --quiet(-q) # Turns off all output + --help(-h) # Print help (see a summary with '-h') +] where { + at-most-one [--verbose --quiet] + terminal [--help] +} + +export complete [rye lock] [ + --update # Update the locked dependencies + --all(-a) # Lock all workspace packages + --package(-p): by "nu-complete rye packages" # Lock a specific package + --pyproject: path # Use this pyproject.toml file + --verbose(-v) # Enables verbose diagnostics + --quiet(-q) # Turns off all output + --help(-h) # Print help (see a summary with '-h') +] where { + at-most-one [--verbose --quiet] + at-most-one [--all --package] + terminal [--help] +} + +export complete [rye build] [ + --all(-a) # Build all workspace packages + --package(-p): by "nu-complete rye packages" # Build a specific package + --out: path # Write the distributions to this directory + --sdist # Build a source distribution + --wheel # Build a wheel + --pyproject: path # Use this pyproject.toml file + --help(-h) # Print help (see a summary with '-h') +] where { + at-most-one [--all --package] + terminal [--help] +} + +export complete [rye publish] [ + --repository: text # The repository to publish to + --username: text # The username to use + --token: text # The token to use + --yes # Skip the confirmation prompt + --skip-existing # Ignore files that already exist on the repository + --help(-h) # Print help (see a summary with '-h') +] where { + terminal [--help] +} + +export complete [rye remove] [ + ...package: by "nu-complete rye dependencies" [pyproject: --pyproject] # The packages to remove + --pyproject: path # Use this pyproject.toml file + --verbose(-v) # Enables verbose diagnostics + --quiet(-q) # Turns off all output + --help(-h) # Print help (see a summary with '-h') +] where { + at-most-one [--verbose --quiet] + terminal [--help] +} + +export complete [rye shell] [ + --pyproject: path # Use this pyproject.toml file + --verbose(-v) # Enables verbose diagnostics + --quiet(-q) # Turns off all output + --help(-h) # Print help (see a summary with '-h') +] where { + at-most-one [--verbose --quiet] + terminal [--help] +} + +export complete [rye show] [ + --pyproject: path # Use this pyproject.toml file + --help(-h) # Print help (see a summary with '-h') +] where { + terminal [--help] +} + +export complete [rye pin] [ + version: text # The Python version to pin to + --help(-h) # Print help (see a summary with '-h') +] where { + terminal [--help] +} + +export complete [rye install] [ + ...package: text # The packages to install + --git: text # Install the given package from this git repository + --url: text # Install the given package from this URL + --path: path # Install the given package from this local path + --tag: text # Install a specific tag + --rev: text # Update to a specific git rev + --branch: text # Update to a specific git branch + --features: text # Adds a dependency with a specific feature + --force # Force the installation + --python: text # The Python version to use + --help(-h) # Print help (see a summary with '-h') +] where { + requires --tag --git + requires --rev --git + requires --branch --git + at-most-one [--git --url --path] + at-most-one [--tag --rev --branch] + terminal [--help] +} + +export complete [rye uninstall] [ + ...package: text # The packages to uninstall + --verbose(-v) # Enables verbose diagnostics + --quiet(-q) # Turns off all output + --help(-h) # Print help (see a summary with '-h') +] where { + at-most-one [--verbose --quiet] + terminal [--help] +} + +export complete [rye list] [ + --pyproject: path # Use this pyproject.toml file + --help(-h) # Print help (see a summary with '-h') +] where { + terminal [--help] +} + +export complete [rye make-req] [ + ...requirement: text # The PEP 508 requirement strings + --help(-h) # Print help (see a summary with '-h') +] where { + terminal [--help] +} + +export complete [rye fetch] [ + --help(-h) # Print help (see a summary with '-h') +] where { + terminal [--help] +} diff --git a/custom-completions/scoop/scoop-completions.nu b/custom-completions/scoop/scoop-completions.nu index 5d6141bbe..8218bdac6 100644 --- a/custom-completions/scoop/scoop-completions.nu +++ b/custom-completions/scoop/scoop-completions.nu @@ -10,6 +10,7 @@ def scoopArches [] { } # list of all installed apps +@non-destructive def scoopInstalledApps [] { let localAppDir = if ('SCOOP' in $env) { [$env.SCOOP 'apps'] | path join @@ -29,11 +30,13 @@ def scoopInstalledApps [] { } # list of all installed apps with star +@non-destructive def scoopInstalledAppsWithStar [] { scoopInstalledApps | prepend '*' } # list of all manifests from all buckets +@non-destructive def scoopAllApps [] { let bucketsDir = if ('SCOOP' in $env) { [$env.SCOOP 'buckets'] | path join @@ -44,6 +47,7 @@ def scoopAllApps [] { } # list of all apps that are not installed +@non-destructive def scoopAvailableApps [] { let all = (scoopAllApps) let installed = (scoopInstalledApps) @@ -91,7 +95,7 @@ def scoopConfigs [] { # boolean as strings def scoopBooleans [] { - ["'true'" "'false'" ' '] + ['true' 'false'] } def scoopRepos [] { @@ -108,6 +112,7 @@ def scoopShimBuilds [] { ['kiennq' 'scoopcs' '71'] } +@non-destructive def scoopCommands [] { let libexecDir = if ('SCOOP' in $env) { [$env.SCOOP 'apps' 'scoop' 'current' 'libexec'] | path join @@ -134,6 +139,7 @@ def scoopCommands [] { $commands } +@non-destructive def scoopAliases [] { scoop alias list | str trim | lines | slice 2.. | split column " " | get column0 } @@ -142,6 +148,7 @@ def batStyles [] { ['default' 'auto' 'full' 'plain' 'changes' 'header' 'header-filename' 'header-filesize' 'grid' 'rule' 'numbers' 'snip'] } +@non-destructive def scoopShims [] { let localShimDir = if ('SCOOP' in $env) { [$env.SCOOP 'shims'] | path join } else if (scoop config root_path | path exists) { scoop config root_path } else { [$env.USERPROFILE 'scoop' 'shims'] | path join } let localShims = if ($localShimDir | path exists) { ls $localShimDir | get name | path parse | select stem extension | where extension == shim | get stem } else { [] } @@ -152,22 +159,77 @@ def scoopShims [] { $localShims | append $globalShims | uniq | sort } +################################################################ +# COMPLETION PROVIDERS +################################################################ + +@non-destructive +export def "nu-complete scoop installed" [] { + try { scoopInstalledApps } catch { [] } +} + +@non-destructive +export def "nu-complete scoop installed-with-star" [] { + try { scoopInstalledAppsWithStar } catch { [] } +} + +@non-destructive +export def "nu-complete scoop all" [] { + try { scoopAllApps } catch { [] } +} + +@non-destructive +export def "nu-complete scoop available" [] { + try { scoopAvailableApps } catch { [] } +} + +@non-destructive +export def "nu-complete scoop commands" [] { + try { scoopCommands } catch { [] } +} + +@non-destructive +export def "nu-complete scoop aliases" [] { + try { scoopAliases } catch { [] } +} + +@non-destructive +export def "nu-complete scoop shims" [] { + try { scoopShims } catch { [] } +} + +@non-destructive +export def "nu-complete scoop installed-buckets" [] { + try { scoopInstalledBuckets } catch { [] } +} + +@non-destructive +export def "nu-complete scoop available-buckets" [] { + try { scoopAvailableBuckets } catch { [] } +} + ################################################################ # scoop ################################################################ # Windows command line installer -export extern "scoop" [ - alias?: string@scoopCommands # available scoop commands and aliases - --help (-h) # Show help for this command. - --version (-v) # Show current scoop and added buckets versions +export complete [scoop] [ + alias?: by "nu-complete scoop commands" # available scoop commands and aliases + --help(-h) # Show help for this command. + --version(-v) # Show current scoop and added buckets versions ] ################################################################ # scoop list ################################################################ + +export complete [scoop list] [ + query?: by "nu-complete scoop installed" # Query the installed apps +] +@example "List every installed app" { scoop list } +@example "List one installed app" { scoop list git } export def "scoop list" [ - query?: string@scoopInstalledApps + query?: string ] { let result = (^scoop list ($query | default "") | complete) if $result.exit_code == 0 { @@ -182,11 +244,11 @@ export def "scoop list" [ ################################################################ # Uninstall specified application(s). -export extern "scoop uninstall" [ - app?: string@scoopInstalledApps # app that will be uninstalled - --help (-h) # Show help for this command. - --global (-g) # Uninstall a globally installed application(s). - --purge (-p) # Persisted data will be removed. Normally when application is being uninstalled, the data defined in persist property/manually persisted are kept. +export complete [scoop uninstall] [ + app?: by "nu-complete scoop installed" # app that will be uninstalled + --help(-h) # Show help for this command. + --global(-g) # Uninstall a globally installed application(s). + --purge(-p) # Persisted data will be removed. Normally when application is being uninstalled, the data defined in persist property/manually persisted are kept. ] ################################################################ @@ -194,12 +256,12 @@ export extern "scoop uninstall" [ ################################################################ # Perform cleanup on specified installed application(s) by removing old/not actively used versions. -export extern "scoop cleanup" [ - app?: string@scoopInstalledAppsWithStar # app that will be cleaned - --help (-h) # Show help for this command. - --all (-a) # Cleanup all apps (alternative to '*') - --global (-g) # Perform cleanup on globally installed application(s). (Include them if '*' is used) - --cache (-k) # Remove outdated download cache. This will keep only the latest version cached. +export complete [scoop cleanup] [ + app?: by "nu-complete scoop installed-with-star" # app that will be cleaned + --help(-h) # Show help for this command. + --all(-a) # Cleanup all apps (alternative to '*') + --global(-g) # Perform cleanup on globally installed application(s). (Include them if '*' is used) + --cache(-k) # Remove outdated download cache. This will keep only the latest version cached. ] ################################################################ @@ -207,10 +269,10 @@ export extern "scoop cleanup" [ ################################################################ # Display information about an application. -export extern "scoop info" [ - app?: string@scoopAllApps # app that will be questioned - --verbose (-v) # Show full paths and URLs - --help (-h) # Show help for this command. +export complete [scoop info] [ + app?: by "nu-complete scoop all" # app that will be questioned + --verbose(-v) # Show full paths and URLs + --help(-h) # Show help for this command. ] ################################################################ @@ -218,16 +280,16 @@ export extern "scoop info" [ ################################################################ # Update installed application(s), or scoop itself. -export extern "scoop update" [ - app?: string@scoopInstalledAppsWithStar # which apps - --help (-h) # Show help for this command. - --force (-f) # Force update even when there is not a newer version. - --global (-g) # Update a globally installed application(s). - --independent (-i) # Do not install dependencies automatically. - --no-cache (-k) # Do not use the download cache. - --skip (-s) # Skip hash validation (use with caution!). - --quiet (-q) # Hide extraneous messages. - --all (-a) # Update all apps (alternative to '*') +export complete [scoop update] [ + app?: by "nu-complete scoop installed-with-star" # which apps + --help(-h) # Show help for this command. + --force(-f) # Force update even when there is not a newer version. + --global(-g) # Update a globally installed application(s). + --independent(-i) # Do not install dependencies automatically. + --no-cache(-k) # Do not use the download cache. + --skip(-s) # Skip hash validation (use with caution!). + --quiet(-q) # Hide extraneous messages. + --all(-a) # Update all apps (alternative to '*') ] ################################################################ @@ -235,15 +297,15 @@ export extern "scoop update" [ ################################################################ # Install specific application(s). -export extern "scoop install" [ - app?: string@scoopAvailableApps # which apps - --arch (-a): string@scoopArches # Use the specified architecture, if the application's manifest supports it. - --help (-h) # Show help for this command. - --global (-g) # Install the application(s) globally. - --independent (-i) # Do not install dependencies automatically. - --no-cache (-k) # Do not use the download cache. - --skip (-s) # Skip hash validation (use with caution!). - --no-update-scoop (-u) # Don't update Scoop before installing if it's outdated +export complete [scoop install] [ + app?: by "nu-complete scoop available" # which apps + --arch(-a): words [32bit 64bit] # Use the specified architecture, if the application's manifest supports it. + --help(-h) # Show help for this command. + --global(-g) # Install the application(s) globally. + --independent(-i) # Do not install dependencies automatically. + --no-cache(-k) # Do not use the download cache. + --skip(-s) # Skip hash validation (use with caution!). + --no-update-scoop(-u) # Don't update Scoop before installing if it's outdated ] ################################################################ @@ -251,9 +313,9 @@ export extern "scoop install" [ ################################################################ # Show status and check for new app versions. -export extern "scoop status" [ - --help (-h) # Show help for this command. - --local (-l) # Checks the status for only the locally installed apps, and disables remote fetching/checking for Scoop and buckets +export complete [scoop status] [ + --help(-h) # Show help for this command. + --local(-l) # Checks the status for only the locally installed apps, and disables remote fetching/checking for Scoop and buckets ] ################################################################ @@ -261,10 +323,9 @@ export extern "scoop status" [ ################################################################ # Show help for scoop -export extern "scoop help" [ - --help (-h) # Show help for this command. - - command?: string@scoopCommands # Show help for the specified command +export complete [scoop help] [ + --help(-h) # Show help for this command. + command?: by "nu-complete scoop commands" # Show help for the specified command ] ################################################################ @@ -272,25 +333,29 @@ export extern "scoop help" [ ################################################################ # Add, remove or list Scoop aliases -export extern "scoop alias" [ - --help (-h) # Show help for this command. +export complete [scoop alias] [ + ...args: text # The subcommand and its arguments. + --help(-h) # Show help for this command. ] # add an alias -export extern "scoop alias add" [ - name: string # name of the alias - command: string # scoop command - description?: string # description of the alias +export complete [scoop alias add] [ + name: text # name of the alias + command: by "nu-complete scoop commands" # scoop command + description?: text # description of the alias + --help(-h) # Show help for this command. ] # list all aliases -export extern "scoop alias list" [ - --verbose (-v) # Show alias description and table headers (works only for 'list') +export complete [scoop alias list] [ + --verbose(-v) # Show alias description and table headers (works only for 'list') + --help(-h) # Show help for this command. ] # remove an alias -export extern "scoop alias rm" [ - name: string@scoopAliases # alias that will be removed +export complete [scoop alias rm] [ + name: by "nu-complete scoop aliases" # alias that will be removed + --help(-h) # Show help for this command. ] ################################################################ @@ -298,40 +363,46 @@ export extern "scoop alias rm" [ ################################################################ # Manipulate Scoop shims -export extern "scoop shim" [ - --help (-h) # Show help for this command. +export complete [scoop shim] [ + ...args: text # The subcommand and its arguments. + --help(-h) # Show help for this command. ] # add a custom shim -export extern "scoop shim add" [ - shim_name: string # name of the shim +export complete [scoop shim add] [ + shim_name: text # name of the shim command_path: path # path to executable cmd_args # additional command arguments - --global (-g) # Manipulate global shim(s) + --global(-g) # Manipulate global shim(s) + --help(-h) # Show help for this command. ] # remove shims (CAUTION: this could remove shims added by an app manifest) -export extern "scoop shim rm" [ - shim_name: string@scoopShims # shim that will be removed - --global (-g) # Manipulate global shim(s) +export complete [scoop shim rm] [ + shim_name: by "nu-complete scoop shims" # shim that will be removed + --global(-g) # Manipulate global shim(s) + --help(-h) # Show help for this command. ] # list all shims or matching shims -export extern "scoop shim list" [ - pattern?: string # list only matching shims - --global (-g) # Manipulate global shim(s) +export complete [scoop shim list] [ + pattern?: text # list only matching shims + --global(-g) # Manipulate global shim(s) + --help(-h) # Show help for this command. ] # show a shim's information -export extern "scoop shim info" [ - shim_name: string@scoopShims # shim info to retrieve - --global (-g) # Manipulate global shim(s) +export complete [scoop shim info] [ + shim_name: by "nu-complete scoop shims" # shim info to retrieve + --global(-g) # Manipulate global shim(s) + --help(-h) # Show help for this command. ] # alternate a shim's target source -export extern "scoop shim alter" [ - shim_name: string@scoopShims # shim that will be alternated - --global (-g) # Manipulate global shim(s) +export complete [scoop shim alter] [ + shim_name: by "nu-complete scoop shims" # shim that will be alternated + --global(-g) # Manipulate global shim(s) + --help(-h) # Show help for this command. ] ################################################################ @@ -339,9 +410,9 @@ export extern "scoop shim alter" [ ################################################################ # Locate the path to a shim/executable that was installed with Scoop (similar to 'which' on Linux) -export extern "scoop which" [ - command: string # executable name with .exe - --help (-h) # Show help for this command. +export complete [scoop which] [ + command: text # executable name with .exe + --help(-h) # Show help for this command. ] ################################################################ @@ -349,9 +420,9 @@ export extern "scoop which" [ ################################################################ # Show content of specified manifest. -export extern "scoop cat" [ - app?: string@scoopAllApps # app that will be shown - --help (-h) # Show help for this command. +export complete [scoop cat] [ + app?: by "nu-complete scoop all" # app that will be shown + --help(-h) # Show help for this command. ] ################################################################ @@ -359,8 +430,8 @@ export extern "scoop cat" [ ################################################################ # Performs a series of diagnostic tests to try to identify things that may cause problems with Scoop. -export extern "scoop checkup" [ - --help (-h) # Show help for this command. +export complete [scoop checkup] [ + --help(-h) # Show help for this command. ] ################################################################ @@ -368,9 +439,9 @@ export extern "scoop checkup" [ ################################################################ # Opens the app homepage -export extern "scoop home" [ - app?: string@scoopAllApps # app that will be shown - --help (-h) # Show help for this command. +export complete [scoop home] [ + app?: by "nu-complete scoop all" # app that will be shown + --help(-h) # Show help for this command. ] ################################################################ @@ -378,174 +449,175 @@ export extern "scoop home" [ ################################################################ # Get or set configuration values -export extern "scoop config" [ - --help (-h) # Show help for this command. +export complete [scoop config] [ + ...args: text # The subcommand and its arguments. + --help(-h) # Show help for this command. ] # External 7zip (from path) will be used for archives extraction. -export extern "scoop config use_external_7zip" [ - value?: string@scoopBooleans +export complete [scoop config use_external_7zip] [ + value?: words [true false] ] # Prefer lessmsi utility over native msiexec. -export extern "scoop config use_lessmsi" [ - value?: string@scoopBooleans +export complete [scoop config use_lessmsi] [ + value?: words [true false] ] # Use SQLite database for caching. -export extern "scoop config use_sqlite_cache" [ - value?: string@scoopBooleans +export complete [scoop config use_sqlite_cache] [ + value?: words [true false] ] # The 'current' version alias will not be used. -export extern "scoop config no_junction" [ - value?: string@scoopBooleans +export complete [scoop config no_junction] [ + value?: words [true false] ] # Git repository containing scoop source code. -export extern "scoop config scoop_repo" [ - value?: string@scoopRepos +export complete [scoop config scoop_repo] [ + value?: words [https://github.com/ScoopInstaller/Scoop] ] # Allow to use different branch than master. -export extern "scoop config scoop_branch" [ - value?: string@scoopBranches +export complete [scoop config scoop_branch] [ + value?: words [master develop] ] # [username:password@]host:port -export extern "scoop config proxy" [ - value?: string +export complete [scoop config proxy] [ + value?: text ] # When a conflict is detected during updating, Scoop will auto-stash the uncommitted changes. -export extern "scoop config autostash_on_conflict" [ - value?: string@scoopBooleans +export complete [scoop config autostash_on_conflict] [ + value?: words [true false] ] # Allow to configure preferred architecture for application installation. If not specified, architecture is determined by system. -export extern "scoop config default_architecture" [ - value?: string@scoopArches +export complete [scoop config default_architecture] [ + value?: words [32bit 64bit] ] # Additional and detailed output will be shown. -export extern "scoop config debug" [ - value?: string@scoopBooleans +export complete [scoop config debug] [ + value?: words [true false] ] # Force apps updating to bucket's version. -export extern "scoop config force_update" [ - value?: string@scoopBooleans +export complete [scoop config force_update] [ + value?: words [true false] ] # Do not show changed commits on 'scoop update' -export extern "scoop config show_update_log" [ - value?: string@scoopBooleans +export complete [scoop config show_update_log] [ + value?: words [true false] ] # Displays the manifest of every app that's about to be installed, then asks user if they wish to proceed. -export extern "scoop config show_manifest" [ - value?: string@scoopBooleans +export complete [scoop config show_manifest] [ + value?: words [true false] ] # Choose scoop shim build. -export extern "scoop config shim" [ - value?: string@scoopShimBuilds +export complete [scoop config shim] [ + value?: words [kiennq scoopcs 71] ] # Path to Scoop root directory. -export extern "scoop config root_path" [ - value?: directory +export complete [scoop config root_path] [ + value?: dir ] # Path to Scoop root directory for global apps. -export extern "scoop config global_path" [ - value?: directory +export complete [scoop config global_path] [ + value?: dir ] # For downloads, defaults to 'cache' folder under Scoop root directory. -export extern "scoop config cache_path" [ - value?: directory +export complete [scoop config cache_path] [ + value?: dir ] # GitHub API token used to make authenticated requests. -export extern "scoop config gh_token" [ - value?: string +export complete [scoop config gh_token] [ + value?: text ] # API key used for uploading/scanning files using virustotal. -export extern "scoop config virustotal_api_key" [ - value?: string +export complete [scoop config virustotal_api_key] [ + value?: text ] # "scoop cat" display style. requires "bat" to be installed. -export extern "scoop config cat_style" [ - value?: string@batStyles +export complete [scoop config cat_style] [ + value?: words [default auto full plain changes header header-filename header-filesize grid rule numbers snip] ] # Discard application running messages when reset, uninstall or update -export extern "scoop config ignore_running_processes" [ - value?: string@scoopBooleans +export complete [scoop config ignore_running_processes] [ + value?: words [true false] ] # Array of private hosts that need additional authentication. -export extern "scoop config private_hosts" [ - value?: string +export complete [scoop config private_hosts] [ + value?: text ] # Disable/Hold Scoop self-updates, until the specified date. -export extern "scoop config hold_update_until" [ - value?: string +export complete [scoop config hold_update_until] [ + value?: text ] # Nightly version will be updated after one day if this is set to $true. -export extern "scoop config update_nightly" [ - value?: string@scoopBooleans +export complete [scoop config update_nightly] [ + value?: words [true false] ] # When set to $true, Scoop will use `SCOOP_PATH` environment variable to store apps' `PATH`s. -export extern "scoop config use_isolated_path" [ - value?: string@scoopBooleans +export complete [scoop config use_isolated_path] [ + value?: words [true false] ] # Aria2c will be used for downloading of artifacts. -export extern "scoop config aria2-enabled" [ - value?: string@scoopBooleans +export complete [scoop config aria2-enabled] [ + value?: words [true false] ] # Disable Aria2c warning which is shown while downloading. -export extern "scoop config aria2-warning-enabled" [ - value?: string@scoopBooleans +export complete [scoop config aria2-warning-enabled] [ + value?: words [true false] ] # Number of seconds to wait between retries. -export extern "scoop config aria2-retry-wait" [ - value?: number +export complete [scoop config aria2-retry-wait] [ + value?: text ] # Number of connections used for download. -export extern "scoop config aria2-split" [ - value?: number +export complete [scoop config aria2-split] [ + value?: text ] # The maximum number of connections to one server for each download. -export extern "scoop config aria2-max-connection-per-server" [ - value?: number +export complete [scoop config aria2-max-connection-per-server] [ + value?: text ] # Downloaded files will be split by this configured size and downloaded using multiple connections. -export extern "scoop config aria2-min-split-size" [ - value?: string +export complete [scoop config aria2-min-split-size] [ + value?: text ] # Array of additional aria2 options. -export extern "scoop config aria2-options" [ - value?: string +export complete [scoop config aria2-options] [ + value?: text ] # Remove a configuration setting -export extern "scoop config rm" [ - name: string@scoopConfigs # configuration setting that will be removed - --help (-h) # Show help for this command. +export complete [scoop config rm] [ + name: words [use_external_7zip use_lessmsi use_sqlite_cache no_junction scoop_repo scoop_branch proxy autostash_on_conflict default_architecture debug force_update show_update_log show_manifest shim root_path global_path cache_path gh_token virustotal_api_key cat_style ignore_running_processes private_hosts hold_update_until update_nightly use_isolated_path aria2-enabled aria2-warning-enabled aria2-retry-wait aria2-split aria2-max-connection-per-server aria2-min-split-size aria2-options] # configuration setting that will be removed + --help(-h) # Show help for this command. ] ################################################################ @@ -553,10 +625,10 @@ export extern "scoop config rm" [ ################################################################ # Hold an app to disable updates -export extern "scoop hold" [ - app?: string@scoopInstalledApps # app that will be hold back - --global (-g) # Hold globally installed apps - --help (-h) # Show help for this command. +export complete [scoop hold] [ + app?: by "nu-complete scoop installed" # app that will be hold back + --global(-g) # Hold globally installed apps + --help(-h) # Show help for this command. ] ################################################################ @@ -564,10 +636,10 @@ export extern "scoop hold" [ ################################################################ # Unhold an app to enable updates -export extern "scoop unhold" [ - app?: string@scoopInstalledApps # app that will be unhold back - --global (-g) # Unhold globally installed apps - --help (-h) # Show help for this command. +export complete [scoop unhold] [ + app?: by "nu-complete scoop installed" # app that will be unhold back + --global(-g) # Unhold globally installed apps + --help(-h) # Show help for this command. ] ################################################################ @@ -575,10 +647,10 @@ export extern "scoop unhold" [ ################################################################ # List dependencies for an app, in the order they'll be installed -export extern "scoop depends" [ - app?: string@scoopAllApps # app in question - --arch (-a): string@scoopArches # Use the specified architecture, if the application's manifest supports it. - --help (-h) # Show help for this command. +export complete [scoop depends] [ + app?: by "nu-complete scoop all" # app in question + --arch(-a): words [32bit 64bit] # Use the specified architecture, if the application's manifest supports it. + --help(-h) # Show help for this command. ] ################################################################ @@ -586,9 +658,9 @@ export extern "scoop depends" [ ################################################################ # Exports installed apps, buckets (and optionally configs) in JSON format -export extern "scoop export" [ - --config (-c) # Export the Scoop configuration file too - --help (-h) # Show help for this command. +export complete [scoop export] [ + --config(-c) # Export the Scoop configuration file too + --help(-h) # Show help for this command. ] ################################################################ @@ -596,9 +668,9 @@ export extern "scoop export" [ ################################################################ # Imports apps, buckets and configs from a Scoopfile in JSON format -export extern "scoop import" [ +export complete [scoop import] [ file: path # path to Scoopfile - --help (-h) # Show help for this command. + --help(-h) # Show help for this command. ] ################################################################ @@ -606,10 +678,10 @@ export extern "scoop import" [ ################################################################ # Reset an app to resolve conflicts -export extern "scoop reset" [ - app?: string@scoopInstalledAppsWithStar # app that will be reset - --all (-a) # Reset all apps. (alternative to '*') - --help (-h) # Show help for this command. +export complete [scoop reset] [ + app?: by "nu-complete scoop installed-with-star" # app that will be reset + --all(-a) # Reset all apps. (alternative to '*') + --help(-h) # Show help for this command. ] ################################################################ @@ -617,9 +689,9 @@ export extern "scoop reset" [ ################################################################ # Returns the path to the specified app -export extern "scoop prefix" [ - app?: string@scoopInstalledApps # app in question - --help (-h) # Show help for this command. +export complete [scoop prefix] [ + app?: by "nu-complete scoop installed" # app in question + --help(-h) # Show help for this command. ] ################################################################ @@ -627,16 +699,22 @@ export extern "scoop prefix" [ ################################################################ # Create a custom app manifest -export extern "scoop create" [ - url: string # url of manifest - --help (-h) # Show help for this command. +export complete [scoop create] [ + url: text # url of manifest + --help(-h) # Show help for this command. ] ################################################################ # scoop search ################################################################ +export complete [scoop search] [ + query?: text # Search term for available apps +] + # Search available apps +@example "Search for Python" { scoop search python } +@example "Search for an exact name" { scoop search '^git$' } export def "scoop search" [ query?: string # Show app names that match the query ] { @@ -663,20 +741,22 @@ export def "scoop search" [ ################################################################ # Show the download cache -export extern "scoop cache" [ - apps: string@scoopInstalledAppsWithStar # apps in question - --help (-h) # Show help for this command. +export complete [scoop cache] [ + apps?: by "nu-complete scoop installed-with-star" # apps in question + --help(-h) # Show help for this command. ] # Show the download cache -export extern "scoop cache show" [ - apps: string@scoopInstalledAppsWithStar # apps in question +export complete [scoop cache show] [ + apps?: by "nu-complete scoop installed-with-star" # apps in question + --help(-h) # Show help for this command. ] # Clear the download cache -export extern "scoop cache rm" [ - apps?: string@scoopInstalledAppsWithStar # apps in question - --all (-a) # Clear all apps (alternative to '*') +export complete [scoop cache rm] [ + apps?: by "nu-complete scoop installed-with-star" # apps in question + --all(-a) # Clear all apps (alternative to '*') + --help(-h) # Show help for this command. ] ################################################################ @@ -684,13 +764,13 @@ export extern "scoop cache rm" [ ################################################################ # Download apps in the cache folder and verify hashes -export extern "scoop download" [ - app?: string@scoopAvailableApps # apps in question - --help (-h) # Show help for this command. - --force (-f) # Force download (overwrite cache) - --no-hash-check (-h) # Skip hash verification (use with caution!) - --no-update-scoop (-u) # Don't update Scoop before downloading if it's outdated - --arch (-a): string@scoopArches # Use the specified architecture, if the app supports it +export complete [scoop download] [ + app?: by "nu-complete scoop available" # apps in question + --help(-h) # Show help for this command. + --force(-f) # Force download (overwrite cache) + --no-hash-check(-h) # Skip hash verification (use with caution!) + --no-update-scoop(-u) # Don't update Scoop before downloading if it's outdated + --arch(-a): words [32bit 64bit] # Use the specified architecture, if the app supports it ] ################################################################ @@ -701,6 +781,7 @@ def scoopKnownBuckets [] { ["main" "extras" "versions" "nirsoft" "php" "nerd-fonts" "nonportable" "java" "games" "sysinternals"] } +@non-destructive def scoopInstalledBuckets [] { let bucketsDir = if ('SCOOP' in $env) { [$env.SCOOP 'buckets'] | path join @@ -712,6 +793,7 @@ def scoopInstalledBuckets [] { $buckets } +@non-destructive def scoopAvailableBuckets [] { let known = (scoopKnownBuckets) let installed = (scoopInstalledBuckets) @@ -720,31 +802,32 @@ def scoopAvailableBuckets [] { } # Add, list or remove buckets. -export extern "scoop bucket" [ - --help (-h) # Show help for this command. +export complete [scoop bucket] [ + ...args: text # The subcommand and its arguments. + --help(-h) # Show help for this command. ] # add a bucket -export extern "scoop bucket add" [ - name: string@scoopAvailableBuckets # name of the bucket - repo?: string # url of git repo - --help (-h) # Show help for this command. +export complete [scoop bucket add] [ + name: by "nu-complete scoop available-buckets" # name of the bucket + repo?: text # url of git repo + --help(-h) # Show help for this command. ] # list installed buckets -export extern "scoop bucket list" [ - --help (-h) # Show help for this command. +export complete [scoop bucket list] [ + --help(-h) # Show help for this command. ] # list known buckets -export extern "scoop bucket known" [ - --help (-h) # Show help for this command. +export complete [scoop bucket known] [ + --help(-h) # Show help for this command. ] # remove installed buckets -export extern "scoop bucket rm" [ - name: string@scoopInstalledBuckets # bucket to be removed - --help (-h) # Show help for this command. +export complete [scoop bucket rm] [ + name: by "nu-complete scoop installed-buckets" # bucket to be removed + --help(-h) # Show help for this command. ] ################################################################ @@ -752,12 +835,13 @@ export extern "scoop bucket rm" [ ################################################################ # Look for app's hash or url on virustotal.com -export extern "scoop virustotal" [ - apps: string@scoopInstalledAppsWithStar # apps to be scanned - --all (-a) # Check for all installed apps - --scan (-s) # Send download URL for analysis (and future retrieval). - --no-depends (-n) # By default, all dependencies are checked too. This flag avoids it. - --no-update-scoop (-u) # Don't update Scoop before checking if it's outdated - --passthru (-p) # Return reports as objects - --help (-h) # Show help for this command. +export complete [scoop virustotal] [ + apps: by "nu-complete scoop installed-with-star" # apps to be scanned + --all(-a) # Check for all installed apps + --scan(-s) # Send download URL for analysis (and future retrieval). + --no-depends(-n) # By default, all dependencies are checked too. This flag avoids it. + --no-update-scoop(-u) # Don't update Scoop before checking if it's outdated + --passthru(-p) # Return reports as objects + --help(-h) # Show help for this command. ] + diff --git a/custom-completions/scp/scp-completions.nu b/custom-completions/scp/scp-completions.nu new file mode 100644 index 000000000..41f4c6dbd --- /dev/null +++ b/custom-completions/scp/scp-completions.nu @@ -0,0 +1,113 @@ +# nu-version: 0.116.2 +# Declarative completions for OpenSSH's `scp` and `sftp`. Hosts, users, keys and ciphers come from +# `../ssh/ssh-hosts.nu`. Load with `use scp-completions.nu *`. +# +# scp uses `posix-v1`, not `openssh-v1`: the latter treats every word after the first operand as a +# remote command (ssh's rule), which would swallow scp's second and later operands. `posix-v1` still +# bundles value-less short flags (`-rp`) and attaches values (`-P22`). +# +# Note: a `scp.target` slot completes the `[user@]host:` part of a remote operand; the grammar does +# not fall back to local file names, so type local paths (or use tab on `./`) without its help. + +use ../ssh/ssh-hosts.nu [hosts identity-files algorithms] + +# A remote operand: `[user@]host:path`. The host part is completed live. +export syntax scp.target over chars { + root = (user: (until "@:/")+ "@")? host: until ":@/" ":" rpath: until "" +} + +# `sftp` takes one `[user@]host[:path]`. +export syntax sftp.dest over chars { + root = (user: (until "@:/")+ "@")? host: until ":@/" (":" rpath: until "")? +} + +# `-J` takes a comma-separated list of `[user@]host[:port]` hops. +export syntax scp.jump over chars { + root = hop ("," hop)* + hop = (user: (until "@,")+ "@")? host: until ":@," (":" port: digit+)? +} + +# Hosts from the ssh configuration, known_hosts and /etc/hosts. +@non-destructive +export def "nu-complete scp hosts" [...rest: string]: nothing -> list<record> { + try { hosts | select value description? } catch { [] } +} + +# Private keys in ~/.ssh and the configuration's IdentityFiles. +@non-destructive +export def "nu-complete scp identities" [...rest: string]: nothing -> list<string> { + try { identity-files } catch { [] } +} + +# The ciphers this ssh supports (`ssh -Q cipher`). +@non-destructive +export def "nu-complete scp ciphers" [...rest: string]: nothing -> list<string> { + try { algorithms cipher } catch { [] } +} + +# Copy files between hosts over ssh. +export complete [scp] profile posix-v1 [ + -3 # Copy between two remote hosts through this machine + -4 # Use IPv4 addresses only + -6 # Use IPv6 addresses only + -A # Forward the authentication agent + -B # Batch mode: never ask for a password or passphrase + -C # Compress the data + -c: by "nu-complete scp ciphers" # Cipher to encrypt the transfer with + -D: path # Path of the sftp server to run + -F: path # ssh configuration file to use + -i: by "nu-complete scp identities" # Identity file to authenticate with + -J: scp.jump with { hop.host: by "nu-complete scp hosts" } # Jump hosts to connect through + -l: text # Bandwidth limit in Kbit/s + -O # Use the legacy SCP protocol + -o: text # ssh option, as Keyword=value + -P: text # Port to connect to + -p # Preserve times and modes + -q # Quiet mode: no progress meter + -R # Copy between two remote hosts directly + -r # Copy directories recursively + -S: path # Program to use for the connection + -s # Use the SFTP protocol (the default) + -T # Do not check the file names the server sends + -v # Verbose mode + -X: text # Option for the SFTP protocol + ...paths: scp.target with { root.host: by "nu-complete scp hosts" } # Sources, then the target: a path, or [user@]host:path +] where { + at-most-one [-4 -6] + at-most-one [-O -s] + at-most-one [-3 -R] + at-most-one [-q -v] +} + +# Transfer files over an ssh connection, interactively. +export complete [sftp] profile openssh-v1 [ + -4 # Use IPv4 addresses only + -6 # Use IPv6 addresses only + -A # Forward the authentication agent + -a # Continue interrupted transfers + -B: text # Size of the buffer for transfers + -b: path # File of commands to run, or - for stdin + -C # Compress the data + -c: by "nu-complete scp ciphers" # Cipher to encrypt the transfer with + -D: text # Server command to run directly + -F: path # ssh configuration file to use + -f # Flush files to disk after transfer + -i: by "nu-complete scp identities" # Identity file to authenticate with + -J: scp.jump with { hop.host: by "nu-complete scp hosts" } # Jump hosts to connect through + -l: text # Bandwidth limit in Kbit/s + -N # Show the progress meter and warnings + -o: text # ssh option, as Keyword=value + -P: text # Port to connect to + -p # Preserve times and modes + -q # Quiet mode + -R: text # Requests allowed in flight + -r # Copy directories recursively + -S: path # Program to use for the connection + -s: text # Subsystem, or sftp server program + -v # Verbose mode + -X: text # Option for the SFTP protocol + destination: sftp.dest with { root.host: by "nu-complete scp hosts" } # [user@]host[:path] +] where { + at-most-one [-4 -6] + at-most-one [-q -v] +} diff --git a/custom-completions/ssh/README.md b/custom-completions/ssh/README.md index 7b388a4f6..ec518df4d 100644 --- a/custom-completions/ssh/README.md +++ b/custom-completions/ssh/README.md @@ -1,43 +1,109 @@ # SSH completions -A Nushell extern definition and completers for the ssh command. +Extern definitions and completers for `ssh`, `scp`, `sftp` and `rsync`. They use the `token`, +`place` and `delegate` parts of the completion contract, so they need the reworked completion engine. -This module provides extern definitions for most of the ssh command options and flags. +```nu +use path/to/ssh/ssh-completions.nu * +use path/to/scp/scp-completions.nu * # scp and sftp +use path/to/rsync/rsync-completions.nu * +``` -## Usage +`ssh-hosts.nu` holds what they share; it is loaded by them and is not meant to be used on its own. -Simply import the extern definitions with +## Hosts -```nu -source path/to/ssh-completions.nu -``` +One row for each host, from: -This script will parse `/etc/ssh/ssh_config` and `~/.ssh/config` to fetch SSH config hosts. +- `~/.ssh/config` and `/etc/ssh/ssh_config`, with `Include` followed (globs, `~`, and paths relative + to `~/.ssh` or `/etc/ssh`). Every name on a `Host` line counts, hosts without a `HostName` too. + Patterns (`*`, `?`, `!`) and `Match` blocks name no one. +- the `known_hosts` files ssh reads: the default ones, and those the configuration names with + `UserKnownHostsFile` and `GlobalKnownHostsFile`. Hashed entries cannot be read, and are skipped. +- `/etc/hosts`. -Given the following config: +The description says only what the name does not. For a host of the configuration that is +`user@hostname:port` as ssh would use them (the first value read wins, wildcard blocks included), and +nothing where the name already says it all. A host only `known_hosts` has says its port if that is +not 22; one from `/etc/hosts` says its address. `ssh -F file` reads that file instead. -``` -Host my-ip - HostName 192.168.50.237 -Host mydomain - HostName mydomain.example.com -Host no.hostname - ProxyCommand ssh -q -W %h:%p office -Host my-domain-2 - HostName mydomain-2.example.com -Host my_domain_3 - HostName mydomain_3.example.com -``` +## What is typed, part by part +A destination is read as ssh reads it, and each part completes in place, so that only that part of the +word is replaced: `ssh root@ilo` gives the hosts after the `@`, `ssh ro` gives the users as `root@` (no +space, a host comes next) and the hosts, and `ssh ssh://root@ilo-prod:` gives the port of the host. +`-J user@jump:2200,other` does the same after each comma, `@` and `:`. -When you press the tab key, it will display: +Each part is offered with the character that follows it where that is certain: users as `root@`, a +host to `scp` as `ilo-prod:` (the paths of the host come next). In a URL, `ssh ssh://` offers the users +as `root@` and the hosts, `ssh ssh://root@ilo-prod` the host itself (a space follows, the destination is +whole) and `ilo-prod:`, and also `fx-dev:2222` for a host whose port is not 22. The same goes for `-J`. -``` -❯ | ssh -my-ip 192.168.50.237 -mydomain mydomain.example.com -no.hostname -my-domain-2 mydomain-2.example.com -my_domain_3 mydomain_3.example.com - -``` \ No newline at end of file +- `-p` (and scp's `-P`, and `-o Port=`) offers the port the host's configuration sets, or `known_hosts` + noted for it, else 22, and the description says which. The host is the one the line has named. +- `-L` and `-R` take `[bind:]port:host:hostport` a field at a time: a port, then `:` once one is typed, + then the hosts (`localhost` first), then the port chosen at the start or a common service. `-D` offers + a local port that looks free (1080 on, found by binding one). +- `-o` completes the keywords as `Keyword=`, then their values; `ProxyJump=` completes hosts as `-J` + does, and `Port=`, `User=` and `IdentityFile=` as `-p`, `-l` and `-i` do. +- `scp file us` offers the hosts (with a colon, no space) and the users (`user@`) beside the files. + +## Speed + +Flags and the values of flags that are local answer without reading a thing: `ssh -` and `scp -` do not +ask for hosts (a flag is no host), and `ssh -Q` is run once per session for `-c` and `-m`. What is read +from files (the configuration with its `Include`s, `known_hosts`, `/etc/hosts`, the keys of `~/.ssh`) +is read once and kept in memory (`stor`, nothing on disk) together with the modification times of the +files and the entries of the directories it came from. The next completion looks at those times, a +few milliseconds, and reads again only if one has changed or a file is new. Keys' permissions are asked +of `ls` once for all of them, and the answer lasts two seconds (a mode has no modification time). +`ssh-check.nu` times all of it: 30 ms for the completers on a configuration that is read, 100 ms for the +first read of a new one. + +## When something looks wrong + +The status line says what is wrong where nothing can be offered, and where the cause is a name or a path +something is offered in its place: + +- A host in no configuration, `known_hosts` or `/etc/hosts`: `no host zzz in your ssh config, + known_hosts or /etc/hosts`. If a known host is a few edits away, it is offered in the place of the + typo, and its description says `no host ilo-prd; did you mean ilo-prod?` (the engine shows a message + only while the list is empty, a description when the suggestion is selected). The same goes for the host + of a remote command that ssh cannot resolve. Addresses are never questioned. +- `ssh host:path` is scp's syntax: ssh takes no path. Where the line is no more than that, `scp + host:path` is offered in place of it; with flags before (`-p` means something else to scp) only the + message. +- `-i` with a file that is not there says so; a private key that group or others can read has that + as its description, because ssh will not use it. The file is offered with it when typed in full. + +## Other options + +`-i` offers the identity files of `~/.ssh` and those the configuration names, then files. `-l` offers +users, `-c` and `-m` the algorithms ssh lists. Options that take a free value (`-b`, `-e`, ...) +complete nothing, and no files. + +## The remote command + +`ssh HOST cmd args` and `ssh HOST 'cmd args` (the quote still open) complete as a command line on +the host: + +- the first word, from the host's commands (`compgen -c`, or its `PATH`); +- arguments, from the host's files, directories ending in `/`. + +The command is read from the line as ssh reads it (flags, the host, more flags, `--`, then the +command), so its own flags are its own: `ssh HOST ls -l re`, `tail -n 20 re` and `grep -i foo re` +complete files, and the `-l`, `-n` or `-i` is no ssh option. + +Both are listed with `ssh -o BatchMode=yes -o ConnectTimeout=3`, so ssh never asks anything, and +with the connection options of the line (`-p`, `-i`, `-F`, `-J`, `-l`, `-o`). A host that does not +answer offers nothing, and never the local files, and the status line says why: `ilo-prod's host key +isn't trusted yet: connect once with ssh ilo-prod`, `ilo-prod needs a password or key that isn't +loaded`, or `ilo-prod didn't answer`. Host key checking is never weakened. The completion engine keeps +the answers for about half a minute (a failure for five seconds), so typing on does not ask the host +again. + +## scp, sftp, rsync + +`host:` completes the files of the host the same way. A word that is a path completes local files; a +word without a `/` also offers the hosts, with a colon and no space after it. `rsync -e 'ssh -p 2222'` +lists with the same options. diff --git a/custom-completions/ssh/ssh-completions.nu b/custom-completions/ssh/ssh-completions.nu index 2cd4a263d..76200d5d1 100644 --- a/custom-completions/ssh/ssh-completions.nu +++ b/custom-completions/ssh/ssh-completions.nu @@ -1,121 +1,285 @@ -# nu-version: 0.102.0 +# nu-version: 0.116.2 +# Declarative completions for OpenSSH's `ssh`. The `openssh-v1` profile knows which short flags take +# a value, so `ssh -p 22 host cmd` routes `cmd` to the remote command. Hosts, users, keys and +# algorithms come from `ssh-hosts.nu` (ssh configuration, known_hosts, /etc/hosts, `ssh -Q`). +# Load with `use ssh-completions.nu *`. -export extern "ssh" [ - destination?: string@"nu-complete ssh-host" - -4 # Forces ssh to use IPv4 addresses only. - -6 # Forces ssh to use IPv6 addresses only. - -A # Enables forwarding of connections from an authentication agent such as ssh-agent(1). - -a # Disables forwarding of the authentication agent connection. - -B: string # bind_interface - -b: string # bind_address - -C # Requests compression of all data - -c: string # cipher_spec - -D # [bind_address:]port - -E: string # log_file - -e # escape_char - -F: string # configfile - -f # Requests ssh to go to background just before command execution. - -G # Causes ssh to print its configuration after evaluating Host and Match blocks and exit. - -g # Allows remote hosts to connect to local forwarded ports - -I: string # pkcs11 - -i: string # identity_file - -J: string # destination - -K # Enables GSSAPI-based authentication and forwarding(delegation) of GSSAPI credentials to the server. - -k # Disables forwarding (delegation) of GSSAPI credentials to the server. - -L: string # [bind_address:]port:host:hostport / [bind_address:]port:remote_socket / local_socket:host:hostport / local_socket:remote_socket - -l: string # login_name - -M # Places the ssh client into “master” mode for connection sharing. - -m: string # mac_spec - -N # Do not execute a remote command. - -n # Redirects stdin from /dev/null (5) for details. - -O: string # ctl_cmd - -o: string # option +use ssh-hosts.nu [hosts users identity-files algorithms] + +# The hosts ssh knows, one row each: `name` and the `address` (`[user@]hostname[:port]`) its +# configuration gives it, if any. Reads only the ssh configuration, `known_hosts` and `/etc/hosts`. +@non-destructive +@example "Look up a host's address from ssh config" { ssh-hosts | where name == myserver | get address.0 } +export def ssh-hosts []: nothing -> table<name: string, address: string> { + hosts | each {|host| {name: $host.value, address: ($host.description? | default '')} } +} + +# The keywords `ssh -o` takes (see `man ssh_config`), what each does, and the values it is known to take. +const YES_NO = [yes no] +const OPTIONS = [[name about values]; + [AddKeysToAgent "Add keys to ssh-agent when they are used" [yes no ask confirm]] + [AddressFamily "Address family to connect with" [any inet inet6]] + [BatchMode "Never ask for a password or passphrase" $YES_NO] + [BindAddress "Local address to connect from" []] + [BindInterface "Local interface to connect from" []] + [CanonicalDomains "Domains to search for the host name" []] + [CanonicalizeFallbackLocal "Fall back to the name as given when canonicalising fails" $YES_NO] + [CanonicalizeHostname "Canonicalise the host name" [yes no always]] + [CanonicalizeMaxDots "Most dots a name may have and still be canonicalised" []] + [CanonicalizePermittedCNAMEs "CNAME rules canonicalisation follows" []] + [CASignatureAlgorithms "Algorithms allowed for certificate authority signatures" []] + [CertificateFile "Certificate to authenticate with" []] + [ChannelTimeout "Close channels left idle this long" []] + [CheckHostIP "Also check the host's IP address in known_hosts" $YES_NO] + [Ciphers "Ciphers to use, in order of preference" []] + [ClearAllForwardings "Clear every configured forwarding" $YES_NO] + [Compression "Compress the connection" $YES_NO] + [ConnectionAttempts "Tries to make before giving up" []] + [ConnectTimeout "Seconds to wait for the connection" []] + [ControlMaster "Share one connection between sessions" [yes no ask auto autoask]] + [ControlPath "Socket of a shared connection" []] + [ControlPersist "Keep a shared connection open in the background" [yes no]] + [DynamicForward "Forward a local port as a SOCKS proxy" []] + [EnableEscapeCommandline "Allow the escape command line" $YES_NO] + [EnableSSHKeysign "Use ssh-keysign for host-based authentication" $YES_NO] + [EscapeChar "Character that starts an escape sequence" []] + [ExitOnForwardFailure "Exit when a forwarding cannot be set up" $YES_NO] + [FingerprintHash "Hash to show key fingerprints with" [md5 sha256]] + [ForkAfterAuthentication "Go to the background once authenticated" $YES_NO] + [ForwardAgent "Forward the authentication agent" $YES_NO] + [ForwardX11 "Forward X11 connections" $YES_NO] + [ForwardX11Timeout "How long X11 forwarding stays usable" []] + [ForwardX11Trusted "Give X11 clients full access to the display" $YES_NO] + [GatewayPorts "Let other hosts use forwarded local ports" $YES_NO] + [GlobalKnownHostsFile "System-wide known_hosts files" []] + [GSSAPIAuthentication "Authenticate with GSSAPI" $YES_NO] + [GSSAPIDelegateCredentials "Forward GSSAPI credentials" $YES_NO] + [HashKnownHosts "Hash host names in known_hosts" $YES_NO] + [HostbasedAcceptedAlgorithms "Algorithms allowed for host-based authentication" []] + [HostbasedAuthentication "Authenticate with the host's key" $YES_NO] + [HostKeyAlgorithms "Host key algorithms, in order of preference" []] + [HostKeyAlias "Name to look the host key up by" []] + [Hostname "Real host name to connect to" []] + [IdentitiesOnly "Use only the identity files given" $YES_NO] + [IdentityAgent "Socket of the authentication agent" []] + [IdentityFile "Private key to authenticate with" []] + [IgnoreUnknown "Options not to complain about" []] + [Include "Read another configuration file" []] + [IPQoS "Type of service for connections" []] + [KbdInteractiveAuthentication "Authenticate with keyboard-interactive" $YES_NO] + [KbdInteractiveDevices "Keyboard-interactive methods to try" []] + [KexAlgorithms "Key exchange algorithms, in order of preference" []] + [KnownHostsCommand "Command that supplies host keys" []] + [LocalCommand "Command to run locally after connecting" []] + [LocalForward "Forward a local port to the remote side" []] + [LogLevel "How much ssh logs" [QUIET FATAL ERROR INFO VERBOSE DEBUG DEBUG1 DEBUG2 DEBUG3]] + [LogVerbose "Patterns to log verbosely" []] + [MACs "Message authentication codes, in order of preference" []] + [NoHostAuthenticationForLocalhost "Skip host authentication for loopback" $YES_NO] + [NumberOfPasswordPrompts "Password prompts before giving up" []] + [ObscureKeystrokeTiming "Hide keystroke timing in interactive sessions" []] + [PasswordAuthentication "Authenticate with a password" $YES_NO] + [PermitLocalCommand "Allow LocalCommand" $YES_NO] + [PermitRemoteOpen "Destinations a remote forwarding may open" []] + [PKCS11Provider "PKCS#11 library to use" []] + [Port "Port to connect to" []] + [PreferredAuthentications "Authentication methods, in order of preference" [gssapi-with-mic hostbased publickey keyboard-interactive password]] + [ProxyCommand "Command that makes the connection" []] + [ProxyJump "Hosts to jump through" []] + [ProxyUseFdpass "Let ProxyCommand pass the connection back as a descriptor" $YES_NO] + [PubkeyAcceptedAlgorithms "Public key algorithms allowed" []] + [PubkeyAuthentication "Authenticate with a public key" [yes no unbound host-bound]] + [RefuseConnection "Refuse the connection with this message" []] + [RekeyLimit "Data or time after which to renegotiate keys" []] + [RemoteCommand "Command to run on the remote side" []] + [RemoteForward "Forward a remote port to the local side" []] + [RequestTTY "Request a pseudo-terminal" [no yes force auto]] + [RequiredRSASize "Smallest RSA key accepted" []] + [RevokedHostKeys "File of revoked host keys" []] + [SecurityKeyProvider "FIDO authenticator library to use" []] + [SendEnv "Environment variables to send" []] + [ServerAliveCountMax "Unanswered probes before disconnecting" []] + [ServerAliveInterval "Seconds of silence before probing the server" []] + [SessionType "Kind of session to start" [none subsystem default]] + [SetEnv "Environment variables to set" []] + [StdinNull "Read stdin from /dev/null" $YES_NO] + [StreamLocalBindMask "Permissions for forwarded sockets" []] + [StreamLocalBindUnlink "Remove a forwarded socket that is in the way" $YES_NO] + [StrictHostKeyChecking "What to do with unknown or changed host keys" [yes no ask accept-new off]] + [SyslogFacility "Syslog facility to log to" []] + [Tag "Tag that Match can select on" []] + [TCPKeepAlive "Send TCP keepalive messages" $YES_NO] + [Tunnel "Forward a tun device" [yes no point-to-point ethernet]] + [TunnelDevice "Local and remote tun devices" []] + [UpdateHostKeys "Learn the other host keys a server has" [yes no ask]] + [User "User to log in as" []] + [UserKnownHostsFile "Per-user known_hosts files" []] + [VerifyHostKeyDNS "Verify host keys with DNS" [yes no ask]] + [VersionAddendum "Text to add to the version banner" []] + [VisualHostKey "Show the host key as ASCII art" $YES_NO] + [WarnWeakCrypto "Warn about weak cryptography" $YES_NO] + [XAuthLocation "Path of xauth" []] ] -module ssh-completion-utils { - # Drop a trailing comment, like in "Host foo # my server" - def strip-comment []: string -> string { - $in | str replace -r '\s+#.*$' '' - } - def extract-host []: list<string> -> record<names: list<string>, addr: string> { - # Host is a list of lines, like: - # ╭───┬──────────────────────────────╮ - # │ 0 │ Host quanweb │ - # │ 1 │ User quan │ - # │ 2 │ Hostname quan.hoabinh.vn │ - # │ 3 │ # ProxyJump farmb-omz │ - # │ 4 │ │ - # ╰───┴──────────────────────────────╯ - let host = $in - let first_line = try { $host | first | str trim } catch { null } - # Don't accept blocks like "Host *" - if ($first_line | is-empty) or '*' in $first_line { - null - } else { - let names = $first_line | strip-comment | split row -r '\s+' | reject 0 - # May not contain hostname - match ($host | slice 1.. | find -n -ir '^\s*Hostname\s') { - [] => null, - $addr => { names: $names, addr: ($addr | str trim | split row -n 2 -r '\s+' | get 1) } - } - } - } +# `[user@]host` — the user part is offered through `-l`; the host part is completed live. +export syntax ssh.dest over chars { + root = (user: (until "@")+ "@")? host: until ":@" +} - # Process a SSH config file - export def process []: string -> record<hosts: table<names: list<string>, addr: string>, includes: list<string>> { - let lines = $in | lines - # Get 'Include' lines - # One Include line can list several files - let include_lines = $lines | find -n -ir '^Include\s' | each { - strip-comment | str trim | str replace -r '^\S+\s+' '' - | parse -r '"(?<quoted>[^"]*)"|(?<plain>[^\s"]+)' - | each { if ($in.quoted | is-empty) { $in.plain } else { $in.quoted } } - } | flatten - # Find "Host" blocks - let marks = $lines | enumerate | find -n -ir '^Host\s' - let mark_indices = $marks | get index | append ($lines | length) - let hosts = $mark_indices | window 2 | each {|w| $lines | slice $w.0..<($w.1) } - { - hosts: ($hosts | each { $in | extract-host }), - includes: $include_lines - } - } +# `-J` takes a comma-separated list of `[user@]host[:port]` hops. +export syntax ssh.jump over chars { + root = hop ("," hop)* + hop = (user: (until "@,")+ "@")? host: until ":@," (":" port: digit+)? +} +# `-o Keyword=value`, as in ssh_config. +export syntax ssh.option over chars { + root = key: word "=" val: until "" } +# Hosts from the ssh configuration, known_hosts and /etc/hosts, described by their address. +@non-destructive +export def "nu-complete ssh hosts" [...rest: string]: nothing -> list<record> { + try { hosts | select value description? } catch { [] } +} -def "nu-complete ssh-host" [] { - let files = [ - '/etc/ssh/ssh_config', - '~/.ssh/config' - ] | where {|file| $file | path exists } +# Login names from the ssh configuration, and the current user. +@non-destructive +export def "nu-complete ssh users" [...rest: string]: nothing -> list<string> { + try { users } catch { [] } +} - use ssh-completion-utils process +# Private keys in ~/.ssh and the configuration's IdentityFiles. +@non-destructive +export def "nu-complete ssh identities" [...rest: string]: nothing -> list<string> { + try { identity-files } catch { [] } +} + +# The ciphers this ssh supports (`ssh -Q cipher`). +@non-destructive +export def "nu-complete ssh ciphers" [...rest: string]: nothing -> list<string> { + try { algorithms cipher } catch { [] } +} - let first_result = $files | par-each {|file| - let folder = $file | path expand | path dirname - mut r = $file | open --raw | process - $r.includes = $r.includes | each {|f| - if ($f | str starts-with '~') { $f | path expand --no-symlink } else { $folder | path join $f } - } - $r - } | reduce {|it| merge deep $it --strategy=append } +# The MACs this ssh supports (`ssh -Q mac`). +@non-destructive +export def "nu-complete ssh macs" [...rest: string]: nothing -> list<string> { + try { algorithms mac } catch { [] } +} - let $includes: list<string> = $first_result.includes | each {|f| - if '*' in $f { - glob $f - } else if ($f | path exists) { - [$f] - } else [] - } | flatten +# The query kinds `ssh -Q` accepts (`ssh -Q help`). +@non-destructive +export def "nu-complete ssh queries" [...rest: string]: nothing -> list<string> { + try { ^ssh -Q help | lines | where $it != '' } catch { [cipher cipher-auth compression kex key key-cert key-plain key-sig mac protocol-version sig] } +} - # Process include files - let included_hosts = (if ($includes | is-empty) { [] } else { - let second_result = $includes | par-each {|p| $p | open --raw | process } | reduce {|it| merge deep $it --strategy=append } - $second_result.hosts - }) +# The ssh_config keywords `-o` takes, described. +@non-destructive +export def "nu-complete ssh option-keys" [...rest: string]: nothing -> list<record<value: string, description: string>> { + try { $OPTIONS | each {|o| {value: $o.name, description: $o.about} } } catch { [] } +} - let hosts = $first_result.hosts ++ $included_hosts - $hosts | each { {value: $in.names, description: $in.addr } } | flatten +# Log in to a remote machine, or run a command on it. +export complete [ssh] profile openssh-v1 [ + -4 # Use IPv4 addresses only + -6 # Use IPv6 addresses only + -A # Forward the authentication agent connection + -a # Do not forward the authentication agent + -B: text # Bind to the address of this interface + -b: text # Local address to connect from + -C # Compress all data + -c: by "nu-complete ssh ciphers" # Ciphers to encrypt the session with + -D: text # Dynamic forwarding as a SOCKS proxy: [bind_address:]port + -E: path # Append debug logs to this file + -e: text # Escape character, or none + -F: path # Configuration file to use + -f # Go to the background before running the command + -G # Print the configuration for the host and exit + -g # Let remote hosts use local forwarded ports + -I: path # PKCS#11 provider library + -i: by "nu-complete ssh identities" # Identity file to authenticate with + -J: ssh.jump with { hop.host: by "nu-complete ssh hosts" } # Jump hosts to connect through + -K # Authenticate with GSSAPI and forward credentials + -k # Do not forward GSSAPI credentials + -L: text # Forward a local port: [bind_address:]port:host:hostport + -l: by "nu-complete ssh users" # User to log in as + -M # Be the master of a shared connection + -m: by "nu-complete ssh macs" # Message authentication codes to use + -N # Do not run a command + -n # Read no input from stdin + -O: words [check: "Check the master is running" forward: "Request forwardings" cancel: "Cancel forwardings" proxy: "Connect to a running master in proxy mode" exit: "Ask the master to exit" stop: "Ask the master to stop accepting connections"] + -o: ssh.option with { root.key: by "nu-complete ssh option-keys", root.val: keyed fold { + AddKeysToAgent: ["yes" "no" "ask" "confirm"] + AddressFamily: ["any" "inet" "inet6"] + BatchMode: ["yes" "no"] + CanonicalizeFallbackLocal: ["yes" "no"] + CanonicalizeHostname: ["yes" "no" "always"] + CheckHostIP: ["yes" "no"] + ClearAllForwardings: ["yes" "no"] + Compression: ["yes" "no"] + ControlMaster: ["yes" "no" "ask" "auto" "autoask"] + ControlPersist: ["yes" "no"] + EnableEscapeCommandline: ["yes" "no"] + EnableSSHKeysign: ["yes" "no"] + ExitOnForwardFailure: ["yes" "no"] + FingerprintHash: ["md5" "sha256"] + ForkAfterAuthentication: ["yes" "no"] + ForwardAgent: ["yes" "no"] + ForwardX11: ["yes" "no"] + ForwardX11Trusted: ["yes" "no"] + GatewayPorts: ["yes" "no"] + GSSAPIAuthentication: ["yes" "no"] + GSSAPIDelegateCredentials: ["yes" "no"] + HashKnownHosts: ["yes" "no"] + HostbasedAuthentication: ["yes" "no"] + IdentitiesOnly: ["yes" "no"] + KbdInteractiveAuthentication: ["yes" "no"] + LogLevel: ["QUIET" "FATAL" "ERROR" "INFO" "VERBOSE" "DEBUG" "DEBUG1" "DEBUG2" "DEBUG3"] + NoHostAuthenticationForLocalhost: ["yes" "no"] + PasswordAuthentication: ["yes" "no"] + PermitLocalCommand: ["yes" "no"] + PreferredAuthentications: ["gssapi-with-mic" "hostbased" "publickey" "keyboard-interactive" "password"] + ProxyUseFdpass: ["yes" "no"] + PubkeyAuthentication: ["yes" "no" "unbound" "host-bound"] + RequestTTY: ["no" "yes" "force" "auto"] + SessionType: ["none" "subsystem" "default"] + StdinNull: ["yes" "no"] + StreamLocalBindUnlink: ["yes" "no"] + StrictHostKeyChecking: ["yes" "no" "ask" "accept-new" "off"] + TCPKeepAlive: ["yes" "no"] + Tunnel: ["yes" "no" "point-to-point" "ethernet"] + UpdateHostKeys: ["yes" "no" "ask"] + VerifyHostKeyDNS: ["yes" "no" "ask"] + VisualHostKey: ["yes" "no"] + WarnWeakCrypto: ["yes" "no"] + } by root.key } # Set an option as in ssh_config: Keyword=value + -P: text # Tag to select configuration with + -p: text # Port to connect to + -Q: by "nu-complete ssh queries" # List the algorithms of a kind and exit + -q # Quiet mode + -R: text # Forward a remote port: [bind_address:]port:host:hostport + -S: path # Socket of a shared connection + -s # Request a subsystem on the remote machine + -T # Do not allocate a pseudo-terminal + -t # Force a pseudo-terminal + -V # Show the version and exit + -v # Verbose mode, once more for more + -W: text # Forward stdin and stdout to host:port + -w: text # Forward a tun device: local_tun[:remote_tun] + -X # Forward X11 connections + -x # Do not forward X11 connections + -Y # Forward X11 connections as trusted + -y # Send logs to syslog + -Z # List the public keys that would be tried and exit + destination: ssh.dest with { root.host: by "nu-complete ssh hosts" } # [user@]hostname + ...command: script at destination with [-p -l -i -F -J -o] # Command to run on the remote machine +] where { + at-most-one [-4 -6] + at-most-one [-q -v] + at-most-one [-t -T] + at-most-one [-A -a] + at-most-one [-X -x -Y] + at-most-one [-K -k] + terminal [-V -Q] } diff --git a/custom-completions/ssh/ssh-hosts.nu b/custom-completions/ssh/ssh-hosts.nu new file mode 100644 index 000000000..eb64e4072 --- /dev/null +++ b/custom-completions/ssh/ssh-hosts.nu @@ -0,0 +1,640 @@ +# nu-version: 0.114.0 + +# What `ssh`, `scp`, `sftp` and `rsync` completions know about hosts, and how they list the files and +# commands of one. Loaded by those completions; there is nothing here to `use` by itself. + +# Settings kept per block of `ssh_config`, where the first one read wins, as it does for ssh. +const SINGLE = [hostname user port proxyjump userknownhostsfile globalknownhostsfile hostkeyalias forwardagent proxycommand] +# Settings kept per block that may be given more than once. +const MULTIPLE = [identityfile localforward remoteforward dynamicforward] + +# The words of a line of `ssh_config`: split at spaces, a quoted word kept whole. +def words []: string -> list<string> { + let line = $in + if '"' not-in $line { return ($line | split row --regex '\s+' | where $it != '') } + $line | parse --regex '"(?<quoted>[^"]*)"|(?<bare>\S+)' | each {|word| if ($word.bare | is-empty) { $word.quoted } else { $word.bare } } +} + +# What was worked out is kept for the session, in the in-memory database `stor` gives (nothing is +# written to disk), together with the files it was worked out from and when they were last modified. +# The next completion reads those files' times, which is a few `stat`s, and parses nothing while they +# are the same: ssh's configuration and `known_hosts` are read once, not on every key typed. +const CACHE = 'ssh_completion_cache' + +# What `paths` were like, to tell later whether they still are: the files with the time each was last +# modified (a link is followed), the directories with a hash of the names and times in them, and the +# paths that were not there. Plain `ls` only: a user's own `ls` may take no flags, and sorts as it likes. +def snapshot [paths: list<string>]: nothing -> record { + let real = $paths | each {|path| if ($path | path exists) { $path | path expand } else { null } } + let files = $real | compact | where {|path| ($path | path type) == file } + { + absent: ($paths | zip $real | where {|pair| $pair.1 == null } | each { first }) + files: $files + dirs: ($real | compact | where {|path| $path not-in $files }) + } | merge (look-at $files ($real | compact | where {|path| $path not-in $files })) +} + +# The times of `files` and the hashes of `dirs` as they are (see `snapshot`). +def look-at [files: list<string>, dirs: list<string>]: nothing -> record { + let times = if ($files | is-empty) { [] } else { ls ...$files | select name modified | sort-by name | update modified { into int } } + {times: $times, hashes: ($dirs | each {|dir| ls $dir | select name modified | to json --raw | hash md5 })} +} + +# Whether the paths of `snapshot` are as they were: still absent paths still absent, and files and +# directories with the same times. A file that went is a change too. +def unchanged [snapshot: record]: nothing -> bool { + if ($snapshot.absent | any {|path| $path | path exists }) { return false } + let now = try { look-at $snapshot.files $snapshot.dirs } catch { return false } + $now.times == $snapshot.times and $now.hashes == $snapshot.hashes +} + +# What `build` gives under `key`, from the cache while the files it names are unchanged. `build` is a +# closure returning `{value, files}`: the answer, and the paths it depends on (a path that is not +# there yet counts, and so does a directory whose entries decide the answer). With `ttl`, an answer +# that young is taken without looking at the files, for what no modification time tells. +def cached [key: string, build: closure, --ttl: duration = 0sec]: nothing -> any { + # A shell built without SQLite has no `stor`: then every answer is built afresh. + let db = try { stor open } catch { return (do $build).value } + let now = date now | into int + let hit = try { + $db | query db $"create table if not exists ($CACHE) \(key text primary key, at integer, files text, value text\)" + $db | query db $"select at, files, value from ($CACHE) where key = :key" --params {key: $key} | get --optional 0 + } + if $hit != null and (($now - $hit.at) < ($ttl | into int) or (unchanged ($hit.files | from json))) { return ($hit.value | from json) } + let built = do $build + try { + $db | query db $"insert or replace into ($CACHE) \(key, at, files, value\) values \(:key, :at, :files, :value\)" --params {key: $key, at: $now, files: (snapshot $built.files | to json --raw), value: ($built.value | to json --raw)} + } + $built.value +} + +# The files an `Include` names: `~` is the home directory, a relative path is relative to `base`, and +# the globs expand. `watch` is what a change to would change the answer: the directory a glob looks +# in, or the file named, there or not. +def include-files [spec: string, base: string]: nothing -> record<files: list<string>, watch: list<string>> { + let full = if ($spec | str starts-with '~') { $spec | path expand --no-symlink } else if ($spec | str starts-with '/') { $spec } else { $base | path join $spec } + if $full =~ '[*?\[]' { + let dir = $full | path split | take while {|part| $part !~ '[*?\[]' } | path join + {files: (glob --no-dir $full | sort), watch: [$dir]} + } else { + {files: (if ($full | path exists) { [$full] } else { [] }), watch: [$full]} + } +} + +# The `Host` blocks of an `ssh_config` file, with its `Include`s read where they stand, and every +# path read or looked for (`files`). The settings before the first `Host` belong to the block +# `within`, which an include inside a block inherits. +# +# A block is `{patterns, set}`. A `Match` block applies to nothing: whether it matches depends on the +# connection, which is not made. +def read-config [file: string, base: string, within: list<string>, depth: int]: nothing -> record<blocks: list<record>, files: list<string>> { + if $depth > 8 or not ($file | path exists) { return {blocks: [], files: [$file]} } + let rows = try { + open --raw $file | into string | parse --regex '(?m)^[ \t]*(?<key>[A-Za-z0-9]+)(?:[ \t]*=[ \t]*|[ \t]+)(?<value>.*?)[ \t\r]*(?:[ \t]#.*)?$' + } catch { return {blocks: [], files: [$file]} } + + # The blocks done with, the one being read (`patterns` and `set`), and what its `Include`s read, + # which comes right after it. + mut blocks = [] + mut patterns = $within + mut set = {} + mut included = [] + mut files = [$file] + for row in $rows { + let key = $row.key | str lowercase + let value = $row.value + if $key == 'host' or $key == 'match' { + $blocks = $blocks ++ [{patterns: $patterns, set: $set}] ++ $included + $patterns = if $key == 'host' { $value | words } else { [] } + $set = {} + $included = [] + } else if $key == 'include' { + for spec in ($value | words) { + let found = include-files $spec $base + $files = $files ++ $found.watch + for path in $found.files { + let read = read-config $path $base $patterns ($depth + 1) + $included = $included ++ $read.blocks + $files = $files ++ $read.files + } + } + } else if $key in $SINGLE { + if $key not-in ($set | columns) { $set = $set | insert $key $value } + } else if $key in $MULTIPLE { + $set = $set | upsert $key (($set | get --optional $key | default []) ++ [$value]) + } + } + {blocks: ($blocks ++ [{patterns: $patterns, set: $set}] ++ $included), files: $files} +} + +# The blocks of the user's and the system's configuration, in the order ssh reads them, or of the +# file given with `ssh -F`, which stands in for both, and the files they came from. +def read-configs [config?: any]: nothing -> record<blocks: list<record>, files: list<string>> { + let user = '~/.ssh' | path expand --no-symlink + let reads = if $config != null { + [(read-config ($config | path expand) $user ['*'] 0)] + } else { + [(read-config ($user | path join config) $user ['*'] 0) (read-config /etc/ssh/ssh_config /etc/ssh ['*'] 0)] + } + {blocks: ($reads | get blocks | flatten), files: ($reads | get files | flatten | uniq)} +} + +# What the configuration and the files of known hosts hold, read once for as long as none of them +# changes (see `cached`): `{blocks, hosts, users, identities}`, the blocks of `ssh_config`, the hosts +# to offer, the users the configuration names and the current one, and the private keys: the +# `IdentityFile`s it names and those in `~/.ssh` (`id_*` and any file with a `.pub` beside it). +def host-index [config?: any]: nothing -> record<blocks: list<record>, hosts: list<record>, users: list<string>, identities: list<string>> { + cached $"index:($config | default '')" { + let read = read-configs $config + let known = known-hosts-files $read.blocks + let hosts = configured-hosts $read.blocks + | append (known-hosts $known) + | append (etc-hosts) + | insert key {|host| $host.name | str lowercase } + | uniq-by key + | sort-by key + | each {|host| + mut row = {value: $host.name} + if ($host.description? | default '') != '' { $row = $row | insert description $host.description } + if not ($host.preview? | default {} | is-empty) { $row = $row | insert preview $host.preview } + $row + } + let current = $env.USER? | default $env.USERNAME? | default '' + let users = $read.blocks | where {|block| $block.patterns != [] } | each {|block| $block.set.user? | default '' } | prepend $current | where $it != '' | uniq | sort + let configured = $read.blocks | each {|block| $block.set.identityfile? | default [] } | flatten | each {|file| $file | str replace --all '%d' '~' | path expand --no-symlink } + let dir = '~/.ssh' | path expand --no-symlink + let names = try { glob --no-dir ($dir | path join '*') | path basename } catch { [] } + let keys = $names | where {|name| not ($name | str ends-with '.pub') and (($name | str starts-with 'id_') or $"($name).pub" in $names) } | each {|name| $dir | path join $name } + let identities = $configured ++ $keys | each {|file| $file | str replace $dir '~/.ssh' } | uniq + {value: {blocks: $read.blocks, hosts: $hosts, users: $users, identities: $identities}, files: ($read.files ++ $known ++ ['/etc/hosts' $dir])} + } +} + +# Every block of the user's and the system's configuration (see `read-configs`). +@non-destructive +export def config-blocks [config?: any]: nothing -> list<record> { + (host-index $config).blocks +} + +# Whether an `ssh_config` pattern holds a wildcard or a negation, so it names no one host. +def is-pattern [pattern: string]: nothing -> bool { + ($pattern =~ '[*?!]') +} + +# Whether `name` matches a pattern with `*` and `?`, ignoring case. +def glob-match [pattern: string, name: string]: nothing -> bool { + if $pattern == '*' { return true } + if not ($pattern | str contains '*') and not ($pattern | str contains '?') { return (($pattern | str lowercase) == ($name | str lowercase)) } + let regex = '(?i)^' + ($pattern | str replace --all --regex '[.+^$(){}|\[\]\\]' '\$0' | str replace --all '*' '.*' | str replace --all '?' '.') + '$' + $name =~ $regex +} + +# Whether a block with these patterns applies to `name`: one pattern matches and no negated one does. +def applies [patterns: list<string>, name: string]: nothing -> bool { + mut matched = false + for pattern in $patterns { + if ($pattern | str starts-with '!') { + if (glob-match ($pattern | str substring 1..) $name) { return false } + } else if not $matched and (glob-match $pattern $name) { + $matched = true + } + } + $matched +} + +# The settings of `blocks` merged, the first value read winning. +def merge-settings [blocks: list<record>]: nothing -> record { + $blocks | each {|block| $block.set } | reduce --fold {} {|set, merged| $set | merge $merged } +} + +# Every setting the blocks that apply to `name` give it, the first value read winning. +def host-settings [blocks: list<record>, name: string]: nothing -> record { + merge-settings ($blocks | where {|block| applies $block.patterns $name }) +} + +# `[user@]hostname[:port]`: what a host's configuration says that its name does not. +def describe-host [name: string, settings: record]: nothing -> string { + let user = $settings.user? | default '' | if $in == '' { '' } else { $in + '@' } + let hostname = $settings.hostname? | default $name | str replace --all '%h' $name + let port = $settings.port? | default '' | if $in in ['' '22'] { '' } else { ':' + $in } + if $user == '' and $port == '' and $hostname == $name { '' } else { $user + $hostname + $port } +} + +# The hosts named by the configuration, as `{name, description, preview?}`: every name on a `Host` +# line that is not a pattern. The user, host name and port come from every block that applies, the +# first value read winning; the preview shows the settings of the blocks that name the host. +def configured-hosts [blocks: list<record>]: nothing -> list<record> { + # Where each name stands: a block of plain names applies to those names and no others, which a + # lookup answers. Only a block with a wildcard or a negation has to be matched, once for each name. + let named = $blocks | enumerate | each {|entry| + let names = $entry.item.patterns | where {|pattern| not (is-pattern $pattern) } + let plain = ($names | length) == ($entry.item.patterns | length) + $names | each {|name| {name: $name, key: ($name | str lowercase), index: $entry.index, plain: $plain} } + } | flatten + # A block for `*` applies to every name; the others with a wildcard or a negation are matched. + let everywhere = $blocks | enumerate | where {|entry| '*' in $entry.item.patterns and not ($entry.item.patterns | any {|pattern| $pattern | str starts-with '!' }) } | get index + let complex = $blocks | enumerate | where {|entry| $entry.index not-in $everywhere and ($entry.item.patterns | any {|pattern| is-pattern $pattern }) } | get index + let block = {|index| $blocks | get $index } + $named | uniq-by key | each {|first| + let own = $named | where key == $first.key + let applicable = ($own | where plain | get index) ++ $everywhere ++ ($complex | where {|index| applies (do $block $index).patterns $first.name }) | uniq | sort + let settings = merge-settings ($own | get index | uniq | sort | each $block) + {name: $first.name, description: (describe-host $first.name (merge-settings ($applicable | each $block))), preview: ($settings | reject --optional hostname user port userknownhostsfile globalknownhostsfile)} + } +} + +# The names `known_hosts` files hold: `{name, description}` where a port other than 22 is noted. Hashed +# entries (`|1|...`), wildcards and negations name nothing to complete. +def known-hosts [files: list<string>]: nothing -> list<record> { + $files | each {|file| + if not ($file | path exists) { return [] } + try { open --raw $file | into string | parse --regex '(?m)^(?:@cert-authority[ \t]+)?(?<hosts>[^\s|#@!*?][^\s]*)[ \t]' } catch { [] } + } + | flatten + | get hosts + | each { split row ',' } + | flatten + | where {|host| not ($host | str starts-with '!') and not (is-pattern $host) } + | each {|host| + let bracketed = $host | parse --regex '^\[(?<name>[^\]]+)\]:(?<port>\d+)$' + if ($bracketed | is-empty) { {name: $host, description: ''} } else { {name: $bracketed.0.name, description: (if $bracketed.0.port == '22' { '' } else { $"port ($bracketed.0.port)" })} } + } +} + +# The `known_hosts` files ssh reads: the defaults and those the configuration names. +def known-hosts-files [blocks: list<record>]: nothing -> list<string> { + let named = $blocks | each {|block| [($block.set.userknownhostsfile? | default ''), ($block.set.globalknownhostsfile? | default '')] } | flatten | each { words } | flatten + ['~/.ssh/known_hosts' '~/.ssh/known_hosts2' '/etc/ssh/ssh_known_hosts' '/etc/ssh/ssh_known_hosts2'] ++ $named + | each {|file| $file | path expand --no-symlink } + | uniq +} + +# The names `/etc/hosts` gives, with the address each is for. +def etc-hosts []: nothing -> list<record> { + if not ('/etc/hosts' | path exists) { return [] } + open --raw /etc/hosts | into string | parse --regex '(?m)^[ \t]*(?<address>[0-9a-fA-F:.]+)[ \t]+(?<names>[^#\r\n]+)' + | each {|row| $row.names | split row --regex '\s+' | where $it != '' | each {|name| {name: $name, description: $row.address} } } + | flatten + | where {|host| not ($host.name | str starts-with 'ip6-') and $host.name != broadcasthost } +} + +# The hosts to offer for a destination, one row each, `{value, description?, preview?}`: those the +# configuration names, then the ones `known_hosts` has, then the ones in `/etc/hosts`. A name is +# listed once, with the description of the first place that knows it. +@non-destructive +@example "Is a host known by this name" { hosts | where value == myserver | is-not-empty } +export def hosts [config?: any]: nothing -> list<record> { + (host-index $config).hosts +} + +# The users to offer for a login name: those the configuration names and the current one. +@non-destructive +@example "The login names offered" { users | first 3 } +export def users [config?: any]: nothing -> list<string> { + (host-index $config).users +} + +# The identity files to offer: the configuration's `IdentityFile`s that are there, and the private +# keys of `~/.ssh` (`id_*` and any file that has a `.pub` beside it). +@non-destructive +@example "The private keys that are there" { identity-files } +export def identity-files [config?: any]: nothing -> list<string> { + (host-index $config).identities | where {|file| $file | path expand --no-symlink | path exists } +} + +# The algorithms of one kind (`cipher`, `mac`) this machine's ssh supports. Asking `ssh -Q` makes no +# connection, but starts a process, so it is asked once per session. +@non-destructive +@example "The ciphers this ssh supports" { algorithms cipher } +export def algorithms [kind: string]: nothing -> list<string> { + cached $"algorithms:($kind)" { {value: (try { ^ssh -Q $kind | lines } catch { [] }), files: []} } +} + +# The `-F file` of ssh's options, if there is one: the configuration that stands in for the user's. +def config-of [options: list<string>]: nothing -> any { + $options | window 2 | where {|pair| $pair.0 == '-F' } | get --optional 0.1 +} + +# Every name that is known to be a host: those `hosts` lists and the real names the configuration gives +# them (`HostName`), which `ssh` accepts as well. +@non-destructive +@example "Is this a known host" { "myserver" in (known-names) } +export def known-names [config?: any]: nothing -> list<string> { + let index = host-index $config + let real = $index.blocks | each {|block| $block.set.hostname? | default '' } | where {|name| $name != '' and '%' not-in $name } + $index.hosts | get value | append $real | uniq +} + +# The known host `typed` is most likely a typo of (a few edits away, case ignored), or null. +export def closest-host [typed: string, names: list<string>]: nothing -> any { + if $typed == '' or ($names | is-empty) { return null } + let best = $names | each {|name| {name: $name, distance: ($typed | str lowercase | str distance ($name | str lowercase))} } | sort-by distance | first + let length = $typed | str length + if $best.distance <= ([($length // 3) 1] | math max) and $best.distance < $length { $best.name } else { null } +} + +# The rows whose value matches `typed`, best first: those that start with it, those that hold it, and +# those that hold its letters in that order. The engine narrows by the whole token, so a row that +# replaces only a part of one (the host after `user@`) is narrowed here. +export def narrow [typed: string, rows: list<record>]: nothing -> list<record> { + let key = $typed | str lowercase + if $key == '' { return $rows } + let letters = '(?i)' + ($key | split chars | each {|letter| $letter | str replace --regex '[.+*?^$(){}|\[\]\\]' '\$0' } | str join '.*') + $rows + | each {|row| + let value = $row.value | str lowercase + {row: $row, tier: (if ($value | str starts-with $key) { 0 } else if ($value | str contains $key) { 1 } else if $value =~ $letters { 2 } else { 3 })} + } + | where tier < 3 + | sort-by tier + | get row +} + +# The port ssh uses for `host` and where that comes from: the configuration's `Port`, the one +# `known_hosts` noted for it, else 22. +@non-destructive +@example "The port ssh uses for a host, and why" { host-port myserver } +export def host-port [host: string, config?: any]: nothing -> record<number: string, about: string> { + port-in (host-index $config) $host +} + +# `host-port` for an index already read (see `host-index`). +def port-in [index: record, host: string]: nothing -> record<number: string, about: string> { + let configured = host-settings $index.blocks $host | get --optional port + if $configured != null { return {number: $configured, about: $"set for ($host) in ssh_config"} } + let known = $index.hosts | where {|row| ($row.value | str lowercase) == ($host | str lowercase) } | get --optional 0.description | default '' + if $known =~ '^port \d+$' { {number: ($known | str substring 5..), about: $"noted for ($host) in known_hosts"} } else { {number: '22', about: "ssh's default port"} } +} + +# The ports to offer for a connection to `destination` (what is typed for the host so far, if +# anything): its own port, as a row with where that comes from. +@non-destructive +export def port-for [destination: any, config?: any]: nothing -> list<record> { + let parts = if $destination == null { null } else { read-destination ($destination | into string) } + if $parts == null or $parts.host == '' { return [{value: '22', description: "ssh's default port"}] } + if $parts.scheme != '' and $parts.port =~ '^:\d+$' { return [{value: ($parts.port | str substring 1..), description: "the port in the URL"}] } + let port = host-port $parts.host $config + [{value: $port.number, description: $port.about}] +} + +# `[ssh://][user@]host[:port]` split into its parts, with the byte offsets they start at in `text` +# (`at`). With `list` it is the last of several joined by commas (`-J a,b`). A part that is not there +# is empty; `port` includes its colon, so that `host:` and `host` differ. Colons of an IPv6 address +# are part of the host. +export def read-destination [text: string, --list]: nothing -> record { + let split = if $list { $text | parse --regex '^(?<head>(?:.*,)?)(?<rest>.*)$' | first } else { {head: '', rest: $text} } + let found = $split.rest | parse --regex '^(?<scheme>(?:ssh://)?)(?<user>(?:[^@:,/]*@)?)(?<host>\[[^\]]*\]?|[^@:,/]*)(?<port>(?::.*)?)$' | get --optional 0 | default {scheme: '', user: '', host: $split.rest, port: ''} + let ipv6 = $found.port | str substring 1.. | str contains ':' + let parts = if $ipv6 { $found | update host ($found.host + $found.port) | update port '' } else { $found } + let user_at = ($split.head | str length --utf-8-bytes) + ($parts.scheme | str length --utf-8-bytes) + let host_at = $user_at + ($parts.user | str length --utf-8-bytes) + $parts | insert at {user: $user_at, host: $host_at, port: ($host_at + ($parts.host | str length --utf-8-bytes))} +} + +# Whether `text` is an address, which no one mistypes into a host that is not there. +def is-address [text: string]: nothing -> bool { + $text =~ '^[0-9.]+$' or ':' in $text or ($text | str starts-with '[') +} + +# What to say of a host `typed` that no known host starts with or holds, where `span` is the host in +# the line and `others` the rows that match only loosely (its letters in order): the known host it is +# probably a typo of, offered first in its place and named in the description (the status line +# shows a message only while nothing is offered), or, with none that close, that no such host is +# known. Nothing is said of an address. +@non-destructive +export def unknown-host [typed: string, span: record, config: any, others: list<record>]: nothing -> record { + if (is-address $typed) { return {completions: $others, options: {filter: false}} } + let near = closest-host $typed (known-names $config) + if $near == null { + let message = if ($others | is-empty) { {message: $"no host ($typed) in your ssh config, known_hosts or /etc/hosts"} } else { {} } + return ({completions: $others, options: {filter: false}} | merge $message) + } + let note = $"no host ($typed); did you mean ($near)?" + let nearest = {value: $near, span: $span, description: $note} + {completions: ([$nearest] ++ ($others | where value != $near)), message: $note, options: {filter: false}} +} + +# The ports of the host in `parts` (see `read-destination`), for the digits after its colon. +def port-rows [parts: record, start: int, end: int, config: any]: nothing -> record { + let at = $start + $parts.at.port + 1 + let rows = port-for $"($parts.host)" $config | each {|row| $row | insert span {start: $at, end: $end} } + {completions: (narrow ($parts.port | str substring 1..) $rows), options: {filter: false}} +} + +# What to offer for a destination (see `read-destination`) in `text`, which starts at byte `start` of +# the line: the hosts, after `ssh://` and `user@` too, the users as `user@`, and after the colon of +# a URL or an element of `-J` the port of the host. Each row replaces only the part it completes, +# so that `root@il` gives `root@ilo`, and a host is followed by no space where a port may come. +# `colon` is for scp and sftp, where a host is written with a colon after it and may be a file's name. +# `inside` says the text is the end of a longer token (`ProxyJump=` in `-o ProxyJump=a`). +@non-destructive +export def destination [text: string, start: int, config: any, --list, --colon, --inside]: nothing -> any { + if $text =~ r#'^["'`]'# { return {completions: []} } + let parts = read-destination $text --list=$list + let end = $start + ($text | str length --utf-8-bytes) + if $parts.port != '' and ($parts.scheme != '' or $list) { return (port-rows $parts $start $end $config) } + + let span = {start: ($start + $parts.at.host), end: $end} + let suffix = if $colon { ':' } else { '' } + # The engine narrows a row by the token; only a row that replaces all of it is left to the engine, + # which ranks by what was used before. + let index = host-index $config + let all = $index.hosts | each {|row| + let host = $row | update value $"($row.value)($suffix)" | insert span $span + if $colon { $host | insert append_whitespace false } else { $host } + } + let found = narrow $parts.host $all + # The users that start with what was typed, as `user@`. Where the host is the first thing a URL + # asks for, before anything is typed, all of them. + let in_url = $parts.scheme != '' + let logins = if $parts.user != '' or ($parts.host == '' and not $in_url) { [] } else { + $index.users | where {|user| $user | str starts-with $parts.host } | each {|user| {value: $"($user)@", description: user, append_whitespace: false, span: $span} } + } + # Letters in order are a loose match; a name that starts or holds what was typed is a real one. + let key = $parts.host | str lowercase + let named = $found | where {|row| let value = $row.value | str lowercase; ($value | str starts-with $key) or ($value | str contains $key) } + if ($named | is-empty) and ($logins | is-empty) and $key != '' and not $colon { return (unknown-host $parts.host $span $config $found) } + + let whole = $parts.at.host == 0 and not $inside + let hosts = if $whole { $all } else { $found } + # A host that is typed in full can be followed by its port (`:`), which a URL or a jump host may + # have: offered with the colon, and with the port too where it is not the usual one. + let hosts = if $in_url or $list { $hosts | each {|row| [$row] ++ (if ($row.value | str lowercase) == $key { port-suffixes $row $index } else { [] }) } | flatten } else { $hosts } + # What starts with the text comes first, the hosts before the users; before anything is typed, the + # users of a URL come first, being the part it begins with. + let rows = if $parts.host == '' { $logins ++ $hosts } else { $hosts ++ $logins } + let starting = $rows | where {|row| ($row.value | str lowercase) starts-with $key } + {completions: ($starting ++ ($rows | where {|row| $row not-in $starting })), options: {filter: $whole}} +} + +# The rows that continue the host in `row` with a port: `host:`, and `host:port` where the host has a +# port of its own (see `host-port`), so that it is a choice as much as the colon. +def port-suffixes [row: record, index: record]: nothing -> list<record> { + let port = port-in $index $row.value + let colon = {value: $"($row.value):", description: $"then a port, ($port.number) by default", append_whitespace: false, span: $row.span} + if $port.number == '22' { [$colon] } else { [($row | update value $"($row.value):($port.number)" | upsert description $"port ($port.number), ($port.about)"), $colon] } +} + +# The permission problem of each private key in `files`, in words: ssh ignores one that group or +# others can read. `{file, problem}` for those that have one. A key that is not a file, or ends in +# `.pub`, has none. One `ls` asks for all of them, and its answer is kept for two seconds: starting a +# process is the slowest thing the completions do locally, and a mode is no modification time. (Nor +# does nushell's `ls` tell one in a user's own wrapper of it.) +def key-problems [files: list<string>]: nothing -> table<file: string, problem: string> { + # The key is what a link points to. + let keys = $files | where {|file| not ($file | str ends-with '.pub') and ($file | path type) == file } | each {|file| {file: $file, real: ($file | path expand)} } + if ($keys | is-empty) { return [] } + cached $"modes:($keys | get file | str join '|')" --ttl 2sec { + let lines = try { ^ls -ld -- ...($keys | get real) | lines } catch { return {value: [], files: []} } + let value = $lines | each {|line| + let mode = $line | str substring 0..9 + let key = $keys | where {|key| $line | str ends-with $" ($key.real)" } | get --optional 0 + if $key != null and ($mode | str substring 4..9 | str replace --all '-' '' | is-not-empty) { + {file: $key.file, problem: $"readable by group or others ($mode): ssh refuses it, chmod 600"} + } + } | compact + {value: $value, files: ($keys | get real)} + } +} + +# What `-i` completes: the identity files, each with the problem ssh would have with it, then files in +# general. A path that is not there and starts nothing says so, with nothing else offered; one that is +# a file says what is wrong with it, if anything. +@non-destructive +export def identity [token: record, config?: any]: nothing -> record { + let typed = $token.text + let file = $typed | path expand --no-symlink + # A file typed in full is the only answer; the files could only say it again, without the problem. + if $typed != '' and ($file | path type) == file { + return {completions: [{value: $typed, description: (key-problems [$file] | get --optional 0.problem | default '')}]} + } + let names = identity-files $config + let problems = key-problems ($names | path expand --no-symlink) + let keys = $names | each {|key| {value: $key, description: ($problems | where file == ($key | path expand --no-symlink) | get --optional 0.problem | default '')} } + if $typed == '' { return {completions: $keys, fallback: true} } + if not ($file | path exists) and (narrow $typed $keys | is-empty) and (try { glob ($file + '*') } catch { [] } | is-empty) { + return {completions: [], message: $"($typed) does not exist"} + } + {completions: $keys, fallback: true} +} + +# `text` as one word of a POSIX shell: in single quotes, a quote in it written `'\''`. +def posix-quote [text: string]: nothing -> string { + "'" + ($text | str replace --all "'" "'\\''") + "'" +} + +# A directory as the remote shell should read it: `~` stays bare, so it expands there. +def remote-directory [dir: string]: nothing -> string { + if $dir == '~' { '~' } else if ($dir | str starts-with '~/') { '~/' + (posix-quote ($dir | str substring 2..)) } else { posix-quote $dir } +} + +# What ssh complained about, in plain words: its last line says why a connection was not made. A host +# key that is not trusted yet is the usual reason, because the completions never ask a question (see +# `remote-lines`), and the fix is one `ssh` by hand. +def ssh-failure [host: string, stderr: string, options: list<string>]: nothing -> string { + let lines = $stderr | lines | where {|line| ($line | str trim) != '' } + let last = $lines | reverse | get --optional 0 | default '' | str trim + if ($stderr =~ '(?i)REMOTE HOST IDENTIFICATION HAS CHANGED') { + $"($host)'s host key has changed: connect with ssh ($host) to see why" + } else if ($last =~ '(?i)host key verification failed') { + $"($host)'s host key isn't trusted yet: connect once with ssh ($host)" + } else if ($last =~ '(?i)permission denied') { + $"($host) needs a password or key that isn't loaded" + } else if ($last =~ '(?i)timed out|timeout') { + $"($host) didn't answer" + } else if ($last =~ '(?i)could not resolve hostname') { + let name = $host | str replace --regex '^.*@' '' + let near = closest-host $name (known-names (config-of $options)) + if $near == null { $"($host) is not a name that can be found" } else { $"no host ($name); did you mean ($near)?" } + } else if ($last =~ '(?i)connection refused') { + $"($host) refused the connection" + } else if $last == '' { + $"ssh to ($host) failed" + } else { + $"ssh to ($host) failed: ($last)" + } +} + +# Run `script` in a POSIX shell on `host` and read its output as lines. ssh never asks anything +# (`BatchMode`) and gives up on a host that does not answer in a few seconds, so a host that cannot be +# reached is an error that says why, which the completion shows where it has nothing to offer. A +# script that fails on the host (a directory that is not there) is no lines. `options` are ssh's own, +# such as `-p 2222`. +def remote-lines [host: string, options: list<string>, script: string]: nothing -> list<string> { + let result = try { + ^ssh -n -o BatchMode=yes -o ConnectTimeout=3 ...$options $host -- $"sh -c (posix-quote $script)" | complete + } catch { error make {msg: "ssh could not be run"} } + # 255 is ssh's own failure; anything else is the script's. + if $result.exit_code == 255 { error make {msg: (ssh-failure $host $result.stderr $options)} } + if $result.exit_code != 0 { return [] } + $result.stdout | lines | where $it != '' +} + +# The entries of directory `dir` on `host`, directories ending in `/`. `.` is the home directory. +export def remote-entries [host: string, options: list<string>, dir: string]: nothing -> list<string> { + let enter = if $dir == '.' { '' } else { $"cd -- (remote-directory $dir) 2>/dev/null || exit 1; " } + remote-lines $host $options ($enter + 'for f in * .[!.]* ..?*; do if [ -d "$f" ]; then echo "$f/"; elif [ -e "$f" ] || [ -L "$f" ]; then echo "$f"; fi; done; true') +} + +# The commands `host` has: what `compgen -c` lists, or the executables of its `PATH` where its `sh` +# has no `compgen`. +export def remote-commands [host: string, options: list<string>]: nothing -> list<string> { + remote-lines $host $options 'compgen -c 2>/dev/null || { IFS=:; for d in $PATH; do for f in "$d"/*; do if [ -x "$f" ] && [ ! -d "$f" ]; then echo "${f##*/}"; fi; done; done; }; true' + | uniq +} + +# The ssh options of the line being completed that decide how a connection is made, from the +# arguments the line has so far (`place.arguments`). scp and sftp spell the port `-P` and have no +# `-l` for the login name. +export def connection-options [arguments: record, --copy]: nothing -> list<string> { + let flags = if $copy { [P i F J o] } else { [p i F J l o] } + # A flag given more than once (`-o`) holds a list of values. + $flags + | each {|flag| + [($arguments | get --optional $flag)] | flatten | compact + | where {|value| $flag != 'o' or $value !~ '(?i)command' } + | each {|value| [(if $flag == 'P' { '-p' } else { $"-($flag)" }) ($value | into string)] } + | flatten + } + | flatten + | append (['4' '6'] | where {|flag| ($arguments | get --optional $flag) == true } | each {|flag| $"-($flag)" }) +} + +# What to offer for a word of `scp`, `sftp` or `rsync` that is a path or `[user@]host:path`: after the +# colon, the paths of that host, listed through ssh with `options`; before it, the hosts with a colon +# added, and the local paths. A word that can only be a path is left to the files. +export def host-path [token: record, options: list<string>, config?: any]: nothing -> any { + let text = $token.text + # A flag is no host; only paths, which are the files'. + if ($text | str starts-with '-') { return {completions: []} } + if $text =~ r#'^["'`]'# { return {completions: [], fallback: true} } + let remote = $text | parse --regex '^(?<host>(?:[^/:@\[\]]+@)?(?:[^/:@\[\]]{2,}|\[[^\]]+\])):' + if ($remote | is-not-empty) { + let host = $remote.0.host + return {delegate: {from: ($token.span.start + ($host | str length) + 1), path: true, paths: {|dir| remote-entries $host $options $dir }}} + } + if $text =~ '[/~]' or ($text | str starts-with '.') { return {completions: [], fallback: true} } + destination $text $token.span.start $config --colon | upsert fallback true +} + +# The ssh options in the remote shell an `rsync -e` names (`ssh -p 2222 -i key`): the ones that decide +# how a connection is made. Anything but ssh is no one this can ask. +export def rsh-options [rsh: any]: nothing -> list<string> { + let words = if $rsh == null { [] } else { $rsh | into string | words } + if ($words | is-empty) or ($words.0 | path basename) != ssh { return [] } + mut options = [] + mut index = 1 + while $index < ($words | length) { + let word = $words | get $index + if $word in ['-p' '-i' '-F' '-J' '-l'] and ($index + 1) < ($words | length) { + $options = $options ++ [$word ($words | get ($index + 1))] + $index += 2 + } else if $word in ['-4' '-6'] { + $options = $options ++ [$word] + $index += 1 + } else { + $index += 1 + } + } + $options +} diff --git a/custom-completions/swift-bundler/swift-bundler-completions.nu b/custom-completions/swift-bundler/swift-bundler-completions.nu index 1de62fc15..26d693e7c 100644 --- a/custom-completions/swift-bundler/swift-bundler-completions.nu +++ b/custom-completions/swift-bundler/swift-bundler-completions.nu @@ -1,3 +1,6 @@ +# Swift Bundler completions. + +# The allowed values of a `swift-bundler bundle` option, read from its dumped help. def "nu-complete sbun bundle-arg-values" [arg_name: string]: nothing -> list<string> { ^swift-bundler bundle --experimental-dump-help | from json @@ -9,466 +12,323 @@ def "nu-complete sbun bundle-arg-values" [arg_name: string]: nothing -> list<str | split row "|" } -def "nu-complete sbun bundler" [] { - nu-complete sbun bundle-arg-values bundler +@non-destructive +export def "nu-complete sbun bundler" [] { + try { nu-complete sbun bundle-arg-values bundler } catch { [] } +} + +@non-destructive +export def "nu-complete sbun configuration" [] { + try { nu-complete sbun bundle-arg-values configuration } catch { [] } } -def "nu-complete sbun configuration" [] { - nu-complete sbun bundle-arg-values configuration + +@non-destructive +export def "nu-complete sbun arch" [] { + try { nu-complete sbun bundle-arg-values arch } catch { [] } } -def "nu-complete sbun arch" [] { - nu-complete sbun bundle-arg-values arch + +@non-destructive +export def "nu-complete sbun platform" [] { + try { nu-complete sbun bundle-arg-values platform } catch { [] } } -def "nu-complete sbun platform" [] { - nu-complete sbun bundle-arg-values platform + +# Apps of the package in `directory` (the `--directory`/`-d` given on the line), or in the current directory. +@non-destructive +export def "nu-complete sbun apps" [directory?: string] { + try { + ^swift-bundler config apps list --json --directory ($directory | default "./") | from json | get name + } catch { [] } } -def "nu-complete sbun apps" [context: string] { - let directory = $context - | split row --regex '\s+' - | skip until {|arg| $arg in ["--directory" "-d"] } - | get 1? - | default "./" - - swift-bundler config apps list --json --directory $directory | from json | get name + +@non-destructive +export def "nu-complete sbun templates" [] { + try { ^swift-bundler templates list | lines | parse "* {value}: {description}" } catch { [] } } -def "nu-complete sbun templates" [] { - swift-bundler templates list | lines | parse "* {value}: {description}" + +# Devices and simulators keep swift-bundler's order. Each is offered by id (described by its name) +# and then by name, which swift-bundler also accepts, so typing part of a name finds it. +def id-or-name [uuid: any, name: string] { + if ($uuid | is-empty) { {value: $name} } else { {value: $uuid, description: $name} } } -def "nu-complete sbun devices" [] { - { - options: { match_description: true, sort: false } - completions: (swift-bundler devices list + +@non-destructive +export def "nu-complete sbun devices" [] { + try { + let found = ^swift-bundler devices list | lines - | parse --regex r#'\* (?:(?<uuid>[a-zA-Z0-9-]+): )?(?<device>.*) \(.*\)$'# - | each { - if $in.uuid != null { - rename --column {uuid: "value", device: "description"} - } else { - rename --column {device: "value"} - } - } - | prepend "host") - } + | parse --regex '\* (?:(?<uuid>[a-zA-Z0-9-]+): )?(?<device>.*) \(.*\)$' + let ids = $found | each {|d| id-or-name $d.uuid $d.device } + let names = $found | where {|d| $d.uuid | is-not-empty } | each {|d| {value: $d.device, description: $d.uuid} } + [{value: host, description: "The host machine"}] ++ $ids ++ $names + } catch { [] } } -def "nu-complete sbun simulators" [] { - { - options: { match_description: true, sort: false } - completions: (swift-bundler simulators list + +@non-destructive +export def "nu-complete sbun simulators" [] { + try { + let found = ^swift-bundler simulators list | lines - | parse --regex r#'\* (?:(?<uuid>[a-zA-Z0-9-]+): )?(?<simulator>.*) \(.*\)$'# - | each { - if $in.uuid != null { - rename --column {uuid: "value", simulator: "description"} - } else { - rename --column {simulator: "value"} - } - }) - } + | parse --regex '\* (?:(?<uuid>[a-zA-Z0-9-]+): )?(?<simulator>.*) \(.*\)$' + let ids = $found | each {|s| id-or-name $s.uuid $s.simulator } + let names = $found | where {|s| $s.uuid | is-not-empty } | each {|s| {value: $s.simulator, description: $s.uuid} } + $ids ++ $names + } catch { [] } } # A tool for creating apps from Swift packages. -export extern swift-bundler [ - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler] [ + --version # Show the version. + --help(-h) # Show help information. ] # Create an app bundle from a package. -export extern "swift-bundler bundle" [ - app_name?: string@"nu-complete sbun apps" - # The name of the app to build. - --bundler: string@"nu-complete sbun bundler" - # The bundler to use. - --toolchain: string - # An alternative Swift toolchain to use. - --directory(-d): directory - # The directory containing the package to build. This changes the working directory before any other operation. - --config-file: path - # Overrides the default configuration file location. - --products-directory: directory - # The directory containing the built products. Can only be set when `--skip-build` is supplied. - --configuration(-c): string@"nu-complete sbun configuration" - # The build configuration to use. - --arch(-a): string@"nu-complete sbun arch" - # The architectures to build for. Defaults to the host architecture. - --scratch-path: directory - # A custom scratch directory path. Defaults to `.build` in the current directory. - --Xswiftpm: string - # Additional arguments to pass to the SwiftPM builder when building. - --Xxcodebuild: string - # Additional arguments to pass to the xcodebuild builder when building. - --platform(-p): string@"nu-complete sbun platform" - # The platform to build for. Defaults to the host platform. - --device: string@"nu-complete sbun devices" - # A device name, id or search term to select a target device (e.g. `"Apple TV"` or `"John Appleseed's iPhone"`). Can be a simulator. Use `"host"` to refer to the host machine. - --strip - # Strip the main executable. - --simulator: string@"nu-complete sbun simulators" - # A simulator name, id or search term to select the target simulator (e.g. `"iPhone 8"` or `"Apple Vision Pro"`). - --identity: string - # The identity to use for codesigning. - --provisioning-profile - # The provisioning profile to embed in the app (only applicable when targeting non-macOS physical Apple devices). - --codesign - # Codesign the application. Default on non-macOS Apple devices. - --no-codesign - # Do not codesign the application. Default on macOS, Linux and simulators. - --entitlements: path - # Provide an entitlements file to use when codesigning. - --universal(-u) - # Build a universal application. Equivalent to `--arch` `arm64` `--arch` `x86_64`. - --experimental-stand-alone - # Build an application which doesn't rely on any system-wide third-party libraries being installed (such as gtk). This features is experimental and potentially incompatible with `--universal`, use with care. - --xcodebuild - # Build with xcodebuild instead of SwiftPM. This is the default when building for non-macOS Apple platforms from a Mac, since SwiftPM has issues doing so. - --no-xcodebuild - # Force swiftpm to be used when targeting non-macOS Apple platforms. Use with care because many features, such as conditional dependencies in package manifests, may break. - --skip-build - # Skip the build step. - --show-bundle-path - # Print the path of the output bundle and exits. The bundle may not exist yet if you haven't already performed a build. - --built-with-xcode - # Treats the products in the products directory as if they were built by Xcode (which is the same as universal builds by SwiftPM). Can only be set when `--skip-build` is supplied. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. -] +export complete [swift-bundler bundle] [ + app_name?: by "nu-complete sbun apps" [directory: --directory] # The name of the app to build. + --bundler: by "nu-complete sbun bundler" # The bundler to use. + --toolchain: text # An alternative Swift toolchain to use. + --directory(-d): dir # The directory containing the package to build. + --config-file: path # Overrides the default configuration file location. + --products-directory: dir # The directory containing the built products. (requires --skip-build) + --configuration(-c): by "nu-complete sbun configuration" # The build configuration to use. + --arch(-a): by "nu-complete sbun arch" # The architectures to build for. Defaults to the host architecture. + --scratch-path: dir # A custom scratch directory path. Defaults to `.build` in the current directory. + --Xswiftpm: text # Additional arguments to pass to the SwiftPM builder when building. + --Xxcodebuild: text # Additional arguments to pass to the xcodebuild builder when building. + --platform(-p): by "nu-complete sbun platform" # The platform to build for. Defaults to the host platform. + --device: by "nu-complete sbun devices" # Target device name, id or search term (`host` for this machine) + --strip # Strip the main executable. + --simulator: by "nu-complete sbun simulators" # Target simulator name, id or search term + --identity: text # The identity to use for codesigning. + --provisioning-profile: path # The provisioning profile to embed in the app (only applicable when targeting non-macOS physical Apple devices). + --codesign # Codesign the application. Default on non-macOS Apple devices. + --no-codesign # Do not codesign the application. Default on macOS, Linux and simulators. + --entitlements: path # Provide an entitlements file to use when codesigning. + --universal(-u) # Build a universal application. Equivalent to `--arch` `arm64` `--arch` `x86_64`. + --experimental-stand-alone # Build an application which doesn't rely on any system-wide third-party libraries being installed (such as gtk). This features is experimental and potentially incompatible with `--universal`, use with care. + --xcodebuild # Build with xcodebuild instead of SwiftPM. This is the default when building for non-macOS Apple platforms from a Mac, since SwiftPM has issues doing so. + --no-xcodebuild # Force swiftpm to be used when targeting non-macOS Apple platforms. Use with care because many features, such as conditional dependencies in package manifests, may break. + --skip-build # Skip the build step. + --show-bundle-path # Print the path of the output bundle and exits. The bundle may not exist yet if you haven't already performed a build. + --built-with-xcode # Treats the products in the products directory as if they were built by Xcode (which is the same as universal builds by SwiftPM). (requires --skip-build) + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. +] where { + overrides [--codesign --no-codesign] + at-most-one [--device --simulator] + requires --products-directory --skip-build +} # Run a package as an app. -export extern "swift-bundler run" [ - app_name?: string@"nu-complete sbun apps" - # The name of the app to build. - ...passThroughArguments - # Command line arguments to pass through to the app. - --bundler: string@"nu-complete sbun bundler" - # The bundler to use. - --toolchain: string - # An alternative Swift toolchain to use. - --directory(-d): directory - # The directory containing the package to build. This changes the working directory before any other operation. - --config-file: path - # Overrides the default configuration file location - --products-directory: directory - # The directory containing the built products. Can only be set when `--skip-build` is supplied. - --configuration(-c): string@"nu-complete sbun configuration" - # The build configuration to use. - --arch(-a): string@"nu-complete sbun arch" - # The architectures to build for. Defaults to the host architecture. - --scratch-path: directory - # A custom scratch directory path. Defaults to `.build` in the current directory. - --Xswiftpm: string - # Additional arguments to pass to the SwiftPM builder when building. - --Xxcodebuild: string - # Additional arguments to pass to the xcodebuild builder when building. - --platform(-p): string@"nu-complete sbun platform" - # The platform to build for. Defaults to the host platform. - --device: string@"nu-complete sbun devices" - # A device name, id or search term to select a target device (e.g. `"Apple TV"` or `"John Appleseed's iPhone"`). Can be a simulator. Use `"host"` to refer to the host machine. - --strip - # Strip the main executable. - --simulator: string@"nu-complete sbun simulators" - # A simulator name, id or search term to select the target simulator (e.g. `"iPhone 8"` or `"Apple Vision Pro"`). - --identity: string - # The identity to use for codesigning. - --provisioning-profile - # The provisioning profile to embed in the app (only applicable when targeting non-macOS physical Apple devices). - --codesign - # Codesign the application. Default on non-macOS Apple devices. - --no-codesign - # Do not codesign the application. Default on macOS, Linux and simulators. - --entitlements: path - # Provide an entitlements file to use when codesigning. - --universal(-u) - # Build a universal application. Equivalent to `--arch arm64 --arch x86_64`. - --experimental-stand-alone - # Build an application which doesn't rely on any system-wide third-party libraries being installed (such as gtk). This features is experimental and potentially incompatible with `--universal`, use with care. - --xcodebuild - # Build with xcodebuild instead of SwiftPM. This is the default when building for non-macOS Apple platforms from a Mac, since SwiftPM has issues doing so. - --no-xcodebuild - # Force swiftpm to be used when targeting non-macOS Apple platforms. Use with care because many features, such as conditional dependencies in package manifests, may break. - --env: path - # A file containing environment variables to pass to the app. - --skip-build - # Skips the building and bundling steps. - --hot - # Enables hot reloading. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. -] +export complete [swift-bundler run] [ + app_name?: by "nu-complete sbun apps" [directory: --directory] # The name of the app to build. + ...passThroughArguments # Command line arguments to pass through to the app. + --bundler: by "nu-complete sbun bundler" # The bundler to use. + --toolchain: text # An alternative Swift toolchain to use. + --directory(-d): dir # The directory containing the package to build. + --config-file: path # Overrides the default configuration file location + --products-directory: dir # The directory containing the built products. (requires --skip-build) + --configuration(-c): by "nu-complete sbun configuration" # The build configuration to use. + --arch(-a): by "nu-complete sbun arch" # The architectures to build for. Defaults to the host architecture. + --scratch-path: dir # A custom scratch directory path. Defaults to `.build` in the current directory. + --Xswiftpm: text # Additional arguments to pass to the SwiftPM builder when building. + --Xxcodebuild: text # Additional arguments to pass to the xcodebuild builder when building. + --platform(-p): by "nu-complete sbun platform" # The platform to build for. Defaults to the host platform. + --device: by "nu-complete sbun devices" # Target device name, id or search term (`host` for this machine) + --strip # Strip the main executable. + --simulator: by "nu-complete sbun simulators" # Target simulator name, id or search term + --identity: text # The identity to use for codesigning. + --provisioning-profile: path # The provisioning profile to embed in the app (only applicable when targeting non-macOS physical Apple devices). + --codesign # Codesign the application. Default on non-macOS Apple devices. + --no-codesign # Do not codesign the application. Default on macOS, Linux and simulators. + --entitlements: path # Provide an entitlements file to use when codesigning. + --universal(-u) # Build a universal application. Equivalent to `--arch arm64 --arch x86_64`. + --experimental-stand-alone # Build an application which doesn't rely on any system-wide third-party libraries being installed (such as gtk). This features is experimental and potentially incompatible with `--universal`, use with care. + --xcodebuild # Build with xcodebuild instead of SwiftPM. This is the default when building for non-macOS Apple platforms from a Mac, since SwiftPM has issues doing so. + --no-xcodebuild # Force swiftpm to be used when targeting non-macOS Apple platforms. Use with care because many features, such as conditional dependencies in package manifests, may break. + --env: path # A file containing environment variables to pass to the app. + --skip-build # Skips the building and bundling steps. + --hot # Enables hot reloading. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. +] where { + overrides [--codesign --no-codesign] + at-most-one [--device --simulator] + requires --products-directory --skip-build +} # Clean a project's scratch directory. -export extern "swift-bundler clean" [ - --directory(-d): directory - # The directory containing the package to build. - --scratch-path: directory - # A custom scratch directory path. Defaults to `.build` in the current directory. - --toolchain: string - # An alternative Swift toolchain to use. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler clean] [ + --directory(-d): dir # The directory containing the package to build. + --scratch-path: dir # A custom scratch directory path. Defaults to `.build` in the current directory. + --toolchain: text # An alternative Swift toolchain to use. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # Create a new app package. -export extern "swift-bundler create" [ - app_name: string - # The app's name. Must only contain characters from the English alphabet. - --identifier(-i): string - # The app's identifier (e.g. `"com.example.ExampleApp"`). - --version: string - # The app's initial version. - --category: string - # The app's category. - --icon: path - # The app's icon file (1024x1024 png or icns file). - --info-plist: path - # An Info.plist file containing entries to add to the app's configuration. - --directory(-d): directory - # Directory to create the app in. Default: create a new directory at `./[app-name]`. - --template(-t): string@"nu-complete sbun templates" - # Template to create the app from. - --template-repository: directory - # A directory to search for the template in. - --toolchain: string - # An alternative Swift toolchain to use. - --indentation: string - # Custom indentation style: either `"tabs"` or `"spaces=[count]"`. Defaults to `"spaces=4"`. - --force(-f) - # Force creation even if the template does not support the current OS and installed Swift version. - --vscode - # Add vscode configuration files necessary to enable ergonomic debugging. - --verbose(-v) - # Print verbose error messages. - --help(-h) - # Show help information. +export complete [swift-bundler create] [ + app_name: text # The app's name. Must only contain characters from the English alphabet. + --identifier(-i): text # The app's identifier (e.g. `"com.example.ExampleApp"`). + --version: text # The app's initial version. + --category: text # The app's category. + --icon: path # The app's icon file (1024x1024 png or icns file). + --info-plist: path # An Info.plist file containing entries to add to the app's configuration. + --directory(-d): dir # Directory to create the app in. Default: create a new directory at `./[app-name]`. + --template(-t): by "nu-complete sbun templates" # Template to create the app from. + --template-repository: dir # A directory to search for the template in. + --toolchain: text # An alternative Swift toolchain to use. + --indentation: text # Custom indentation style: either `"tabs"` or `"spaces=[count]"`. Defaults to `"spaces=4"`. + --force(-f) # Force creation even if the template does not support the current OS and installed Swift version. + --vscode # Add vscode configuration files necessary to enable ergonomic debugging. + --verbose(-v) # Print verbose error messages. + --help(-h) # Show help information. ] # Converts an xcodeproj to a Swift Bundler project. -export extern "swift-bundler convert" [ - xcode_file: path - # Xcodeproj to convert. - --out(-o): directory - # The output directory. - --dont-warn - # Disables the experimental feature warning - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler convert] [ + xcode_file: path # Xcodeproj to convert. + --out(-o): dir # The output directory. + --dont-warn # Disables the experimental feature warning + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # List apps in the current Swift Bundler project. -export extern "swift-bundler config apps" [ - --directory(-d): directory - # The directory containing the package to inspect. - --json - # Format command output as JSON. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler config apps] [ + --directory(-d): dir # The directory containing the package to inspect. + --json # Format command output as JSON. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # List apps in the current Swift Bundler project. -export extern "swift-bundler config apps list" [ - --directory(-d): directory - # The directory containing the package to inspect. - --json - # Format command output as JSON. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler config apps list] [ + --directory(-d): dir # The directory containing the package to inspect. + --json # Format command output as JSON. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # Migrate a project's config file to the latest format. -export extern "swift-bundler config migrate" [ - --directory(-d): directory - # The directory containing the package to migrate. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler config migrate] [ + --directory(-d): dir # The directory containing the package to migrate. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # List available iOS, tvOS, visionOS, and Android devices. -export extern "swift-bundler devices" [ - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler devices] [ + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # List available iOS, tvOS, visionOS, and Android devices. -export extern "swift-bundler devices list" [ - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler devices list] [ + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # List available iOS, tvOS visionOS, and Android simulators. -export extern "swift-bundler simulators" [ - filter?: string - # A search term to filter simulators with. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler simulators] [ + filter?: text # A search term to filter simulators with. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # List available iOS, tvOS visionOS, and Android simulators. -export extern "swift-bundler simulators list" [ - filter?: string - # A search term to filter simulators with. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler simulators list] [ + filter?: text # A search term to filter simulators with. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # Boot an iOS, tvOS, visionOS, or Android simulator. -export extern "swift-bundler simulators boot" [ - id_or_name: string@"nu-complete sbun simulators" - # The id or name of the simulator to start. Substring matching is used when filtering simulator names. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler simulators boot] [ + id_or_name: by "nu-complete sbun simulators" # The id or name of the simulator to start. Substring matching is used when filtering simulator names. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # Boot an iOS, tvOS, or visionOS simulator. -export extern "swift-bundler simulators simctl boot" [ - id_or_name: string@"nu-complete sbun simulators" - # The id or name of the simulator to start. Substring matching is used when filtering simulator names. - simctl_arguments?: string - # Additional arguments to pass through to simctl. - --arch: string@"nu-complete sbun arch" - # Architecture for the simulator. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler simulators simctl boot] [ + id_or_name: by "nu-complete sbun simulators" # The id or name of the simulator to start. Substring matching is used when filtering simulator names. + simctl_arguments?: text # Additional arguments to pass through to simctl. + --arch: by "nu-complete sbun arch" # Architecture for the simulator. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # Boot an Android virtual device. -export extern "swift-bundler simulators avd boot" [ - name: string@"nu-complete sbun simulators" - # The name of the emulator to start. Supports partial substring matching. - emulator_arguments?: string - # Additional arguments for the 'emulator' CLI. - --arch: string@"nu-complete sbun arch" - # Architecture to boot the emulator with. - --verbose(-v) - # Print verbose error messages. - --attach - # Attach to 'emulator' CLI after booting the emulator. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler simulators avd boot] [ + name: by "nu-complete sbun simulators" # The name of the emulator to start. Supports partial substring matching. + emulator_arguments?: text # Additional arguments for the 'emulator' CLI. + --arch: by "nu-complete sbun arch" # Architecture to boot the emulator with. + --verbose(-v) # Print verbose error messages. + --attach # Attach to 'emulator' CLI after booting the emulator. + --version # Show the version. + --help(-h) # Show help information. ] # List available templates. -export extern "swift-bundler templates" [ - --template-repository: directory - # An alternate directory to search for templates in. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler templates] [ + --template-repository: dir # An alternate directory to search for templates in. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # List available templates. -export extern "swift-bundler templates list" [ - --template-repository: directory - # An alternate directory to search for templates in. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler templates list] [ + --template-repository: dir # An alternate directory to search for templates in. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # Get info about a template. -export extern "swift-bundler templates info" [ - template: string@"nu-complete sbun templates" - # The template to get info about. - --template-repository: directory - # An alternate directory to search for the template in. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler templates info] [ + template: by "nu-complete sbun templates" # The template to get info about. + --template-repository: dir # An alternate directory to search for the template in. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # Update the default templates to the latest version. -export extern "swift-bundler templates update" [ - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler templates update] [ + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # Generate the files required for Xcode to work nicely with a package. # # This requires Swift Bundler to be installed at `/opt/swift-bundler/swift-bundler`. -export extern "swift-bundler generate-xcode-support" [ - --directory(-d): directory - # The root directory of the package to generate Xcode support files for. - --config-file: path - # Overrides the default configuration file location. - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler generate-xcode-support] [ + --directory(-d): dir # The root directory of the package to generate Xcode support files for. + --config-file: path # Overrides the default configuration file location. + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] # List available codesigning identities. -export extern "swift-bundler list-identities" [ - --verbose(-v) - # Print verbose error messages. - --version - # Show the version. - --help(-h) - # Show help information. +export complete [swift-bundler list-identities] [ + --verbose(-v) # Print verbose error messages. + --version # Show the version. + --help(-h) # Show help information. ] + diff --git a/custom-completions/system/system-completions.nu b/custom-completions/system/system-completions.nu new file mode 100644 index 000000000..6747969ae --- /dev/null +++ b/custom-completions/system/system-completions.nu @@ -0,0 +1,174 @@ +# Completions for the system's account and process tools. Users, groups, process names and +# pids come from the completion engine's built-in host domains (`users`, `groups`, +# `processes`, `pids`). + +# `owner`, `owner:group` or `:group` +export syntax system.owner over chars { + root = (user: until ":")? (":" group: until ":")? +} + +# Change the owner and group of files +export complete [chown] profile posix-v1 [ + owner: system.owner with { root.user: users, root.group: groups } # owner, owner:group or :group + --recursive(-R) # Change files in directories recursively + -H # With -R, follow command-line symlinks + -L # With -R, follow every symlink to a directory + -P # With -R, follow no symlinks (default) + --no-dereference(-h) # Change a symlink itself, not its target + --dereference # Change the symlink target (default) + --changes(-c) # Report only files that change + --verbose(-v) # Report every file processed + --silent(-f) # Suppress most error messages + --quiet # Suppress most error messages + --from: system.owner with { root.user: users, root.group: groups } # Only change files with this current owner[:group] + --reference: path # Use the owner and group of this file + --preserve-root # Refuse to operate recursively on / + --no-preserve-root # Do not treat / specially (default) + -n # (BSD) Treat owner and group as numeric ids + -x # (BSD) Do not cross mount points + --help # Show help + --version # Show version + ...files: path # Files to change +] where { + at-most-one [-H -L -P] + overrides [--dereference --no-dereference] + overrides [--preserve-root --no-preserve-root] + excludes --reference --from +} + +# Change the group of files +export complete [chgrp] profile posix-v1 [ + group: groups # Group to give the files + --recursive(-R) # Change files in directories recursively + -H # With -R, follow command-line symlinks + -L # With -R, follow every symlink to a directory + -P # With -R, follow no symlinks (default) + --no-dereference(-h) # Change a symlink itself, not its target + --dereference # Change the symlink target (default) + --changes(-c) # Report only files that change + --verbose(-v) # Report every file processed + --silent(-f) # Suppress most error messages + --quiet # Suppress most error messages + --from: system.owner with { root.user: users, root.group: groups } # Only change files with this current owner[:group] + --reference: path # Use the group of this file + --preserve-root # Refuse to operate recursively on / + --no-preserve-root # Do not treat / specially (default) + -x # (BSD) Do not cross mount points + --help # Show help + --version # Show version + ...files: path # Files to change +] where { + at-most-one [-H -L -P] + overrides [--dereference --no-dereference] + overrides [--preserve-root --no-preserve-root] +} + +# Run a shell as another user +export complete [su] profile posix-v1 [ + --login(-l) # Start a full login shell + -f # Start csh without reading its startup file + --preserve-environment(-m) # Keep the environment and current shell + --shell(-s): path # Shell to run + --command(-c): text # Command to run in the shell + --help(-h) # Show help + login?: users # User to become (root by default) + ...args: text # Arguments for the shell +] + +# Print user and group ids +export complete [id] profile posix-v1 [ + --user(-u) # Print only the effective user id + --group(-g) # Print only the effective group id + --groups(-G) # Print all group ids + --name(-n) # Print names instead of numbers + --real(-r) # Print the real id instead of the effective one + --zero(-z) # Separate entries with NUL + --context(-Z) # Print the security context + -p # (BSD) Human-readable output + -P # (BSD) Print as a password file entry + -A # (BSD) Print process audit properties + -a # Ignored, for compatibility + --help(-h) # Show help + --version(-V) # Show version + user?: users # User to describe (you by default) +] where { + at-most-one [--user --group --groups -p -P -A] +} + +# Print the groups users are in +export complete [groups] [ + --help(-h) # Show help + --version(-V) # Show version + ...users: users # Users to describe (you by default) +] + +# Signal processes by name +export complete [killall] profile posix-v1 [ + -d # Print what would be done, send nothing + -e # Match effective user id, not real + -I # Confirm before signalling each process + -l # List signal names and exit + -m # Treat the name as a case-sensitive regex + -v # Report what is done + -s # Print what would be done, send nothing + -q # Be quiet when nothing matches + -z # Include zombies + -u: users # Only processes of this user + -t: text # Only processes on this terminal + -c: processes # Only processes with this name + ...names: processes # Processes to signal +] where { + terminal [-l] +} + +# Signal processes by name or attributes +export complete [pkill] profile posix-v1 [ + -a # Include ancestors of matched processes + -f # Match the full argument list + -i # Ignore case + -I # Confirm before signalling each process + -l # Print the name with each pid + -n # Only the newest matching process + -o # Only the oldest matching process + -q # Print nothing + -v # Select non-matching processes + -x # Require an exact match + -L # The -F pidfile must be locked + -F: path # Only the pid in this file + -G: groups # Only these real group ids or names + -g: text # Only these process groups + -P: pids # Only children of these parent pids + -s: text # Only these session ids + -t: text # Only processes on these terminals + -U: users # Only these real user ids or names + -u: users # Only these effective user ids or names + ...patterns: processes # Process name patterns +] where { + at-most-one [-n -o] +} + +# Find processes by name or attributes +export complete [pgrep] profile posix-v1 [ + -a # Include ancestors of matched processes + -f # Match the full argument list + -i # Ignore case + -l # Print the name with each pid + -n # Only the newest matching process + -o # Only the oldest matching process + -q # Print nothing + -v # Select non-matching processes + -x # Require an exact match + -L # The -F pidfile must be locked + -d: text # Delimiter between pids + -F: path # Only the pid in this file + -G: groups # Only these real group ids or names + -g: text # Only these process groups + -P: pids # Only children of these parent pids + -s: text # Only these session ids + -t: text # Only processes on these terminals + -U: users # Only these real user ids or names + -u: users # Only these effective user ids or names + ...patterns: processes # Process name patterns +] where { + at-most-one [-n -o] +} diff --git a/custom-completions/tar/tar-completions.nu b/custom-completions/tar/tar-completions.nu index 844460043..e2b007412 100644 --- a/custom-completions/tar/tar-completions.nu +++ b/custom-completions/tar/tar-completions.nu @@ -1,61 +1,139 @@ -# Append archive to archive -export extern "tar" [ - --concatenate(-A) # Append archive to archive - --create(-c) # Create archive - --compare(-d) # Compare archive and filesystem - --delete # Delete from archive - --append(-r) # Append files to archive - --list(-t) # List archive - --update(-u) # Append new files - --get(-x) # Extract from archive - --help(-?) # Display short option summary - --usage # List available options - --atime-preserve # Keep access time - --block-size(-b) # Block size - --read-full-blocks(-B) # Reblock while reading - --checkpoint # Print directory names - --force-local # Archive is local - --info-script(-F) # Run script at end of tape - --incremental(-G) # Use old incremental GNU format - --listed-incremental(-g) # Use new incremental GNU format - --dereference(-h) # Dereference symlinks - --ignore-zeros(-i) # Ignore zero block in archive - --bzip2(-j) # Filter through bzip2 - --ignore-failed-read # Don't exit on unreadable files - --keep-old-files(-k) # Don't overwrite - --one-top-level # Extract into directory - --one-file-system(-l) # Stay in local filesystem - --modification-time(-m) # Don't extract modification time - --touch # Don't extract modification time - --multi-volume(-M) # Multi volume archive - --old-archive(-o) # Use V7 format - --portability # Use V7 format - --to-stdout(-O) # Extract to stdout - --same-permissions(-p) # Extract all permissions - --preserve-permissions # Extract all permissions - --absolute-paths(-P) # Don't strip leading / - --preserve # Preserve all permissions and do not sort file arguments - --record-number(-R) # Show record number - --remove-files # Remove files after adding to archive - --same-order(-s) # Do not sort file arguments - --preserve-order # Do not sort file arguments - --same-owner # Preserve file ownership - --sparse(-S) # Handle sparse files - --null # -T has null-terminated names - --totals # Print total bytes written - --verbose(-v) # Verbose mode - --version # Display version and exit - --interactive(-w) # Ask for confirmation - --confirmation # Ask for confirmation - --verify(-W) # Verify archive - --compress(-Z) # Filter through compress - --uncompress # Filter through compress - --gzip(-z) # Filter through gzip - --gunzip # Filter through gzip - --xz(-J) # Filter through xz - --lzip # Filter through lzip - --lzma # Filter through lzma - --lzop # Filter through lzop - --zstd # Filter through zstd - ...args -] \ No newline at end of file +# nu-version: 0.116.2 +# Declarative completions for tar (GNU tar flags, which bsdtar mostly shares). `bundled-v1` reads +# `tar czf out.tar.gz` and `tar -czf` as `-c -z -f`, so the mode and compression rules hold for them. +# Load with `use tar-completions.nu *`. + +# Store, list or extract files in an archive. +export complete [tar] profile bundled-v1 [ + # Operation mode: exactly one of these + --create(-c) # Create a new archive + --extract(-x) # Extract files from an archive + --get # Extract files from an archive (same as --extract) + --list(-t) # List the contents of an archive + --append(-r) # Append files to the end of an archive + --update(-u) # Append files newer than their copy in the archive + --concatenate(-A) # Append tar files to an archive + --compare(-d) # Find differences between archive and file system + --delete # Delete from the archive + --test-label # Test the archive volume label and exit + + # Archive and locations + --file(-f): path # Use this archive file or device + --directory(-C): dir cwd # Change to this directory before the remaining files + --files-from(-T): path # Read the names to add or extract from this file + --exclude: text # Leave out the files this pattern matches + --exclude-from(-X): path # Read the patterns to leave out from this file + --exclude-vcs # Leave out version-control directories + --exclude-caches # Leave out directories containing a CACHEDIR.TAG + --null # Names read with -T are NUL-terminated + --strip-components: text # Strip this many leading path components on extract + --transform: text # Rewrite member names with a sed expression + --one-top-level?: text # Extract into a directory named after the archive + --wildcards # Use wildcards for the names on the command line + --no-wildcards # Match the names on the command line literally + --anchored # Patterns match the start of file names + --recursion # Recurse into directories (default) + --no-recursion # Avoid descending automatically in directories + --one-file-system(-l) # Stay in the local file system + --dereference(-h) # Follow symlinks; archive the files they point to + --hard-dereference # Follow hard links; archive the files they refer to + --absolute-names(-P) # Do not strip leading `/` from file names + --newer(-N): text # Only store files newer than this date or file + --newer-mtime: text # Only store files whose data changed after this date + --after-date: text # Same as --newer + + # Compression: at most one of these + --gzip(-z) # Filter the archive through gzip + --gunzip # Alias of --gzip + --bzip2(-j) # Filter the archive through bzip2 + --xz(-J) # Filter the archive through xz + --lzip # Filter the archive through lzip + --lzma # Filter the archive through lzma + --lzop # Filter the archive through lzop + --zstd # Filter the archive through zstd + --compress(-Z) # Filter the archive through compress + --uncompress # Alias of --compress + --auto-compress(-a) # Pick the compression program from the archive suffix + --use-compress-program(-I): command # Filter the archive through this program + + # Format + --format(-H): words [gnu: "GNU tar 1.13.x format" oldgnu: "GNU format as per tar <= 1.12" pax: "POSIX 1003.1-2001 (pax)" posix: "Same as pax" ustar: "POSIX 1003.1-1988 (ustar)" v7: "Old V7 tar format"] + --old-archive(-o) # Same as --format=v7 + --portability # Same as --format=v7 + --posix # Same as --format=posix + --label(-V): text # Create an archive with this volume name + --multi-volume(-M) # Create, list or extract a multi-volume archive + --tape-length(-L): text # Change tape after writing this many x1024 bytes + --info-script(-F): path # Run this script at the end of each tape + --new-volume-script: path # Same as --info-script + --incremental(-G) # Handle old GNU-format incremental backups + --listed-incremental(-g): path # Handle new GNU-format incremental backups with this snapshot + --level: text # Dump level for a --listed-incremental archive + --sparse(-S) # Handle sparse files efficiently + --block-size(-b): text # Use this many 512-byte records per block + --record-size: text # Use this many bytes per record + --read-full-records(-B) # Reblock as we read (for 4.2BSD pipes) + --ignore-zeros(-i) # Ignore zeroed blocks in the archive (EOF) + --force-local # The archive file is local even if it has a colon + --rsh-command: command # Use this remote shell instead of rsh + --verify(-W) # Verify the archive after writing it + + # Extraction behavior + --keep-old-files(-k) # Don't replace existing files when extracting + --keep-newer-files # Don't replace files that are newer than their copy + --skip-old-files # Silently skip files that already exist + --overwrite # Overwrite existing files when extracting + --overwrite-dir # Overwrite metadata of existing directories + --unlink-first(-U) # Remove each file before extracting over it + --recursive-unlink # Empty hierarchies before extracting a directory + --remove-files # Remove files after adding them to the archive + --to-stdout(-O) # Extract files to standard output + --to-command: command # Pipe extracted files to this program + --touch(-m) # Don't extract file modified time + --modification-time # Same as --touch + --atime-preserve?: words [replace system] # Preserve access times of dumped files + --same-permissions(-p) # Extract information about file permissions + --preserve-permissions # Same as --same-permissions + --no-same-permissions # Apply the user's umask when extracting + --same-owner # Try extracting files with the same ownership + --no-same-owner # Extract files as yourself + --numeric-owner # Always use numbers for user/group names + --owner: users # Force this owner for added files + --group: groups # Force this group for added files + --mode: text # Force symbolic mode changes for added files + --mtime: text # Set mtime for added files from this date or file + --same-order(-s) # Sort names to extract to match the archive + --preserve-order # Same as --same-order + --preserve # Same as both -p and -s + --acls # Enable POSIX ACL support + --xattrs # Enable extended attribute support + --selinux # Enable SELinux context support + + # Output + --verbose(-v) # Verbosely list the files processed + --interactive(-w) # Ask for confirmation for every action + --confirmation # Same as --interactive + --checkpoint?: text # Display progress messages every this many records + --totals?: words [SIGHUP SIGQUIT SIGINT SIGUSR1 SIGUSR2] # Print total bytes after processing + --block-number(-R) # Show the block number within the archive with each message + --show-transformed-names # Show file or archive names after transformation + --index-file: path # Send verbose output to this file + --utc # Print file modification times in UTC + --warning: text # Enable or disable warnings of this kind + --quoting-style: words [literal shell shell-always c c-maybe escape locale clocale] + + # Information + --help # Display a short option summary + --usage # List the available options + --version # Print the program version + ...files: path # Files to add, or members to extract or list +] where { + exactly-one [--create --extract --get --list --append --update --concatenate --compare --delete --test-label] + at-most-one [--gzip --gunzip --bzip2 --xz --lzip --lzma --lzop --zstd --compress --uncompress --auto-compress --use-compress-program] + at-most-one [--keep-old-files --keep-newer-files --skip-old-files --overwrite --unlink-first] + at-most-one [--same-owner --no-same-owner] + at-most-one [--same-permissions --no-same-permissions] + at-most-one [--wildcards --no-wildcards] + at-most-one [--recursion --no-recursion] + terminal [--help --usage --version] +} diff --git a/custom-completions/tcpdump/tcpdump-completions.nu b/custom-completions/tcpdump/tcpdump-completions.nu index 0e6259036..8424da7f4 100644 --- a/custom-completions/tcpdump/tcpdump-completions.nu +++ b/custom-completions/tcpdump/tcpdump-completions.nu @@ -1,19 +1,111 @@ -# Print each packet in ASCII -extern "tcpdump" [ - --list-interfaces(-D) # Print the list of the network interfaces - --help(-h) # Print version strings and a usage message - --version # Print the tcpdump and libpcap version strings - --monitor-mode(-I) # Put the interface in monitor mode - --immediate-mode # Capture in immediate mode - --list-time-stamp-types(-J) # List the supported time stamp types for the interface - --dont-verify-checksums(-K) # Dont attempt to verify IP, TCP, or UDP checksums - --list-data-link-types(-L) # List the known data link types for the interface - --number # Print an optional packet number - # breaks the parser - # --number(-\#) # Print an optional packet number - --no-optimize(-O) # Do not run the packet-matching code optimizer - --no-promiscuous-mode(-p) # Dont put the interface into promiscuous mode - --absolute-tcp-sequence-numbers(-S) # Print absolute TCP sequence numbers - --packet-buffered(-U) # Make the packet output packet-buffered - ...args -] \ No newline at end of file +# nu-version: 0.116.2 +# Declarative completions for tcpdump 4.99 (flags from `man tcpdump`, including Apple's additions). +# Load with `use tcpdump-completions.nu *`. + +# The interfaces tcpdump can capture on (`tcpdump -D`), described by their flags. +@non-destructive +export def "nu-complete tcpdump interfaces" [...rest: string]: nothing -> list<record<value: string, description: string>> { + try { + ^tcpdump -D + | lines + | parse --regex '^\d+\.(?<value>\S+)\s*(?<description>.*)$' + | update description { str trim --char '[' | str trim --char ']' } + } catch { [{value: any, description: "All interfaces"}] } +} + +# The primitives and qualifiers of a pcap-filter expression. +@non-destructive +export def "nu-complete tcpdump filter" [...rest: string]: nothing -> list<record<value: string, description: string>> { + [ + {value: host, description: "Packets to or from this host"} + {value: net, description: "Packets to or from this network"} + {value: port, description: "Packets to or from this port"} + {value: portrange, description: "Packets to or from a port range"} + {value: src, description: "Qualify: source only"} + {value: dst, description: "Qualify: destination only"} + {value: ether, description: "Ethernet (link layer)"} + {value: ip, description: "IPv4"} + {value: ip6, description: "IPv6"} + {value: arp, description: "ARP"} + {value: tcp, description: "TCP"} + {value: udp, description: "UDP"} + {value: icmp, description: "ICMP"} + {value: icmp6, description: "ICMPv6"} + {value: vlan, description: "802.1Q VLAN"} + {value: broadcast, description: "Broadcast packets"} + {value: multicast, description: "Multicast packets"} + {value: less, description: "Packets shorter than or equal to a length"} + {value: greater, description: "Packets longer than or equal to a length"} + {value: and, description: "Both conditions"} + {value: or, description: "Either condition"} + {value: not, description: "Negate the next condition"} + ] +} + +# Capture and print the packets that travel over a network. +export complete [tcpdump] profile posix-v1 [ + -A # Print each packet (minus its link header) in ASCII + -b # Print BGP AS numbers in ASDOT notation + --buffer-size(-B): text # Operating-system capture buffer size, in KiB + -c: text # Exit after receiving this many packets + --count # Print only the number of packets captured + -C: text # Rotate the savefile after this many million bytes + -d # Dump the compiled packet-matching code and stop + --list-interfaces(-D) # Print the interfaces available for capture + -e # Print the link-level header on each dump line + -E: text # Decrypt IPsec ESP packets: spi@ipaddr algo:secret + -f # Print foreign IPv4 addresses numerically + -F: path # Read the filter expression from this file + -G: text # Rotate the savefile every this many seconds + --apple-oneline(-g) # Print each packet on one line (Apple) + --help(-h) # Print version strings and a usage message + --version # Print the tcpdump and libpcap version strings + -H # Detect 802.11s draft mesh headers + --interface(-i): by "nu-complete tcpdump interfaces" # Interface to capture on + --monitor-mode(-I) # Put the interface in monitor mode + --immediate-mode # Capture in immediate mode + --time-stamp-type(-j): words [host host_lowprec host_hiprec adapter adapter_unsynced] + --list-time-stamp-types(-J) # List the time stamp types of the interface + --time-stamp-precision: words [micro nano] + --micro # Same as --time-stamp-precision=micro + --nano # Same as --time-stamp-precision=nano + --apple-md-print(-k): text # Print packet metadata (Apple) + --dont-verify-checksums(-K) # Don't verify IP, TCP, or UDP checksums + -l # Make stdout line buffered + --list-data-link-types(-L) # List the data link types of the interface + -m: path # Load SMI MIB module definitions from this file + -M: text # Shared secret for TCP-MD5 signature validation + -n # Don't convert addresses to names + -N # Don't print domain name qualification of host names + --number # Print a packet number at the start of each line + --no-optimize(-O) # Do not run the packet-matching code optimizer + --apple-pcapng(-P) # Write the savefile in pcapng format (Apple) + --no-promiscuous-mode(-p) # Don't put the interface into promiscuous mode + --print # Print parsed packets even while writing with -w + --direction: words [in out inout] # Direction of packets to capture + -Q: text # Direction (in/out/inout) or Apple metadata filter + --apple-md-filter: text # Filter on packet metadata (Apple) + -q # Quick output: less protocol information + -r: path # Read packets from this savefile + --absolute-tcp-sequence-numbers(-S) # Print absolute TCP sequence numbers + --snapshot-length(-s): text # Capture at most this many bytes of each packet + -T: words [aodv carp cdp cnfp domain lmp pgm pgm_zmtp1 qrp radius resp rpc rtcp rtp snmp tftp vat vxlan wb zmtp1] + -t # Don't print a timestamp (-tt, -ttt.. pick other forms) + -u # Print undecoded NFS handles + --packet-buffered(-U) # Write each packet as soon as it is saved + -v # Verbose output, once more for more + -V: path # Read a list of savefiles from this file + -w: path # Write the raw packets to this file + -W: text # Limit the number of rotated files + -x # Print each packet's data in hex + -X # Print each packet's data in hex and ASCII + --linktype(-y): text # Data link type to use while capturing + -z: command # Run this command on each rotated savefile + --relinquish-privileges(-Z): users # Drop privileges to this user + ...expression: by "nu-complete tcpdump filter" # pcap-filter expression, e.g. `tcp port 443` +] where { + at-most-one [-x -X -A] + at-most-one [--micro --nano --time-stamp-precision] + at-most-one [-q -v] + terminal [--help --version --list-interfaces --list-time-stamp-types --list-data-link-types] +} diff --git a/custom-completions/television/television-completions.nu b/custom-completions/television/television-completions.nu index 6af6e3b70..d3790c755 100644 --- a/custom-completions/television/television-completions.nu +++ b/custom-completions/television/television-completions.nu @@ -1,19 +1,45 @@ -def "nu-complete tv channels" [] { - ^tv list-channels - | lines +# television (tv): a fast, portable fuzzy finder. + +@non-destructive +export def "nu-complete tv channels" [] { + try { ^tv list-channels | lines | str trim | where $it != '' } catch { [] } +} + +export complete [tv] [ + channel?: by "nu-complete tv channels" # Channel to open + --preview(-p): text # Command that renders the preview of the selected entry + --source-command(-s): text # Command that produces the entries instead of a channel + --preview-command: text # Command that produces the preview of the selected entry + --preview-size: text # Percentage of the screen the preview takes + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help --version] } -export extern "tv" [ - channel: string@"nu-complete tv channels" +# List the available channels +export complete [tv list-channels] [ + --help(-h) # Print help +] + +# Initialize shell integration +export complete [tv init] [ + shell?: words [bash zsh fish nu powershell cmd] # Shell to integrate with + --help(-h) # Print help ] -# Lists the available channels -export extern "tv list-channels" [] -# Initializes shell completion ("tv init zsh") -export extern "tv init" [] -# Generates standard shell tab-completion scripts for tv's various subcommands -export extern "tv completions" [] -# Downloads the latest collection of channel prototypes from github and saves them to the local configuration directory -export extern "tv update-channels" [] -# Print this message or the help of the given subcommand(s) -export extern "tv help" [] +# Generate shell completion scripts +export complete [tv completions] [ + shell: words [bash zsh fish nu powershell elvish] # Shell to generate completions for + --help(-h) # Print help +] + +# Download the latest channel prototypes into the config directory +export complete [tv update-channels] [ + --help(-h) # Print help +] + +# Print help for tv or a subcommand +export complete [tv help] [ + subcommand?: words [list-channels init completions update-channels help] # Subcommand to describe +] diff --git a/custom-completions/tldr/tldr-completions.nu b/custom-completions/tldr/tldr-completions.nu index 71e068eaa..deaa2e9b5 100644 --- a/custom-completions/tldr/tldr-completions.nu +++ b/custom-completions/tldr/tldr-completions.nu @@ -1,36 +1,40 @@ -# authour: DWTW +# nu-version: 0.116.2 +# Declarative completions for tealdeer's `tldr` 1.9 (flags from `tldr --help`). Original author: DWTW. +# Load with `use tldr-completions.nu *`. -def commands [] { - tldr --list | lines +# The pages in the local cache (`tldr --list`). +@non-destructive +export def "nu-complete tldr pages" [...rest: string]: nothing -> list<string> { + try { ^tldr --list | lines } catch { [] } } -def platformOverride [] { - [linux macos sunos windows android freebsd netbsd openbsd common] -} - -def whenColor [] { - [always auto never] -} - -# Collaborative cheatsheets for console commands -export extern "tldr" [ - cmd?: string@commands - --list(-l) # Lists all commands in the cache +# Collaborative cheatsheets for console commands. +export complete [tldr] [ + --list(-l) # List all commands in the cache --edit-page # Edit custom page with `EDITOR` --edit-patch # Edit custom patch with `EDITOR` - --render(-f): string # Render a specific markdown file - --platform(-p): string@platformOverride # Override the operating system, can be specified multiple times in order of preference - --language(-L): string # Override the language + --render(-f): path # Render a specific markdown file + --platform(-p): words [linux macos sunos windows android freebsd netbsd openbsd common] # Override the operating system (repeatable, in order of preference) + --language(-L): text # Override the language --update(-u) # Update the local cache --no-auto-update # If auto update is configured, disable it for this run --clear-cache(-c) # Clear the local cache --config-path: path # Override config file location + --override-config: text # Override config values after reading the config file --pager # Use a pager to page output --raw(-r) # Display the raw markdown instead of rendering it - --quiet(-q) # Suppress informational message - --show-paths # Show file and directory paths using tealdeer + --quiet(-q) # Suppress informational messages + --show-paths # Show file and directory paths used by tealdeer --seed-config # Create a basic config - --color: string@whenColor # Controls whether to use color + --color: words [always auto never] # Control whether to use color + --short-options # Display the short variants of placeholders + --long-options # Display the long variants of placeholders --version(-v) # Print the version - --help # Print the help information -] + --help(-h) # Print help + ...command: by "nu-complete tldr pages" # The command to show (e.g. `tar` or `git log`) +] where { + at-most-one [--short-options --long-options] + at-most-one [--update --no-auto-update] + at-most-one [--list --render --clear-cache --seed-config --show-paths] + terminal [--help --version] +} diff --git a/custom-completions/tmux/tmux-completions.nu b/custom-completions/tmux/tmux-completions.nu new file mode 100644 index 000000000..ea53c3c16 --- /dev/null +++ b/custom-completions/tmux/tmux-completions.nu @@ -0,0 +1,1130 @@ +# Declarative completions for tmux(1). +# +# Targets (`-t`, `-s`) are parsed with the `tmux.target` syntax (`session:window.pane`), so the +# session, window and pane parts each complete from the running server. Sizes (`-l`, `-x`, +# `-y`, `-w`, `-h` on popups) use `tmux.size` (`N` or `N%`). Every live provider runs a +# read-only `tmux list-*`/`show-*` query and returns `[]` when tmux is missing or no server is +# running. Flags and invariants follow tmux(1) for tmux 3.4/3.5. + +# Run a read-only tmux query and return its output lines, or nothing on any failure. +def tmux-lines [args: list<string>]: nothing -> list<string> { + try { + let out = ^tmux ...$args | complete + if $out.exit_code != 0 { return [] } + $out.stdout | lines | where $it != "" + } catch { [] } +} + +# Running sessions, described by window count and attachment. +@non-destructive +export def "nu-complete tmux sessions" []: nothing -> list<record<value: string, description: string>> { + try { + tmux-lines [list-sessions -F "#{session_name}\t#{session_windows} windows#{?session_attached, (attached),}"] + | parse "{value}\t{description}" + } catch { [] } +} + +# Window indexes and names across all sessions (a window part of a target accepts either). +@non-destructive +export def "nu-complete tmux windows" []: nothing -> list<record<value: string, description: string>> { + try { + let rows = tmux-lines [list-windows -a -F "#{window_index}\t#{window_name}\t#{session_name}"] + | parse "{index}\t{name}\t{session}" + let by_index = $rows | group-by index | items {|k, v| + { value: $k, description: ($v | each {|r| $"($r.session):($r.name)" } | str join ", ") } + } + let by_name = $rows | uniq-by name | each {|r| { value: $r.name, description: $"window ($r.session):($r.index)" } } + $by_index ++ $by_name | uniq-by value + } catch { [] } +} + +# Pane indexes across all windows, plus unique `%id` pane ids. +@non-destructive +export def "nu-complete tmux panes" []: nothing -> list<record<value: string, description: string>> { + try { + let rows = tmux-lines [list-panes -a -F "#{pane_index}\t#{pane_id}\t#{session_name}:#{window_index}\t#{pane_current_command}"] + | parse "{index}\t{id}\t{window}\t{cmd}" + let by_index = $rows | group-by index | items {|k, v| + { value: $k, description: ($v | each {|r| $"($r.window).($k) ($r.cmd)" } | str join ", ") } + } + let by_id = $rows | each {|r| { value: $r.id, description: $"($r.window).($r.index) ($r.cmd)" } } + $by_index ++ $by_id + } catch { [] } +} + +# Attached clients (tty names). +@non-destructive +export def "nu-complete tmux clients" []: nothing -> list<record<value: string, description: string>> { + try { + tmux-lines [list-clients -F "#{client_name}\tsession #{client_session} (#{client_width}x#{client_height})"] + | parse "{value}\t{description}" + } catch { [] } +} + +# Paste buffers with a short content sample. +@non-destructive +export def "nu-complete tmux buffers" []: nothing -> list<record<value: string, description: string>> { + try { + tmux-lines [list-buffers -F "#{buffer_name}\t#{buffer_size} bytes: #{buffer_sample}"] + | parse "{value}\t{description}" + } catch { [] } +} + +# Server, session, window and pane option names. Uses the live server when one is running and +# falls back to the well-known option names otherwise. +@non-destructive +export def "nu-complete tmux options" []: nothing -> list<record<value: string, description: string>> { + try { + let scopes = [[flags scope]; ["-s" server] ["-g" session] ["-gw" window] ["-gp" pane]] + let live = $scopes | each {|s| + tmux-lines [show-options $s.flags] + | each {|l| $l | split row " " | first } + | each {|n| { value: $n, description: $"($s.scope) option" } } + } | flatten + if ($live | is-not-empty) { return ($live | uniq-by value) } + [ + [value description]; + [base-index "session: index of the first window"] + [default-terminal "server: TERM inside tmux"] + [escape-time "server: delay after Escape (ms)"] + [history-limit "session: scrollback lines"] + [mouse "session: enable mouse support"] + [prefix "session: prefix key"] + [prefix2 "session: secondary prefix key"] + [renumber-windows "session: renumber windows on close"] + [set-clipboard "server: OSC 52 clipboard"] + [status "session: show the status line"] + [status-interval "session: status refresh seconds"] + [status-keys "session: emacs or vi in the command prompt"] + [status-left "session: left status content"] + [status-position "session: top or bottom"] + [status-right "session: right status content"] + [status-style "session: status line style"] + [terminal-features "server: features of outer terminals"] + [focus-events "server: pass focus events"] + [aggressive-resize "window: resize to the smallest attached client"] + [automatic-rename "window: rename from the running command"] + [mode-keys "window: emacs or vi in copy mode"] + [monitor-activity "window: flag activity"] + [pane-base-index "window: index of the first pane"] + [pane-border-status "window: pane border status line"] + [window-status-format "window: status entry format"] + [window-status-current-format "window: current status entry format"] + [allow-passthrough "pane: allow escape passthrough"] + [remain-on-exit "pane: keep panes after their command exits"] + [synchronize-panes "window: send input to all panes"] + ] + } catch { [] } +} + +# Key tables known to the server (plus the four built-in tables). +@non-destructive +export def "nu-complete tmux key-tables" []: nothing -> list<string> { + try { + let live = tmux-lines [list-keys] + | parse -r '^bind-key\s+(?:-r\s+)?-T\s+(?<table>\S+)' + | get table + ["root" "prefix" "copy-mode" "copy-mode-vi"] ++ $live | uniq + } catch { [] } +} + +# Names of tmux commands, for nested commands such as `bind-key KEY command ...`. +@non-destructive +export def "nu-complete tmux commands" []: nothing -> list<string> { + try { + let live = tmux-lines [list-commands -F "#{command_list_name}"] + if ($live | is-not-empty) { return $live } + [ + attach-session bind-key break-pane capture-pane choose-buffer choose-client choose-tree + clear-history command-prompt confirm-before copy-mode delete-buffer detach-client + display-menu display-message display-panes display-popup has-session if-shell join-pane + kill-pane kill-server kill-session kill-window last-pane last-window list-buffers + list-clients list-commands list-keys list-panes list-sessions list-windows load-buffer + move-pane move-window new-session new-window next-layout next-window paste-buffer + pipe-pane previous-layout previous-window refresh-client rename-session rename-window + resize-pane resize-window respawn-pane respawn-window rotate-window run-shell save-buffer + select-layout select-pane select-window send-keys send-prefix set-buffer set-environment + set-hook set-option show-buffer show-environment show-hooks show-messages show-options + source-file split-window start-server suspend-client swap-pane swap-window switch-client + unbind-key wait-for + ] + } catch { [] } +} + +# `session:window.pane`. Every part is optional: `:1` is window 1 of the current session, +# `:.2` pane 2 of the current window, `%5`/`@3`/`$1` are pane/window/session ids, `=name` +# forces an exact session match. +export syntax tmux.target over chars { + root = (session: until ":.")? (":" (window: until ".")? ("." pane: until ":.")?)? +} + +# A size: a number of cells or lines, or a percentage of the available space. +export syntax tmux.size over chars { + root = cells: digit+ percent: ("%")? +} + +export complete [tmux] [ + -2 # Assume the terminal supports 256 colours + -C # Start in control mode + -CC # Control mode with echo disabled (for iTerm2) + -c: text # Run a shell command with the default shell + -D # Do not daemonize the server (foreground) + -f: path # Alternative configuration file + -L: text # Socket name in the default socket directory + -l # Behave as a login shell + -N # Do not start the server even if a command would + -S: path # Full path to an alternative socket + -T: text # Terminal features for the client (e.g. 256,RGB) + -u # Write UTF-8 output to the terminal + -v # Verbose logging (repeat for more) + -V # Print version and exit +] where { + at-most-one [-L -S] + at-most-one [-C -CC] + terminal [-V] +} + +# ---------------------------------------------------------------------------- sessions + +export complete [tmux attach-session] [ + -c: dir cwd # Set the session working directory + -d # Detach other clients attached to the session + -E # Do not apply update-environment + -f: words [active-pane ignore-size no-detach-on-destroy no-output pause-after read-only wait-exit] # Client flags (comma-separated) + -r # Read-only client (alias for -f read-only,ignore-size) + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target session + -x # Detach other clients and send SIGHUP to their parent +] where { + at-most-one [-d -x] +} + +export complete [tmux new-session] [ + -A # Attach to the session if it already exists + -c: dir cwd # Start directory + -D # With -A, detach other clients (like attach -d) + -d # Do not attach to the new session + -E # Do not apply update-environment + -e: env-assign # Set an environment variable (VAR=value) + -F: text # Format for -P output + -f: words [active-pane ignore-size no-detach-on-destroy no-output pause-after read-only wait-exit] # Client flags + -n: text # Name of the initial window + -P # Print information about the new session + -s: text # Session name + -t: tmux.target with { root.session: by "nu-complete tmux sessions" } # Group with this target session + -X # With -A, detach and SIGHUP other clients (like attach -x) + -x: tmux.size # Width (detached sessions) + -y: tmux.size # Height (detached sessions) + ...command: command # Shell command for the initial window +] where { + requires -D -A + requires -X -A + at-most-one [-D -X] +} + +export complete [tmux kill-session] [ + -a # Kill all sessions except the target + -C # Clear alerts (bell, activity, silence) instead + -t: tmux.target with { root.session: by "nu-complete tmux sessions" } # Target session +] + +export complete [tmux rename-session] [ + -t: tmux.target with { root.session: by "nu-complete tmux sessions" } # Target session + new_name: text # New session name +] + +export complete [tmux list-sessions] [ + -F: text # Output format + -f: text # Filter format (only sessions where it is true) +] + +export complete [tmux has-session] [ + -t: tmux.target with { root.session: by "nu-complete tmux sessions" } # Target session +] + +export complete [tmux switch-client] [ + -c: by "nu-complete tmux clients" # Target client + -E # Do not apply update-environment + -l # Switch to the last session + -n # Switch to the next session + -p # Switch to the previous session + -r # Toggle read-only and ignore-size + -T: by "nu-complete tmux key-tables" # Set the client key table + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target session/window/pane + -Z # Keep the window zoomed +] where { + at-most-one [-l -n -p -t] +} + +export complete [tmux detach-client] [ + -a # Detach all clients but the target client + -E: text # Run this shell command to replace the client + -P # Send SIGHUP to the client's parent process + -s: tmux.target with { root.session: by "nu-complete tmux sessions" } # Detach all clients on this session + -t: by "nu-complete tmux clients" # Target client +] where { + at-most-one [-s -t] +} + +# ----------------------------------------------------------------------------- windows + +export complete [tmux new-window] [ + -a # Insert after the target window + -b # Insert before the target window + -c: dir cwd # Start directory + -d # Do not make the new window current + -e: env-assign # Set an environment variable (VAR=value) + -F: text # Format for -P output + -k # Destroy an existing window at the target index + -n: text # Window name + -P # Print information about the new window + -S # Select the window if one with this name exists + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window + ...command: command # Shell command to run +] where { + at-most-one [-a -b] +} + +export complete [tmux kill-window] [ + -a # Kill all windows except the target + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window +] + +export complete [tmux rename-window] [ + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window + new_name: text # New window name +] + +export complete [tmux select-window] [ + -l # Select the last (previously selected) window + -n # Select the next window + -p # Select the previous window + -T # Toggle to the last window if already selected + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window +] where { + at-most-one [-l -n -p -t] +} + +export complete [tmux list-windows] [ + -a # List all windows on the server + -F: text # Output format + -f: text # Filter format + -t: tmux.target with { root.session: by "nu-complete tmux sessions" } # Target session +] where { + at-most-one [-a -t] +} + +export complete [tmux select-layout] [ + -E # Spread the current pane and neighbours evenly + -n # Next layout (like next-layout) + -o # Apply the previous layout + -p # Previous layout (like previous-layout) + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + layout?: words [even-horizontal even-vertical main-horizontal main-horizontal-mirrored main-vertical main-vertical-mirrored tiled] # Layout name or custom layout string +] where { + at-most-one [-n -o -p -E] +} + +# ------------------------------------------------------------------------------- panes + +export complete [tmux split-window] [ + -b # Create the pane left of / above the target + -c: dir cwd # Start directory + -d # Do not make the new pane active + -e: env-assign # Set an environment variable (VAR=value) + -F: text # Format for -P output + -f # Span the full window height (-h) or width (-v) + -h # Horizontal split (side by side) + -I # Create an empty pane and forward stdin to it + -l: tmux.size # Size of the new pane (lines/cells or N%) + -P # Print information about the new pane + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + -v # Vertical split (one above the other, default) + -Z # Zoom the new pane + ...command: command # Shell command to run +] where { + at-most-one [-h -v] +} + +export complete [tmux select-pane] [ + -D # Select the pane below + -d # Disable input to the pane + -e # Enable input to the pane + -L # Select the pane to the left + -l # Select the last (previously selected) pane + -M # Clear the marked pane + -m # Set the marked pane + -R # Select the pane to the right + -T: text # Set the pane title + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + -U # Select the pane above + -Z # Keep the window zoomed +] where { + at-most-one [-U -D -L -R -l] + at-most-one [-d -e] + at-most-one [-m -M] +} + +export complete [tmux resize-pane] [ + -D # Resize downward + -L # Resize to the left + -M # Begin mouse resizing + -R # Resize to the right + -T # Trim lines below the cursor moved into history + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + -U # Resize upward + -x: tmux.size # Absolute width (cells or N%) + -y: tmux.size # Absolute height (lines or N%) + -Z # Toggle zoom + adjustment?: text # Number of cells/lines to resize by (default 1) +] where { + at-most-one [-U -D -L -R] + at-most-one [-Z -M] +} + +export complete [tmux kill-pane] [ + -a # Kill all panes except the target + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane +] + +export complete [tmux swap-pane] [ + -D # Swap with the next pane + -d # Do not change the active pane + -s: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Source pane + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Destination pane + -U # Swap with the previous pane + -Z # Keep the window zoomed +] where { + at-most-one [-U -D -s] +} + +export complete [tmux join-pane] [ + -b # Join left of / above the target + -d # Do not make the joined pane active + -f # Span the full window height or width + -h # Join side by side + -l: tmux.size # Size of the joined pane (lines/cells or N%) + -s: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Source pane + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Destination pane + -v # Join one above the other +] where { + at-most-one [-h -v] +} + +export complete [tmux break-pane] [ + -a # Place the new window after the target window + -b # Place the new window before the target window + -d # Do not make the new window current + -F: text # Format for -P output + -n: text # Name of the new window + -P # Print information about the new window + -s: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Source pane + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Destination window +] where { + at-most-one [-a -b] +} + +export complete [tmux list-panes] [ + -a # List all panes on the server + -F: text # Output format + -f: text # Filter format + -s # List all panes in the target session + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window (or session with -s) +] where { + at-most-one [-a -s] + at-most-one [-a -t] +} + +export complete [tmux send-keys] [ + -F # Expand formats in arguments + -H # Keys are hexadecimal character codes + -K # Treat keys as key presses from a client + -l # Send keys literally (no key-name lookup) + -M # Pass through a mouse event + -N: text # Repeat count + -R # Reset the terminal state + -X # Send a copy-mode command + -c: by "nu-complete tmux clients" # Target client (with -K) + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + ...keys: words [Enter Escape Tab BSpace Space Up Down Left Right Home End PageUp PageDown IC DC C-c C-d C-l C-z cancel copy-selection copy-selection-and-cancel begin-selection] # Keys or (with -X) copy-mode commands +] where { + at-most-one [-l -H] + requires -c -K +} + +export complete [tmux capture-pane] [ + -a # Use the alternate screen + -b: by "nu-complete tmux buffers" # Store in this named buffer + -C # Escape non-printable characters as octal + -E: text # End line (`-` for the end of visible content) + -e # Include text and background attribute escapes + -J # Join wrapped lines and keep trailing spaces + -M # Capture from the copy-mode screen + -N # Preserve trailing spaces at line ends + -P # Capture only an incomplete escape sequence + -p # Print to stdout instead of a buffer + -q # Quiet: no error if the alternate screen is absent + -S: text # Start line (negative is history, `-` for start) + -T # Ignore trailing positions without characters + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane +] where { + at-most-one [-p -b] +} + +export complete [tmux display-popup] [ + -B # Do not draw a border + -b: words [single rounded double heavy simple padded none] # Border line style + -C # Close any popup on the client + -c: by "nu-complete tmux clients" # Target client + -d: dir cwd # Start directory + -E # Close the popup when the command exits (-EE: on success) + -e: env-assign # Set an environment variable (VAR=value) + -h: tmux.size # Popup height (lines or N%) + -k # Allow any key to dismiss the popup + -N # Do not use the current colours + -S: text # Border style + -s: text # Popup style + -T: text # Popup title + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + -w: tmux.size # Popup width (cells or N%) + -x: text # Horizontal position (number, C, R, P, M, W) + -y: text # Vertical position (number, C, P, M, S) + ...command: command # Shell command to run in the popup +] where { + at-most-one [-B -b] +} + +export complete [tmux display-message] [ + -a # List all format variables and values + -C # Do not freeze panes while the message shows + -c: by "nu-complete tmux clients" # Target client + -d: text # Display time in milliseconds + -I # Forward stdin to the target pane + -l # Print the message literally (no format expansion) + -N # Ignore key presses; close only after the delay + -p # Print to stdout instead of the status line + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + -v # Verbose: print format parsing details + message?: text # Message or format, e.g. '#{pane_current_path}' +] + +# ----------------------------------------------------------------- options and keys + +export complete [tmux set-option] [ + -a # Append to a string or array option + -F # Expand formats in the value + -g # Set the global option + -o # Do not overwrite an option that is already set + -p # Pane option + -q # Quiet: no error for unknown or ambiguous options + -s # Server option + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target session, window or pane + -U # Unset a window option and its panes' options + -u # Unset the option + -w # Window option + option: by "nu-complete tmux options" # Option name + value?: text # New value +] where { + at-most-one [-s -w -p] + at-most-one [-a -u -U] +} + +export complete [tmux set-window-option] [ + -a # Append to a string or array option + -F # Expand formats in the value + -g # Set the global option + -o # Do not overwrite an option that is already set + -q # Quiet: no error for unknown or ambiguous options + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window + -u # Unset the option + option: by "nu-complete tmux options" # Option name + value?: text # New value +] where { + at-most-one [-a -u] +} + +export complete [tmux show-options] [ + -A # Include options inherited from a parent set + -g # Show global options + -H # Include hooks + -p # Pane options + -q # Quiet: no error for unknown options + -s # Server options + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target session, window or pane + -v # Show only the value + -w # Window options + option?: by "nu-complete tmux options" # Show only this option +] where { + at-most-one [-s -w -p] +} + +export complete [tmux bind-key] [ + -N: text # Note shown by list-keys -N + -n # Bind in the root table (no prefix; alias for -T root) + -r # The key may repeat + -T: by "nu-complete tmux key-tables" # Key table + key: text # Key, e.g. C-a, M-Left, F1 + command?: by "nu-complete tmux commands" # tmux command to run + ...arguments: text # Arguments to the command +] where { + at-most-one [-n -T] +} + +export complete [tmux unbind-key] [ + -a # Remove all key bindings (in the table) + -n # Root table (alias for -T root) + -q # Quiet: no error for missing bindings + -T: by "nu-complete tmux key-tables" # Key table + key?: text # Key to unbind +] where { + at-most-one [-n -T] +} + +export complete [tmux list-keys] [ + -1 # List only the first matching key + -a # With -N, include keys without notes + -N # List only keys with notes + -P: text # Prefix string for -N output + -T: by "nu-complete tmux key-tables" # Key table + key?: text # Only this key +] + +export complete [tmux source-file] [ + -F # Expand formats in path names + -n # Parse only; do not run commands + -q # Quiet: no error for missing files + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target for format expansion + -v # Show parsed commands + ...paths: path # Configuration files (globs allowed) +] + +# --------------------------------------------------------------------------- buffers + +export complete [tmux show-buffer] [ + -b: by "nu-complete tmux buffers" # Buffer name +] + +export complete [tmux paste-buffer] [ + -b: by "nu-complete tmux buffers" # Buffer name + -d # Delete the buffer after pasting + -p # Use bracketed paste if the application asked + -r # Do not replace LF with CR + -S # Do not pass control characters (except \n) + -s: text # Separator replacing line endings + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane +] where { + at-most-one [-r -s] +} + +export complete [tmux list-buffers] [ + -F: text # Output format + -f: text # Filter format +] + +export complete [tmux delete-buffer] [ + -b: by "nu-complete tmux buffers" # Buffer name +] + +export complete [tmux save-buffer] [ + -a # Append to the file instead of overwriting + -b: by "nu-complete tmux buffers" # Buffer name + path: path # Destination file (`-` for stdout) +] + +export complete [tmux load-buffer] [ + -b: text # Buffer name + -t: by "nu-complete tmux clients" # Target client (with -w) + -w # Also send to the clipboard via OSC 52 + path: path # Source file (`-` for stdin) +] + +# ---------------------------------------------------------------------------- server + +export complete [tmux kill-server] [] + +export complete [tmux start-server] [] + +export complete [tmux list-clients] [ + -F: text # Output format + -f: text # Filter format + -t: tmux.target with { root.session: by "nu-complete tmux sessions" } # Only clients attached to this session +] + +export complete [tmux run-shell] [ + -b # Run in the background + -C # Run a tmux command instead of a shell command + -c: dir cwd # Start directory + -d: text # Delay in seconds before running + -E # Redirect stderr to stdout + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Pane for output + ...command: command # Shell command to run +] + +# ------------------------------------------------------------------- command aliases +# tmux's built-in short aliases share the full command's slots and invariants. + +export complete [tmux attach] [ + -c: dir cwd # Set the session working directory + -d # Detach other clients attached to the session + -E # Do not apply update-environment + -f: words [active-pane ignore-size no-detach-on-destroy no-output pause-after read-only wait-exit] # Client flags (comma-separated) + -r # Read-only client (alias for -f read-only,ignore-size) + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target session + -x # Detach other clients and send SIGHUP to their parent +] where { + at-most-one [-d -x] +} + +export complete [tmux a] [ + -c: dir cwd # Set the session working directory + -d # Detach other clients attached to the session + -E # Do not apply update-environment + -f: words [active-pane ignore-size no-detach-on-destroy no-output pause-after read-only wait-exit] # Client flags (comma-separated) + -r # Read-only client (alias for -f read-only,ignore-size) + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target session + -x # Detach other clients and send SIGHUP to their parent +] where { + at-most-one [-d -x] +} + +export complete [tmux new] [ + -A # Attach to the session if it already exists + -c: dir cwd # Start directory + -D # With -A, detach other clients (like attach -d) + -d # Do not attach to the new session + -E # Do not apply update-environment + -e: env-assign # Set an environment variable (VAR=value) + -F: text # Format for -P output + -f: words [active-pane ignore-size no-detach-on-destroy no-output pause-after read-only wait-exit] # Client flags + -n: text # Name of the initial window + -P # Print information about the new session + -s: text # Session name + -t: tmux.target with { root.session: by "nu-complete tmux sessions" } # Group with this target session + -X # With -A, detach and SIGHUP other clients (like attach -x) + -x: tmux.size # Width (detached sessions) + -y: tmux.size # Height (detached sessions) + ...command: command # Shell command for the initial window +] where { + requires -D -A + requires -X -A + at-most-one [-D -X] +} + +export complete [tmux rename] [ + -t: tmux.target with { root.session: by "nu-complete tmux sessions" } # Target session + new_name: text # New session name +] + +export complete [tmux ls] [ + -F: text # Output format + -f: text # Filter format (only sessions where it is true) +] + +export complete [tmux has] [ + -t: tmux.target with { root.session: by "nu-complete tmux sessions" } # Target session +] + +export complete [tmux switchc] [ + -c: by "nu-complete tmux clients" # Target client + -E # Do not apply update-environment + -l # Switch to the last session + -n # Switch to the next session + -p # Switch to the previous session + -r # Toggle read-only and ignore-size + -T: by "nu-complete tmux key-tables" # Set the client key table + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target session/window/pane + -Z # Keep the window zoomed +] where { + at-most-one [-l -n -p -t] +} + +export complete [tmux detach] [ + -a # Detach all clients but the target client + -E: text # Run this shell command to replace the client + -P # Send SIGHUP to the client's parent process + -s: tmux.target with { root.session: by "nu-complete tmux sessions" } # Detach all clients on this session + -t: by "nu-complete tmux clients" # Target client +] where { + at-most-one [-s -t] +} + +export complete [tmux neww] [ + -a # Insert after the target window + -b # Insert before the target window + -c: dir cwd # Start directory + -d # Do not make the new window current + -e: env-assign # Set an environment variable (VAR=value) + -F: text # Format for -P output + -k # Destroy an existing window at the target index + -n: text # Window name + -P # Print information about the new window + -S # Select the window if one with this name exists + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window + ...command: command # Shell command to run +] where { + at-most-one [-a -b] +} + +export complete [tmux killw] [ + -a # Kill all windows except the target + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window +] + +export complete [tmux renamew] [ + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window + new_name: text # New window name +] + +export complete [tmux selectw] [ + -l # Select the last (previously selected) window + -n # Select the next window + -p # Select the previous window + -T # Toggle to the last window if already selected + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window +] where { + at-most-one [-l -n -p -t] +} + +export complete [tmux lsw] [ + -a # List all windows on the server + -F: text # Output format + -f: text # Filter format + -t: tmux.target with { root.session: by "nu-complete tmux sessions" } # Target session +] where { + at-most-one [-a -t] +} + +export complete [tmux selectl] [ + -E # Spread the current pane and neighbours evenly + -n # Next layout (like next-layout) + -o # Apply the previous layout + -p # Previous layout (like previous-layout) + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + layout?: words [even-horizontal even-vertical main-horizontal main-horizontal-mirrored main-vertical main-vertical-mirrored tiled] # Layout name or custom layout string +] where { + at-most-one [-n -o -p -E] +} + +export complete [tmux splitw] [ + -b # Create the pane left of / above the target + -c: dir cwd # Start directory + -d # Do not make the new pane active + -e: env-assign # Set an environment variable (VAR=value) + -F: text # Format for -P output + -f # Span the full window height (-h) or width (-v) + -h # Horizontal split (side by side) + -I # Create an empty pane and forward stdin to it + -l: tmux.size # Size of the new pane (lines/cells or N%) + -P # Print information about the new pane + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + -v # Vertical split (one above the other, default) + -Z # Zoom the new pane + ...command: command # Shell command to run +] where { + at-most-one [-h -v] +} + +export complete [tmux selectp] [ + -D # Select the pane below + -d # Disable input to the pane + -e # Enable input to the pane + -L # Select the pane to the left + -l # Select the last (previously selected) pane + -M # Clear the marked pane + -m # Set the marked pane + -R # Select the pane to the right + -T: text # Set the pane title + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + -U # Select the pane above + -Z # Keep the window zoomed +] where { + at-most-one [-U -D -L -R -l] + at-most-one [-d -e] + at-most-one [-m -M] +} + +export complete [tmux resizep] [ + -D # Resize downward + -L # Resize to the left + -M # Begin mouse resizing + -R # Resize to the right + -T # Trim lines below the cursor moved into history + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + -U # Resize upward + -x: tmux.size # Absolute width (cells or N%) + -y: tmux.size # Absolute height (lines or N%) + -Z # Toggle zoom + adjustment?: text # Number of cells/lines to resize by (default 1) +] where { + at-most-one [-U -D -L -R] + at-most-one [-Z -M] +} + +export complete [tmux killp] [ + -a # Kill all panes except the target + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane +] + +export complete [tmux swapp] [ + -D # Swap with the next pane + -d # Do not change the active pane + -s: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Source pane + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Destination pane + -U # Swap with the previous pane + -Z # Keep the window zoomed +] where { + at-most-one [-U -D -s] +} + +export complete [tmux joinp] [ + -b # Join left of / above the target + -d # Do not make the joined pane active + -f # Span the full window height or width + -h # Join side by side + -l: tmux.size # Size of the joined pane (lines/cells or N%) + -s: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Source pane + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Destination pane + -v # Join one above the other +] where { + at-most-one [-h -v] +} + +export complete [tmux breakp] [ + -a # Place the new window after the target window + -b # Place the new window before the target window + -d # Do not make the new window current + -F: text # Format for -P output + -n: text # Name of the new window + -P # Print information about the new window + -s: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Source pane + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Destination window +] where { + at-most-one [-a -b] +} + +export complete [tmux lsp] [ + -a # List all panes on the server + -F: text # Output format + -f: text # Filter format + -s # List all panes in the target session + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window (or session with -s) +] where { + at-most-one [-a -s] + at-most-one [-a -t] +} + +export complete [tmux send] [ + -F # Expand formats in arguments + -H # Keys are hexadecimal character codes + -K # Treat keys as key presses from a client + -l # Send keys literally (no key-name lookup) + -M # Pass through a mouse event + -N: text # Repeat count + -R # Reset the terminal state + -X # Send a copy-mode command + -c: by "nu-complete tmux clients" # Target client (with -K) + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + ...keys: words [Enter Escape Tab BSpace Space Up Down Left Right Home End PageUp PageDown IC DC C-c C-d C-l C-z cancel copy-selection copy-selection-and-cancel begin-selection] # Keys or (with -X) copy-mode commands +] where { + at-most-one [-l -H] + requires -c -K +} + +export complete [tmux capturep] [ + -a # Use the alternate screen + -b: by "nu-complete tmux buffers" # Store in this named buffer + -C # Escape non-printable characters as octal + -E: text # End line (`-` for the end of visible content) + -e # Include text and background attribute escapes + -J # Join wrapped lines and keep trailing spaces + -M # Capture from the copy-mode screen + -N # Preserve trailing spaces at line ends + -P # Capture only an incomplete escape sequence + -p # Print to stdout instead of a buffer + -q # Quiet: no error if the alternate screen is absent + -S: text # Start line (negative is history, `-` for start) + -T # Ignore trailing positions without characters + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane +] where { + at-most-one [-p -b] +} + +export complete [tmux popup] [ + -B # Do not draw a border + -b: words [single rounded double heavy simple padded none] # Border line style + -C # Close any popup on the client + -c: by "nu-complete tmux clients" # Target client + -d: dir cwd # Start directory + -E # Close the popup when the command exits (-EE: on success) + -e: env-assign # Set an environment variable (VAR=value) + -h: tmux.size # Popup height (lines or N%) + -k # Allow any key to dismiss the popup + -N # Do not use the current colours + -S: text # Border style + -s: text # Popup style + -T: text # Popup title + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + -w: tmux.size # Popup width (cells or N%) + -x: text # Horizontal position (number, C, R, P, M, W) + -y: text # Vertical position (number, C, P, M, S) + ...command: command # Shell command to run in the popup +] where { + at-most-one [-B -b] +} + +export complete [tmux display] [ + -a # List all format variables and values + -C # Do not freeze panes while the message shows + -c: by "nu-complete tmux clients" # Target client + -d: text # Display time in milliseconds + -I # Forward stdin to the target pane + -l # Print the message literally (no format expansion) + -N # Ignore key presses; close only after the delay + -p # Print to stdout instead of the status line + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane + -v # Verbose: print format parsing details + message?: text # Message or format, e.g. '#{pane_current_path}' +] + +export complete [tmux set] [ + -a # Append to a string or array option + -F # Expand formats in the value + -g # Set the global option + -o # Do not overwrite an option that is already set + -p # Pane option + -q # Quiet: no error for unknown or ambiguous options + -s # Server option + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target session, window or pane + -U # Unset a window option and its panes' options + -u # Unset the option + -w # Window option + option: by "nu-complete tmux options" # Option name + value?: text # New value +] where { + at-most-one [-s -w -p] + at-most-one [-a -u -U] +} + +export complete [tmux setw] [ + -a # Append to a string or array option + -F # Expand formats in the value + -g # Set the global option + -o # Do not overwrite an option that is already set + -q # Quiet: no error for unknown or ambiguous options + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" } # Target window + -u # Unset the option + option: by "nu-complete tmux options" # Option name + value?: text # New value +] where { + at-most-one [-a -u] +} + +export complete [tmux show] [ + -A # Include options inherited from a parent set + -g # Show global options + -H # Include hooks + -p # Pane options + -q # Quiet: no error for unknown options + -s # Server options + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target session, window or pane + -v # Show only the value + -w # Window options + option?: by "nu-complete tmux options" # Show only this option +] where { + at-most-one [-s -w -p] +} + +export complete [tmux bind] [ + -N: text # Note shown by list-keys -N + -n # Bind in the root table (no prefix; alias for -T root) + -r # The key may repeat + -T: by "nu-complete tmux key-tables" # Key table + key: text # Key, e.g. C-a, M-Left, F1 + command?: by "nu-complete tmux commands" # tmux command to run + ...arguments: text # Arguments to the command +] where { + at-most-one [-n -T] +} + +export complete [tmux unbind] [ + -a # Remove all key bindings (in the table) + -n # Root table (alias for -T root) + -q # Quiet: no error for missing bindings + -T: by "nu-complete tmux key-tables" # Key table + key?: text # Key to unbind +] where { + at-most-one [-n -T] +} + +export complete [tmux lsk] [ + -1 # List only the first matching key + -a # With -N, include keys without notes + -N # List only keys with notes + -P: text # Prefix string for -N output + -T: by "nu-complete tmux key-tables" # Key table + key?: text # Only this key +] + +export complete [tmux source] [ + -F # Expand formats in path names + -n # Parse only; do not run commands + -q # Quiet: no error for missing files + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target for format expansion + -v # Show parsed commands + ...paths: path # Configuration files (globs allowed) +] + +export complete [tmux showb] [ + -b: by "nu-complete tmux buffers" # Buffer name +] + +export complete [tmux pasteb] [ + -b: by "nu-complete tmux buffers" # Buffer name + -d # Delete the buffer after pasting + -p # Use bracketed paste if the application asked + -r # Do not replace LF with CR + -S # Do not pass control characters (except \n) + -s: text # Separator replacing line endings + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Target pane +] where { + at-most-one [-r -s] +} + +export complete [tmux lsb] [ + -F: text # Output format + -f: text # Filter format +] + +export complete [tmux deleteb] [ + -b: by "nu-complete tmux buffers" # Buffer name +] + +export complete [tmux saveb] [ + -a # Append to the file instead of overwriting + -b: by "nu-complete tmux buffers" # Buffer name + path: path # Destination file (`-` for stdout) +] + +export complete [tmux loadb] [ + -b: text # Buffer name + -t: by "nu-complete tmux clients" # Target client (with -w) + -w # Also send to the clipboard via OSC 52 + path: path # Source file (`-` for stdin) +] + +export complete [tmux start] [] + +export complete [tmux lsc] [ + -F: text # Output format + -f: text # Filter format + -t: tmux.target with { root.session: by "nu-complete tmux sessions" } # Only clients attached to this session +] + +export complete [tmux run] [ + -b # Run in the background + -C # Run a tmux command instead of a shell command + -c: dir cwd # Start directory + -d: text # Delay in seconds before running + -E # Redirect stderr to stdout + -t: tmux.target with { root.session: by "nu-complete tmux sessions" root.window: by "nu-complete tmux windows" root.pane: by "nu-complete tmux panes" } # Pane for output + ...command: command # Shell command to run +] diff --git a/custom-completions/toipe/toipe-completions.nu b/custom-completions/toipe/toipe-completions.nu index 90361ccde..98dae3e5b 100644 --- a/custom-completions/toipe/toipe-completions.nu +++ b/custom-completions/toipe/toipe-completions.nu @@ -1,20 +1,13 @@ -def "nu-complete toipe wordlists" [] {[ - top250 - top500 - top1000 - top2500 - top5000 - top10000 - top25000 - commonly-misspelled - os -]} +# toipe 0.4.1: a trusty terminal typing tester. -# external completion for toipe 0.4.1 -export extern toipe [ - --file (-f): path # Path to custom word list file. Providing this will override `-w`/`--wordlist`. - --help (-h) # Print help information - --num-words (-n): int # Number of words to show on each test [default: 30] - --version (-V) # Print version information - --wordlist (-w): string@"nu-complete toipe wordlists" # Word list name [default: top250] -] +export complete [toipe] [ + --file(-f): path # Custom word list file (overrides --wordlist) + --help(-h) # Print help + --num-words(-n): text # Words per test [default: 30] + --punctuation(-p) # Include punctuation + --version(-V) # Print version + --wordlist(-w): words [top250 top500 top1000 top2500 top5000 top10000 top25000 commonly-misspelled os] # Built-in word list [default: top250] +] where { + excludes --file --wordlist + terminal [--help --version] +} diff --git a/custom-completions/ttyper/ttyper-completions.nu b/custom-completions/ttyper/ttyper-completions.nu index 4cb5154f3..855bff189 100644 --- a/custom-completions/ttyper/ttyper-completions.nu +++ b/custom-completions/ttyper/ttyper-completions.nu @@ -1,18 +1,24 @@ +# ttyper: a terminal typing test. # author: David Telenko -def "nu-complete languages" [] { - ttyper --list-languages | lines +@non-destructive +export def "nu-complete ttyper languages" [] { + try { ^ttyper --list-languages | lines | str trim | where $it != '' } catch { [] } } -export extern "ttyper" [ - --debug(-d) - --help(-h) # Prints help information - --list-languages # List installed languages - --no-backtrack # Disable backtracking to completed words - --sudden-death # Enable sudden death mode to restart on first error - --version(-V) # Prints version information - --config(-c): path # Use config file - --language(-l): string@"nu-complete languages" # Specify test language - --language-file # Specify test language in file - --words(-w): int # Specify word count [default: 50] -] +export complete [ttyper] [ + --debug(-d) # Print debug information + --help(-h) # Print help + --list-languages # List installed languages + --no-backtrack # Disable backtracking to completed words + --sudden-death # Restart on the first error + --version(-V) # Print version + --config(-c): path # Use this config file + --language(-l): by "nu-complete ttyper languages" # Test language + --language-file: path # Read the test language from this file + --words(-w): text # Word count [default: 50] + contents?: path # File to type instead of a word list +] where { + excludes --language --language-file + terminal [--help --version --list-languages] +} diff --git a/custom-completions/typst/typst-completions.nu b/custom-completions/typst/typst-completions.nu index de6d80247..3463f2e87 100755 --- a/custom-completions/typst/typst-completions.nu +++ b/custom-completions/typst/typst-completions.nu @@ -1,65 +1,227 @@ -# A typst custom completion module. +# Declarative completions for Typst, checked against `typst --help` 0.15.x. -def verbosity [] { - [ - {value:0, description:"none"} - {value:1, description:"warning & error"} - {value:2, description:"info"} - {value:3, description:"debug"} - {value:4, description:"trace"} - ] +# Templates available offline: packages in the local package dir and the download cache. +@non-destructive +export def "nu-complete typst templates" [] { + try { + let dirs = match $nu.os-info.name { + "macos" => ["~/Library/Application Support/typst/packages" "~/Library/Caches/typst/packages"] + "windows" => [($env.APPDATA | path join typst packages) ($env.LOCALAPPDATA | path join typst packages)] + _ => [($env.XDG_DATA_HOME? | default "~/.local/share" | path join typst packages) ($env.XDG_CACHE_HOME? | default "~/.cache" | path join typst packages)] + } + let dirs = $dirs | append ($env.TYPST_PACKAGE_PATH? | default []) | append ($env.TYPST_PACKAGE_CACHE_PATH? | default []) + $dirs | each {|d| $d | path expand } + | where {|d| $d | path exists } + | each {|d| glob ($d | path join "*" "*" "*") --no-file } + | flatten + | each {|p| let parts = ($p | path split | last 3); {value: $"@($parts.0)/($parts.1):($parts.2)", description: "template package"} } + | uniq-by value + } catch { [] } } -def commands [] { - [ - "compile" - "watch" - "fonts" - "help" - ] +# Typst +export complete [typst] [ + --color: words [auto always never] # Whether to use color + --cert: path # Custom CA certificate for network requests [env: TYPST_CERT] + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help --version] } -# typst creates PDF files from .typ files -export extern "typst" [ - command?: string@commands - --font-path: path # Add additional directories to search for fonts [env: TYPST_FONT_PATHS=] - --root: path # Configure the root for absolute paths [env: TYPST_ROOT=] - --verbosity(-v): number@"verbosity" # Sets the level of verbosity: 0 = none, 1 = warning & error, 2 = info, 3 = debug, 4 = trace - --help(-h) # Print help - --version(-V) # Print version -] +# Compiles an input file into a supported output format +export complete [typst compile] [ + --format(-f): words [pdf png svg html bundle] # Output format (inferred from the output extension by default) + --root: dir cwd # Project root for absolute paths [env: TYPST_ROOT] + --input: text # Add a string key-value pair visible through `sys.inputs` (key=value) + --font-path: dir # Additional directories to search for fonts [env: TYPST_FONT_PATHS] + --ignore-system-fonts # Ignore system fonts + --ignore-embedded-fonts # Ignore fonts embedded into Typst + --package-path: dir # Custom path to local packages [env: TYPST_PACKAGE_PATH] + --package-cache-path: dir # Custom path to the package cache [env: TYPST_PACKAGE_CACHE_PATH] + --creation-timestamp: text # Document creation date as a UNIX timestamp [env: SOURCE_DATE_EPOCH] + --jobs(-j): text # Number of parallel jobs spawned during compilation + --features: words [html bundle a11y-extras] # Enable in-development features [env: TYPST_FEATURES] + --diagnostic-format: words [human short] # Format to emit diagnostics in + --help(-h) # Print help + --pages: text # Pages to export, e.g. `2,3-6,8-` + --pdf-standard: words [1.4 1.5 1.6 1.7 2.0 a-1b a-1a a-2b a-2u a-2a a-3b a-3u a-3a a-4 a-4f a-4e ua-1] # PDF standards to enforce conformance with + --no-pdf-tags # Do not write tags into the PDF + --ppi: text # Pixels per inch for PNG export (default 144) + --deps: path # File to write a list of dependencies to + --deps-format: words [json: "JSON, failing for non-Unicode paths" zero: "NULL-separated" make: "Make format"] # Format of the dependency list + --pretty # Pretty-print the HTML output + --open?: command # Open the output file with the default viewer, or this one + --timings?: path # Produce performance timings (JSON trace) + input: path # Path to the input file (`-` for stdin) + output?: path # Output path (`-` for stdout; may contain {p}, {0p}, {t} for multi-page images) +] where { + excludes --ignore-system-fonts --font-path + terminal [--help] +} -# Compiles the input file into a PDF file [aliases: c] -export extern "typst compile" [ - input: path # Path to the input file - output?: path # Path to the output file - --open # Opens the output file after compilation using the default PDF viewer - --flamegraph # Produces a flamegraph of the compilation process and saves it to the given file or to `flamegraph.svg` in the current working directory - --help(-h) # Print help -] +# Alias of `typst compile` +export complete [typst c] [ + --format(-f): words [pdf png svg html bundle] # Output format (inferred from the output extension by default) + --root: dir cwd # Project root for absolute paths [env: TYPST_ROOT] + --input: text # Add a string key-value pair visible through `sys.inputs` (key=value) + --font-path: dir # Additional directories to search for fonts [env: TYPST_FONT_PATHS] + --ignore-system-fonts # Ignore system fonts + --ignore-embedded-fonts # Ignore fonts embedded into Typst + --package-path: dir # Custom path to local packages [env: TYPST_PACKAGE_PATH] + --package-cache-path: dir # Custom path to the package cache [env: TYPST_PACKAGE_CACHE_PATH] + --creation-timestamp: text # Document creation date as a UNIX timestamp [env: SOURCE_DATE_EPOCH] + --jobs(-j): text # Number of parallel jobs spawned during compilation + --features: words [html bundle a11y-extras] # Enable in-development features [env: TYPST_FEATURES] + --diagnostic-format: words [human short] # Format to emit diagnostics in + --help(-h) # Print help + --pages: text # Pages to export, e.g. `2,3-6,8-` + --pdf-standard: words [1.4 1.5 1.6 1.7 2.0 a-1b a-1a a-2b a-2u a-2a a-3b a-3u a-3a a-4 a-4f a-4e ua-1] # PDF standards to enforce conformance with + --no-pdf-tags # Do not write tags into the PDF + --ppi: text # Pixels per inch for PNG export (default 144) + --deps: path # File to write a list of dependencies to + --deps-format: words [json: "JSON, failing for non-Unicode paths" zero: "NULL-separated" make: "Make format"] # Format of the dependency list + --pretty # Pretty-print the HTML output + --open?: command # Open the output file with the default viewer, or this one + --timings?: path # Produce performance timings (JSON trace) + input: path # Path to the input file (`-` for stdin) + output?: path # Output path (`-` for stdout; may contain {p}, {0p}, {t} for multi-page images) +] where { + excludes --ignore-system-fonts --font-path + terminal [--help] +} -# Watches the input file and recompiles on changes [aliases: w] -export extern "typst watch" [ - input: path # Path to the input file - output?: path # Path to the output file - --open # Opens the output file after compilation using the default PDF viewer - --flamegraph # Produces a flamegraph of the compilation process and saves it to the given file or to `flamegraph.svg` in the current working directory - --help(-h) # Print help -] +# Watches an input file and recompiles on changes +export complete [typst watch] [ + --format(-f): words [pdf png svg html bundle] # Output format (inferred from the output extension by default) + --root: dir cwd # Project root for absolute paths [env: TYPST_ROOT] + --input: text # Add a string key-value pair visible through `sys.inputs` (key=value) + --font-path: dir # Additional directories to search for fonts [env: TYPST_FONT_PATHS] + --ignore-system-fonts # Ignore system fonts + --ignore-embedded-fonts # Ignore fonts embedded into Typst + --package-path: dir # Custom path to local packages [env: TYPST_PACKAGE_PATH] + --package-cache-path: dir # Custom path to the package cache [env: TYPST_PACKAGE_CACHE_PATH] + --creation-timestamp: text # Document creation date as a UNIX timestamp [env: SOURCE_DATE_EPOCH] + --jobs(-j): text # Number of parallel jobs spawned during compilation + --features: words [html bundle a11y-extras] # Enable in-development features [env: TYPST_FEATURES] + --diagnostic-format: words [human short] # Format to emit diagnostics in + --help(-h) # Print help + --pages: text # Pages to export, e.g. `2,3-6,8-` + --pdf-standard: words [1.4 1.5 1.6 1.7 2.0 a-1b a-1a a-2b a-2u a-2a a-3b a-3u a-3a a-4 a-4f a-4e ua-1] # PDF standards to enforce conformance with + --no-pdf-tags # Do not write tags into the PDF + --ppi: text # Pixels per inch for PNG export (default 144) + --deps: path # File to write a list of dependencies to + --deps-format: words [json: "JSON, failing for non-Unicode paths" zero: "NULL-separated" make: "Make format"] # Format of the dependency list + --pretty # Pretty-print the HTML output + --open?: command # Open the output file with the default viewer, or this one + --timings?: path # Produce performance timings (JSON trace) + --no-serve # Disable the built-in HTTP server for HTML export + --no-reload # Disable live reload in the browser + --port: text # Port for the HTTP server + input: path # Path to the input file (`-` for stdin) + output?: path # Output path (`-` for stdout; may contain {p}, {0p}, {t} for multi-page images) +] where { + excludes --ignore-system-fonts --font-path + terminal [--help] +} -# List all discovered fonts in system and custom font paths -export extern "typst fonts" [ - --variants # Also list style variants of each font family - --help(-h) # Print help -] +# Alias of `typst watch` +export complete [typst w] [ + --format(-f): words [pdf png svg html bundle] # Output format (inferred from the output extension by default) + --root: dir cwd # Project root for absolute paths [env: TYPST_ROOT] + --input: text # Add a string key-value pair visible through `sys.inputs` (key=value) + --font-path: dir # Additional directories to search for fonts [env: TYPST_FONT_PATHS] + --ignore-system-fonts # Ignore system fonts + --ignore-embedded-fonts # Ignore fonts embedded into Typst + --package-path: dir # Custom path to local packages [env: TYPST_PACKAGE_PATH] + --package-cache-path: dir # Custom path to the package cache [env: TYPST_PACKAGE_CACHE_PATH] + --creation-timestamp: text # Document creation date as a UNIX timestamp [env: SOURCE_DATE_EPOCH] + --jobs(-j): text # Number of parallel jobs spawned during compilation + --features: words [html bundle a11y-extras] # Enable in-development features [env: TYPST_FEATURES] + --diagnostic-format: words [human short] # Format to emit diagnostics in + --help(-h) # Print help + --pages: text # Pages to export, e.g. `2,3-6,8-` + --pdf-standard: words [1.4 1.5 1.6 1.7 2.0 a-1b a-1a a-2b a-2u a-2a a-3b a-3u a-3a a-4 a-4f a-4e ua-1] # PDF standards to enforce conformance with + --no-pdf-tags # Do not write tags into the PDF + --ppi: text # Pixels per inch for PNG export (default 144) + --deps: path # File to write a list of dependencies to + --deps-format: words [json: "JSON, failing for non-Unicode paths" zero: "NULL-separated" make: "Make format"] # Format of the dependency list + --pretty # Pretty-print the HTML output + --open?: command # Open the output file with the default viewer, or this one + --timings?: path # Produce performance timings (JSON trace) + --no-serve # Disable the built-in HTTP server for HTML export + --no-reload # Disable live reload in the browser + --port: text # Port for the HTTP server + input: path # Path to the input file (`-` for stdin) + output?: path # Output path (`-` for stdout; may contain {p}, {0p}, {t} for multi-page images) +] where { + excludes --ignore-system-fonts --font-path + terminal [--help] +} -# Print this message or the help of the given subcommand(s) -export extern "typst help" [ - command?: string@commands # Command to print help for -] +# Initializes a new project from a template +export complete [typst init] [ + --package-path: dir # Custom path to local packages [env: TYPST_PACKAGE_PATH] + --package-cache-path: dir # Custom path to the package cache [env: TYPST_PACKAGE_CACHE_PATH] + --help(-h) # Print help + template: by "nu-complete typst templates" # Template to use, e.g. `@preview/charged-ieee` + dir?: dir # Project directory (defaults to the template name) +] where { + terminal [--help] +} + +# Evaluates a piece of Typst code, optionally in the context of a document +export complete [typst eval] [ + --in: path # File to evaluate the expression in the context of + --target: words [paged html] # Target to compile for + --format: words [json yaml] # Output format of the result + --pretty # Pretty-print the serialized output + --root: dir cwd # Project root for absolute paths [env: TYPST_ROOT] + --input: text # Add a string key-value pair visible through `sys.inputs` (key=value) + --font-path: dir # Additional directories to search for fonts [env: TYPST_FONT_PATHS] + --ignore-system-fonts # Ignore system fonts + --ignore-embedded-fonts # Ignore fonts embedded into Typst + --package-path: dir # Custom path to local packages [env: TYPST_PACKAGE_PATH] + --package-cache-path: dir # Custom path to the package cache [env: TYPST_PACKAGE_CACHE_PATH] + --creation-timestamp: text # Document creation date as a UNIX timestamp [env: SOURCE_DATE_EPOCH] + --jobs(-j): text # Number of parallel jobs spawned during compilation + --features: words [html bundle a11y-extras] # Enable in-development features [env: TYPST_FEATURES] + --diagnostic-format: words [human short] # Format to emit diagnostics in + --help(-h) # Print help + expression: text # The Typst expression to evaluate +] where { + excludes --ignore-system-fonts --font-path + terminal [--help] +} + +# Lists all discovered fonts in system and custom font paths +export complete [typst fonts] [ + --font-path: dir # Additional directories to search for fonts [env: TYPST_FONT_PATHS] + --ignore-system-fonts # Ignore system fonts + --ignore-embedded-fonts # Ignore fonts embedded into Typst + --variants # Also list style variants of each font family + --help(-h) # Print help +] where { + terminal [--help] +} -# Command completion aliases. -alias "typst c" = typst compile -alias "typst w" = typst watch +# Generates shell completion scripts +export complete [typst completions] [ + --help(-h) # Print help + shell: words [bash elvish fish powershell zsh] # The shell to generate completions for +] where { + terminal [--help] +} +# Displays debugging information about Typst +export complete [typst info] [ + --format(-f): words [json yaml] # Output format (human-readable when omitted) + --help(-h) # Print help +] where { + terminal [--help] +} +# Print help for the given subcommand(s) +export complete [typst help] [ + command?: words [compile watch init eval fonts completions info help] # Subcommand to show help for +] diff --git a/custom-completions/uv/uv-completions.nu b/custom-completions/uv/uv-completions.nu index a7d14982b..b4bbd6dfe 100644 --- a/custom-completions/uv/uv-completions.nu +++ b/custom-completions/uv/uv-completions.nu @@ -1,72 +1,8 @@ -# nu-version: 0.115.0 -# uv-version: 0.12.5 - -# This script was created by dumping the output of `uv generate-shell-completion` and: -# - Add completer for some parameter values. -# - Reduce the duplication of original completers. - -module completions { +# Declarative completions for uv 0.12.5 (routes and flags from `uv generate-shell-completion`, +# with value completers added by hand). Load with `use uv-completions.nu *`. const PYPRJ = 'pyproject.toml' - # Split a string to list of args, taking quotes into account. - # Code is copied and modified from https://github.com/nushell/nushell/issues/14582#issuecomment-2542596272 - def args-split []: string -> list<string> { - # Define our states - const STATE_NORMAL = 0 - const STATE_IN_SINGLE_QUOTE = 1 - const STATE_IN_DOUBLE_QUOTE = 2 - const STATE_ESCAPE = 3 - const WHITESPACES = [" " "\t" "\n" "\r"] - - # Initialize variables - mut state = $STATE_NORMAL - mut current_token = "" - mut result: list<string> = [] - mut prev_state = $STATE_NORMAL - - # Process each character - for char in ($in | split chars) { - if $state == $STATE_ESCAPE { - # Handle escaped character - $current_token = $current_token + $char - $state = $prev_state - } else if $char == '\' { - # Enter escape state - $prev_state = $state - $state = $STATE_ESCAPE - } else if $state == $STATE_NORMAL { - if $char == "'" { - $state = $STATE_IN_SINGLE_QUOTE - } else if $char == '"' { - $state = $STATE_IN_DOUBLE_QUOTE - } else if ($char in $WHITESPACES) { - # Whitespace in normal state means token boundary - $result = $result | append $current_token - $current_token = "" - } else { - $current_token = $current_token + $char - } - } else if $state == $STATE_IN_SINGLE_QUOTE { - if $char == "'" { - $state = $STATE_NORMAL - } else { - $current_token = $current_token + $char - } - } else if $state == $STATE_IN_DOUBLE_QUOTE { - if $char == '"' { - $state = $STATE_NORMAL - } else { - $current_token = $current_token + $char - } - } - } - # Handle the last token - $result = $result | append $current_token - # Return the result - $result - } - def "nu-complete uv python_preference" [] { [ "only-managed" "managed" "system" "only-system" ] } @@ -140,20 +76,27 @@ module completions { } # Groups completer for subcommands - def "nu-complete uv groups" [] { - get-groups + @non-destructive + export def "nu-complete uv groups" [] { + try { + get-groups + } catch { [] } } # Groups completer for "uv add". # When there is no groups, we suggest a common name "dev". - def "nu-complete uv groups for add" [] { - get-groups | default ['dev'] + @non-destructive + export def "nu-complete uv groups for add" [] { + try { + let groups = (get-groups) + if ($groups | is-empty) { ['dev'] } else { $groups } + } catch { [] } } # From a list of packages and their version strings, get only package names. # Ref: https://packaging.python.org/en/latest/specifications/dependency-specifiers/#dependency-specifiers def parse-package-names []: list<string> -> list<string> { - $in | split column -n 2 -r '[\s\[@>=<;~!]' p v | get p + each {|spec| $spec | split column -n 2 -r '[\s\[@>=<;~!]' p v | get p.0 } } # Get packages from "project.dependencies" @@ -172,7 +115,7 @@ module completions { # Ref: https://packaging.python.org/en/latest/specifications/dependency-groups/#dependency-groups def get-dependency-group-packages [only_group?: string] { let file = (find-pyproject-file) - let dg = try { open $file | get -o dependency-groups } catch { [] } + let dg = try { open $file | get -o dependency-groups } catch { {} } | default {} # One group can include other groups, like: # dev = ['click', { include-group = "docs" }, { include-group = "linting" }, { include-group = "test" }] let handle_line = {|p| if (($p | describe) == 'string') { $p } else { $dg | get ($p.include-group) } } @@ -187,18 +130,40 @@ module completions { get-main-packages | append (get-optional-packages) | append (get-dependency-group-packages) } - export def "nu-complete uv packages" [context: string, position?:int] { - let preceding = $context | str substring ..$position - let prev_tokens = $preceding | str trim | args-split - # Check if "--group" is specified - let go = $prev_tokens | enumerate | find '--group' | get -o index.0 - let group = if ($go | is-not-empty) { $prev_tokens | get -o ($go + 1)} - if ($group | is-empty ) { - get-all-dependencies - } else { - get-dependency-group-packages $group - } + # Dependencies of the project, narrowed to the group given with `--group`. + @non-destructive + export def "nu-complete uv packages" [group?: string] { + try { + match $group { + null => { get-all-dependencies } + $group => { get-dependency-group-packages $group } + } + } catch { [] } + } + # Tools installed with `uv tool install`. + @non-destructive + export def "nu-complete uv tools" [] { + try { + ^uv tool list | lines | where $it !~ '^\s*-' and $it !~ '^\s*$' | parse '{value} {description}' + } catch { [] } } + + # Python installations known to uv (installed and downloadable). + @non-destructive + export def "nu-complete uv python versions" [] { + try { + ^uv python list --output-format json | from json | each {|p| {value: $p.version, description: ($p.path? | default 'available for download')} } | uniq-by value + } catch { [] } + } + + # Python installations managed by uv. + @non-destructive + export def "nu-complete uv python installed" [] { + try { + ^uv python list --only-installed --python-preference only-managed --output-format json | from json | get key + } catch { [] } + } + def "nu-complete uv auth helper protocol" [] { [ "bazel" ] } @@ -271,3912 +236,5020 @@ module completions { [ "auto" "human" "machine" ] } +export complete [uv] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + --version(-V) # Display the uv version +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help --version] +} - # An extremely fast Python package manager. - export extern uv [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - --version(-V) # Display the uv version - ] - - # Manage authentication - export extern "uv auth" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] - - # Login to a service - export extern "uv auth login" [ - --username(-u): string # The username to use for the service - --password: string # The password to use for the service - --token(-t): string # The token to use for the service - --keyring-provider: string@"nu-complete uv keyring_provider" # The keyring provider to use for storage of credentials - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - service: string # The domain or URL of the service to log into - ] - - # Logout of a service - export extern "uv auth logout" [ - --username(-u): string # The username to logout - --keyring-provider: string@"nu-complete uv keyring_provider" # The keyring provider to use for storage of credentials - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - service: string # The domain or URL of the service to logout from - ] +export complete [uv auth] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Show the authentication token for a service - export extern "uv auth token" [ - --username(-u): string # The username to lookup - --keyring-provider: string@"nu-complete uv keyring_provider" # The keyring provider to use for reading credentials - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - service: string # The domain or URL of the service to lookup - ] +export complete [uv auth login] [ + --username(-u): text # The username to use for the service + --password: text # The password to use for the service + --token(-t): text # The token to use for the service + --keyring-provider: words ["disabled" "subprocess"] # The keyring provider to use for storage of credentials + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + service: text # The domain or URL of the service to log into +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Show the path to the uv credentials directory - export extern "uv auth dir" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - service?: string # The domain or URL of the service to lookup - ] +export complete [uv auth logout] [ + --username(-u): text # The username to logout + --keyring-provider: words ["disabled" "subprocess"] # The keyring provider to use for storage of credentials + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + service: text # The domain or URL of the service to logout from +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Act as a credential helper for external tools - export extern "uv auth helper" [ - --protocol: string@"nu-complete uv auth helper protocol" # The credential helper protocol to use - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv auth token] [ + --username(-u): text # The username to lookup + --keyring-provider: words ["disabled" "subprocess"] # The keyring provider to use for reading credentials + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + service: text # The domain or URL of the service to lookup +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Retrieve credentials for a URI - export extern "uv auth helper get" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv auth dir] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + service?: text # The domain or URL of the service to lookup +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Run a command or script - export extern "uv run" [ - --extra: string # Include optional dependencies from the specified extra name - --all-extras # Include all optional dependencies - --no-extra: string # Exclude the specified optional dependencies, if `--all-extras` is supplied - --no-all-extras - --dev # Include the development dependency group [env: UV_DEV=] - --no-dev # Disable the development dependency group [env: UV_NO_DEV=] - --only-dev # Only include the development dependency group - --group: string@"nu-complete uv groups" # Include dependencies from the specified dependency group - --no-group: string # Disable the specified dependency group [env: `UV_NO_GROUP`=] - --no-default-groups # Ignore the default dependency groups - --only-group: string # Only include dependencies from the specified dependency group - --all-groups # Include dependencies from all dependency groups - --module(-m) # Run a Python module - --editable # Install any non-editable dependencies, including the project and any workspace members, as editable - --no-editable # Install any editable dependencies, including the project and any workspace members, as non-editable [env: UV_NO_EDITABLE=] - --no-editable-package: string # Install the specified editable packages as non-editable - --inexact # Do not remove extraneous packages present in the environment - --exact # Perform an exact sync, removing extraneous packages - --env-file: path # Load environment variables from a `.env` file - --no-env-file # Avoid reading environment variables from a `.env` file [env: UV_NO_ENV_FILE=] - --with(-w): string@"nu-complete uv packages" # Run with the given packages installed - --with-editable: path # Run with the given packages installed in editable mode - --with-requirements: path # Run with the packages listed in the given files - --isolated # Run the command in an isolated virtual environment [env: UV_ISOLATED=] - --active # Prefer the active virtual environment over the project's virtual environment - --no-active # Prefer project's virtual environment over an active environment - --no-sync # Avoid syncing the virtual environment [env: UV_NO_SYNC=] - --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] - --frozen # Run without updating the `uv.lock` file [env: UV_FROZEN=] - --script(-s) # Run the given path as a Python script - --gui-script # Run the given path as a Python GUI script - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string@"nu-complete uv packages" # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string@"nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --all-packages # Run the command with all workspace members installed - --package: string # Run the command in a specific package in the workspace - --no-project # Avoid discovering the project or workspace - --python(-p): string # The Python interpreter to use for the run environment. - --show-resolution # Whether to show resolver and installer output from any environment modifications [env: UV_SHOW_RESOLUTION=] - --max-recursion-depth: string # Number of times that `uv run` will allow recursive invocations - --python-platform: string@"nu-complete uv python_platform" # The platform for which requirements should be installed - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv auth helper] [ + --protocol: words ["bazel"] # The credential helper protocol to use + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Create a new project - export extern "uv init" [ - --name: string # The name of the project - --bare # Only create a `pyproject.toml` - --virtual # Create a virtual project, rather than a package - --package # Set up the project to be built as a Python package - --no-package # Do not set up the project to be built as a Python package - --app # Create a project for an application - --lib # Create a project for a library - --script # Create a script - --description: string # Set the project description - --no-description # Disable the description for the project - --vcs: string@"nu-complete uv init vcs" # Initialize a version control system for the project - --build-backend: string@"nu-complete uv init build_backend" # Initialize a build-backend of choice for the project - --backend # Invalid option name for build backend - --no-readme # Do not create a `README.md` file - --author-from: string@"nu-complete uv init author_from" # Fill in the `authors` field in the `pyproject.toml` - --no-pin-python # Do not create a `.python-version` file for the project - --pin-python # Create a `.python-version` file for the project - --no-workspace # Avoid discovering a workspace and create a standalone project - --python(-p): string # The Python interpreter to use to determine the minimum supported Python version. - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - path?: path # The path to use for the project/script - ] +export complete [uv auth helper get] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Add dependencies to the project - export extern "uv add" [ - --requirements(-r): path # Add the packages listed in the given files - --constraints(-c): path # Constrain versions using the given requirements files - --marker(-m): string # Apply this marker to all added packages - --dev # Add the requirements to the development dependency group [env: UV_DEV=] - --optional: string # Add the requirements to the package's optional dependencies for the specified extra - --group: string@"nu-complete uv groups for add" # Add the requirements to the specified dependency group - --editable # Add the requirements as editable - --no-editable # Don't add the requirements as editable [env: UV_NO_EDITABLE=] - --no-editable-package: string # Don't add the specified requirements as editable - --raw # Add a dependency as provided - --bounds: string@"nu-complete uv add bounds" # The kind of version specifier to use when adding dependencies - --rev: string # Commit to use when adding a dependency from Git - --tag: string # Tag to use when adding a dependency from Git - --branch: string # Branch to use when adding a dependency from Git - --lfs # Whether to use Git LFS when adding a dependency from Git - --extra: string # Extras to enable for the dependency - --no-sync # Avoid syncing the virtual environment [env: UV_NO_SYNC=] - --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] - --frozen # Add dependencies without re-locking the project [env: UV_FROZEN=] - --active # Prefer the active virtual environment over the project's virtual environment - --no-active # Prefer project's virtual environment over an active environment - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string@"nu-complete uv packages" # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string@"nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --package: string # Add the dependency to a specific package in the workspace - --script: path # Add the dependency to the specified Python script, rather than to a project - --python(-p): string # The Python interpreter to use for resolving and syncing. - --workspace # Add the dependency as a workspace member - --no-workspace # Don't add the dependency as a workspace member - --no-install-project # Do not install the current project [env: UV_NO_INSTALL_PROJECT=] - --only-install-project # Only install the current project - --no-install-workspace # Do not install any workspace members, including the current project [env: UV_NO_INSTALL_WORKSPACE=] - --only-install-workspace # Only install workspace members, including the current project - --no-install-local # Do not install local path dependencies [env: UV_NO_INSTALL_LOCAL=] - --only-install-local # Only install local path dependencies - --no-install-package: string # Do not install the given package(s) - --only-install-package: string # Only install the given package(s) - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...packages: string # The packages to add, as PEP 508 requirements (e.g., `ruff==0.5.0`) - ] +export complete [uv run] [ + --extra: text # Include optional dependencies from the specified extra name + --all-extras # Include all optional dependencies + --no-extra: text # Exclude the specified optional dependencies, if `--all-extras` is supplied + --no-all-extras + --dev # Include the development dependency group [env: UV_DEV=] + --no-dev # Disable the development dependency group [env: UV_NO_DEV=] + --only-dev # Only include the development dependency group + --group: by "nu-complete uv groups" # Include dependencies from the specified dependency group + --no-group: text # Disable the specified dependency group [env: `UV_NO_GROUP`=] + --no-default-groups # Ignore the default dependency groups + --only-group: text # Only include dependencies from the specified dependency group + --all-groups # Include dependencies from all dependency groups + --module(-m) # Run a Python module + --editable # Install any non-editable dependencies, including the project and any workspace members, as editable + --no-editable # Install any editable dependencies, including the project and any workspace members, as non-editable [env: UV_NO_EDITABLE=] + --no-editable-package: text # Install the specified editable packages as non-editable + --inexact # Do not remove extraneous packages present in the environment + --exact # Perform an exact sync, removing extraneous packages + --env-file: path # Load environment variables from a `.env` file + --no-env-file # Avoid reading environment variables from a `.env` file [env: UV_NO_ENV_FILE=] + --with(-w): by "nu-complete uv packages" [group: --group] # Run with the given packages installed + --with-editable: path # Run with the given packages installed in editable mode + --with-requirements: path # Run with the packages listed in the given files + --isolated # Run the command in an isolated virtual environment [env: UV_ISOLATED=] + --active # Prefer the active virtual environment over the project's virtual environment + --no-active # Prefer project's virtual environment over an active environment + --no-sync # Avoid syncing the virtual environment [env: UV_NO_SYNC=] + --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] + --frozen # Run without updating the `uv.lock` file [env: UV_FROZEN=] + --script(-s) # Run the given path as a Python script + --gui-script # Run the given path as a Python GUI script + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" [group: --group] # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: by "nu-complete uv packages" [group: --group] # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: by "nu-complete uv packages" [group: --group] # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" [group: --group] # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" [group: --group] # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" [group: --group] # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" [group: --group] # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --all-packages # Run the command with all workspace members installed + --package: text # Run the command in a specific package in the workspace + --no-project # Avoid discovering the project or workspace + --python(-p): text # The Python interpreter to use for the run environment. + --show-resolution # Whether to show resolver and installer output from any environment modifications [env: UV_SHOW_RESOLUTION=] + --max-recursion-depth: text # Number of times that `uv run` will allow recursive invocations + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform for which requirements should be installed + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...command: command # The command (or script) to run in the project environment +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + overrides [--active --no-active] + overrides [--all-extras --no-all-extras] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--dev --no-dev] + overrides [--editable --no-editable] + overrides [--env-file --no-env-file] + overrides [--extra --no-extra] + overrides [--group --no-group] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--project --no-project] + overrides [--refresh --no-refresh] + overrides [--reinstall --no-reinstall] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--dev --no-dev --only-dev] + at-most-one [--extra --all-extras] + at-most-one [--group --only-group --all-groups] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--dev --group] + at-most-one [--package --all-packages] + at-most-one [--script --project] + at-most-one [--color --no-color] + at-most-one [--active --no-active] + terminal [--help] +} - # Remove dependencies from the project - export extern "uv remove" [ - --dev # Remove the packages from the development dependency group [env: UV_DEV=] - --optional: string # Remove the packages from the project's optional dependencies for the specified extra - --group: string@"nu-complete uv groups" # Remove the packages from the specified dependency group - --no-sync # Avoid syncing the virtual environment after re-locking the project [env: UV_NO_SYNC=] - --active # Prefer the active virtual environment over the project's virtual environment - --no-active # Prefer project's virtual environment over an active environment - --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] - --frozen # Remove dependencies without re-locking the project [env: UV_FROZEN=] - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string@"nu-complete uv packages" # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string@"nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --package: string # Remove the dependencies from a specific package in the workspace - --script: path # Remove the dependency from the specified Python script, rather than from a project - --python(-p): string # The Python interpreter to use for resolving and syncing. - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...packages: string@"nu-complete uv packages" # The names of the dependencies to remove (e.g., `ruff`) - ] +export complete [uv init] [ + --name: text # The name of the project + --bare # Only create a `pyproject.toml` + --virtual # Create a virtual project, rather than a package + --package # Set up the project to be built as a Python package + --no-package # Do not set up the project to be built as a Python package + --app # Create a project for an application + --lib # Create a project for a library + --script # Create a script + --description: text # Set the project description + --no-description # Disable the description for the project + --vcs: words ["git" "none"] # Initialize a version control system for the project + --build-backend: words ["uv" "hatch" "flit" "pdm" "poetry" "setuptools" "maturin" "scikit"] # Initialize a build-backend of choice for the project + --backend # Invalid option name for build backend + --no-readme # Do not create a `README.md` file + --author-from: words ["auto" "git" "none"] # Fill in the `authors` field in the `pyproject.toml` + --no-pin-python # Do not create a `.python-version` file for the project + --pin-python # Create a `.python-version` file for the project + --no-workspace # Avoid discovering a workspace and create a standalone project + --python(-p): text # The Python interpreter to use to determine the minimum supported Python version. + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + path?: path # The path to use for the project/script +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--description --no-description] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--package --no-package] + overrides [--pin-python --no-pin-python] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--script --project] + at-most-one [--app --lib --script] + at-most-one [--bare --vcs] + at-most-one [--color --no-color] + terminal [--help] +} - # Read or update the project's version - export extern "uv version" [ - --bump: string@"nu-complete uv version bump" # Update the project version using the given semantics - --dry-run # Don't write a new version to the `pyproject.toml` - --short # Only show the version - --output-format: string@"nu-complete uv output_format" # The format of the output - --no-sync # Avoid syncing the virtual environment after re-locking the project [env: UV_NO_SYNC=] - --active # Prefer the active virtual environment over the project's virtual environment - --no-active # Prefer project's virtual environment over an active environment - --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] - --frozen # Update the version without re-locking the project [env: UV_FROZEN=] - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --package: string # Update the version of a specific package in the workspace - --python(-p): string # The Python interpreter to use for resolving and syncing. - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - value?: string # Set the project version to this value - ] +export complete [uv add] [ + --requirements(-r): path # Add the packages listed in the given files + --constraints(-c): path # Constrain versions using the given requirements files + --marker(-m): text # Apply this marker to all added packages + --dev # Add the requirements to the development dependency group [env: UV_DEV=] + --optional: text # Add the requirements to the package's optional dependencies for the specified extra + --group: by "nu-complete uv groups for add" # Add the requirements to the specified dependency group + --editable # Add the requirements as editable + --no-editable # Don't add the requirements as editable [env: UV_NO_EDITABLE=] + --no-editable-package: text # Don't add the specified requirements as editable + --raw # Add a dependency as provided + --bounds: words ["lower" "major" "minor" "exact"] # The kind of version specifier to use when adding dependencies + --rev: text # Commit to use when adding a dependency from Git + --tag: text # Tag to use when adding a dependency from Git + --branch: text # Branch to use when adding a dependency from Git + --lfs # Whether to use Git LFS when adding a dependency from Git + --extra: text # Extras to enable for the dependency + --no-sync # Avoid syncing the virtual environment [env: UV_NO_SYNC=] + --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] + --frozen # Add dependencies without re-locking the project [env: UV_FROZEN=] + --active # Prefer the active virtual environment over the project's virtual environment + --no-active # Prefer project's virtual environment over an active environment + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" [group: --group] # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: by "nu-complete uv packages" [group: --group] # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: by "nu-complete uv packages" [group: --group] # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" [group: --group] # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" [group: --group] # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" [group: --group] # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" [group: --group] # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --package: text # Add the dependency to a specific package in the workspace + --script: path # Add the dependency to the specified Python script, rather than to a project + --python(-p): text # The Python interpreter to use for resolving and syncing. + --workspace # Add the dependency as a workspace member + --no-workspace # Don't add the dependency as a workspace member + --no-install-project # Do not install the current project [env: UV_NO_INSTALL_PROJECT=] + --only-install-project # Only install the current project + --no-install-workspace # Do not install any workspace members, including the current project [env: UV_NO_INSTALL_WORKSPACE=] + --only-install-workspace # Only install workspace members, including the current project + --no-install-local # Do not install local path dependencies [env: UV_NO_INSTALL_LOCAL=] + --only-install-local # Only install local path dependencies + --no-install-package: text # Do not install the given package(s) + --only-install-package: text # Only install the given package(s) + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...packages: text # The packages to add, as PEP 508 requirements (e.g., `ruff==0.5.0`) +] where { + at-most-one [--verbose --quiet] + at-most-one [--workspace --package] + at-most-one [--locked --frozen] + overrides [--active --no-active] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--editable --no-editable] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--reinstall --no-reinstall] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + overrides [--workspace --no-workspace] + at-most-one [--quiet --verbose] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--dev --optional --group] + at-most-one [--script --project] + at-most-one [--color --no-color] + at-most-one [--active --no-active] + terminal [--help] +} - # Update the project's environment - export extern "uv sync" [ - --extra: string # Include optional dependencies from the specified extra name - --output-format: string@"nu-complete uv output_format" # Select the output format - --all-extras # Include all optional dependencies - --no-extra: string # Exclude the specified optional dependencies, if `--all-extras` is supplied - --no-all-extras - --dev # Include the development dependency group [env: UV_DEV=] - --no-dev # Disable the development dependency group [env: UV_NO_DEV=] - --only-dev # Only include the development dependency group - --group: string@"nu-complete uv groups" # Include dependencies from the specified dependency group - --no-group: string # Disable the specified dependency group [env: `UV_NO_GROUP`=] - --no-default-groups # Ignore the default dependency groups - --only-group: string # Only include dependencies from the specified dependency group - --all-groups # Include dependencies from all dependency groups - --editable # Install any non-editable dependencies, including the project and any workspace members, as editable - --no-editable # Install any editable dependencies, including the project and any workspace members, as non-editable [env: UV_NO_EDITABLE=] - --no-editable-package: string # Install the specified editable packages as non-editable - --inexact # Do not remove extraneous packages present in the environment - --exact # Perform an exact sync, removing extraneous packages - --active # Sync dependencies to the active virtual environment - --no-active # Prefer project's virtual environment over an active environment - --no-install-project # Do not install the current project [env: UV_NO_INSTALL_PROJECT=] - --only-install-project # Only install the current project - --no-install-workspace # Do not install any workspace members, including the root project [env: UV_NO_INSTALL_WORKSPACE=] - --only-install-workspace # Only install workspace members, including the root project - --no-install-local # Do not install local path dependencies [env: UV_NO_INSTALL_LOCAL=] - --only-install-local # Only install local path dependencies - --no-install-package: string # Do not install the given package(s) - --only-install-package: string # Only install the given package(s) - --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] - --frozen # Sync without updating the `uv.lock` file [env: UV_FROZEN=] - --dry-run # Perform a dry run, without writing the lockfile or modifying the project environment - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string@"nu-complete uv packages" # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string@"nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --all-packages # Sync all packages in the workspace - --package: string # Sync for specific packages in the workspace - --script: path # Sync the environment for a Python script, rather than the current project - --python(-p): string # The Python interpreter to use for the project environment. - --python-platform: string@"nu-complete uv python_platform" # The platform for which requirements should be installed - --check # Check if the Python environment is synchronized with the project - --no-check - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv remove] [ + --dev # Remove the packages from the development dependency group [env: UV_DEV=] + --optional: text # Remove the packages from the project's optional dependencies for the specified extra + --group: by "nu-complete uv groups" # Remove the packages from the specified dependency group + --no-sync # Avoid syncing the virtual environment after re-locking the project [env: UV_NO_SYNC=] + --active # Prefer the active virtual environment over the project's virtual environment + --no-active # Prefer project's virtual environment over an active environment + --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] + --frozen # Remove dependencies without re-locking the project [env: UV_FROZEN=] + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" [group: --group] # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: by "nu-complete uv packages" [group: --group] # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: by "nu-complete uv packages" [group: --group] # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" [group: --group] # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" [group: --group] # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" [group: --group] # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" [group: --group] # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --package: text # Remove the dependencies from a specific package in the workspace + --script: path # Remove the dependency from the specified Python script, rather than from a project + --python(-p): text # The Python interpreter to use for resolving and syncing. + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...packages: by "nu-complete uv packages" [group: --group] # The names of the dependencies to remove (e.g., `ruff`) +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + overrides [--active --no-active] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--reinstall --no-reinstall] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--dev --optional --group] + at-most-one [--script --project] + at-most-one [--color --no-color] + at-most-one [--active --no-active] + terminal [--help] +} - # Update the project's lockfile - export extern "uv lock" [ - --check # Check if the lockfile is up-to-date - --locked # Check if the lockfile is up-to-date [env: UV_LOCKED=] - --check-exists # Assert that a `uv.lock` exists without checking if it is up-to-date [env: UV_FROZEN=] - --dry-run # Perform a dry run, without writing the lockfile - --script: path # Lock the specified Python script, rather than the current project - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --python(-p): string # The Python interpreter to use during resolution. - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv version] [ + --bump: words ["major" "minor" "patch" "stable" "alpha" "beta" "rc" "post" "dev"] # Update the project version using the given semantics + --dry-run # Don't write a new version to the `pyproject.toml` + --short # Only show the version + --output-format: words ["text" "json"] # The format of the output + --no-sync # Avoid syncing the virtual environment after re-locking the project [env: UV_NO_SYNC=] + --active # Prefer the active virtual environment over the project's virtual environment + --no-active # Prefer project's virtual environment over an active environment + --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] + --frozen # Update the version without re-locking the project [env: UV_FROZEN=] + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: text # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: text # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --package: text # Update the version of a specific package in the workspace + --python(-p): text # The Python interpreter to use for resolving and syncing. + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + value?: text # Set the project version to this value +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + overrides [--active --no-active] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--reinstall --no-reinstall] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--bump --dry-run] + at-most-one [--color --no-color] + at-most-one [--active --no-active] + terminal [--help] +} - # Upgrade a dependency in the project - export extern "uv upgrade" [ - --exclude: string # Exclude the named package from upgrades - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...packages: string # The packages to upgrade - ] +export complete [uv sync] [ + --extra: text # Include optional dependencies from the specified extra name + --output-format: words ["text" "json"] # Select the output format + --all-extras # Include all optional dependencies + --no-extra: text # Exclude the specified optional dependencies, if `--all-extras` is supplied + --no-all-extras + --dev # Include the development dependency group [env: UV_DEV=] + --no-dev # Disable the development dependency group [env: UV_NO_DEV=] + --only-dev # Only include the development dependency group + --group: by "nu-complete uv groups" # Include dependencies from the specified dependency group + --no-group: text # Disable the specified dependency group [env: `UV_NO_GROUP`=] + --no-default-groups # Ignore the default dependency groups + --only-group: text # Only include dependencies from the specified dependency group + --all-groups # Include dependencies from all dependency groups + --editable # Install any non-editable dependencies, including the project and any workspace members, as editable + --no-editable # Install any editable dependencies, including the project and any workspace members, as non-editable [env: UV_NO_EDITABLE=] + --no-editable-package: text # Install the specified editable packages as non-editable + --inexact # Do not remove extraneous packages present in the environment + --exact # Perform an exact sync, removing extraneous packages + --active # Sync dependencies to the active virtual environment + --no-active # Prefer project's virtual environment over an active environment + --no-install-project # Do not install the current project [env: UV_NO_INSTALL_PROJECT=] + --only-install-project # Only install the current project + --no-install-workspace # Do not install any workspace members, including the root project [env: UV_NO_INSTALL_WORKSPACE=] + --only-install-workspace # Only install workspace members, including the root project + --no-install-local # Do not install local path dependencies [env: UV_NO_INSTALL_LOCAL=] + --only-install-local # Only install local path dependencies + --no-install-package: text # Do not install the given package(s) + --only-install-package: text # Only install the given package(s) + --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] + --frozen # Sync without updating the `uv.lock` file [env: UV_FROZEN=] + --dry-run # Perform a dry run, without writing the lockfile or modifying the project environment + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" [group: --group] # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: by "nu-complete uv packages" [group: --group] # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: by "nu-complete uv packages" [group: --group] # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" [group: --group] # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" [group: --group] # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" [group: --group] # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" [group: --group] # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --all-packages # Sync all packages in the workspace + --package: text # Sync for specific packages in the workspace + --script: path # Sync the environment for a Python script, rather than the current project + --python(-p): text # The Python interpreter to use for the project environment. + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform for which requirements should be installed + --check # Check if the Python environment is synchronized with the project + --no-check + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + overrides [--active --no-active] + overrides [--all-extras --no-all-extras] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--check --no-check] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--dev --no-dev] + overrides [--editable --no-editable] + overrides [--extra --no-extra] + overrides [--group --no-group] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--reinstall --no-reinstall] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--dev --no-dev --only-dev] + at-most-one [--extra --all-extras] + at-most-one [--group --only-group --all-groups] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--dev --group] + at-most-one [--package --all-packages] + at-most-one [--script --project] + at-most-one [--color --no-color] + at-most-one [--active --no-active] + terminal [--help] +} - # Export the project's lockfile to an alternate format - export extern "uv export" [ - --format: string@"nu-complete uv export format" # The format to which `uv.lock` should be exported - --all-packages # Export the entire workspace - --package: string # Export the dependencies for specific packages in the workspace - --prune: string@"nu-complete uv packages" # Prune the given package from the dependency tree - --extra: string # Include optional dependencies from the specified extra name - --all-extras # Include all optional dependencies - --no-extra: string # Exclude the specified optional dependencies, if `--all-extras` is supplied - --no-all-extras - --dev # Include the development dependency group [env: UV_DEV=] - --no-dev # Disable the development dependency group [env: UV_NO_DEV=] - --only-dev # Only include the development dependency group - --group: string@"nu-complete uv groups" # Include dependencies from the specified dependency group - --no-group: string # Disable the specified dependency group [env: `UV_NO_GROUP`=] - --no-default-groups # Ignore the default dependency groups - --only-group: string # Only include dependencies from the specified dependency group - --all-groups # Include dependencies from all dependency groups - --no-annotate # Exclude comment annotations indicating the source of each package - --annotate - --no-header # Exclude the comment header at the top of the generated output file - --header - --emit-index-url # Include `--index-url` and `--extra-index-url` entries in the generated output file - --no-emit-index-url - --emit-find-links # Include `--find-links` entries in the generated output file - --no-emit-find-links - --editable # Export any non-editable dependencies, including the project and any workspace members, as editable - --no-editable # Export any editable dependencies, including the project and any workspace members, as non-editable [env: UV_NO_EDITABLE=] - --no-editable-package: string # Export the specified editable packages as non-editable - --hashes # Include hashes for all dependencies - --no-hashes # Omit hashes in the generated output - --output-file(-o): path # Write the exported requirements to the given file - --no-emit-project # Do not emit the current project - --only-emit-project # Only emit the current project - --no-emit-workspace # Do not emit any workspace members, including the root project - --only-emit-workspace # Only emit workspace members, including the root project - --no-emit-local # Do not include local path dependencies in the exported requirements - --only-emit-local # Only include local path dependencies in the exported requirements - --no-emit-package: string@"nu-complete uv packages" # Do not emit the given package(s) - --only-emit-package: string@"nu-complete uv packages" # Only emit the given package(s) - --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] - --frozen # Do not update the `uv.lock` before exporting [env: UV_FROZEN=] - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string@"nu-complete uv packages" # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --script: path # Export the dependencies for the specified PEP 723 Python script, rather than the current project - --python(-p): string # The Python interpreter to use during resolution. - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv lock] [ + --check # Check if the lockfile is up-to-date + --locked # Check if the lockfile is up-to-date [env: UV_LOCKED=] + --check-exists # Assert that a `uv.lock` exists without checking if it is up-to-date [env: UV_FROZEN=] + --dry-run # Perform a dry run, without writing the lockfile + --script: path # Lock the specified Python script, rather than the current project + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: text # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --python(-p): text # The Python interpreter to use during resolution. + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--script --project] + at-most-one [--color --no-color] + terminal [--help] +} - # Display the project's dependency tree - export extern "uv tree" [ - --universal # Show a platform-independent dependency tree - --format: string@"nu-complete uv tree format" # The format in which to display the dependency graph - --depth(-d): string # Maximum display depth of the dependency tree - --prune: string@"nu-complete uv packages" # Prune the given package from the display of the dependency tree - --package: string@"nu-complete uv packages" # Display only the specified packages - --no-dedupe # Do not de-duplicate repeated dependencies. Usually, when a package has already displayed its dependencies, further occurrences will not re-display its dependencies, and will include a (*) to indicate it has already been shown. This flag will cause those duplicates to be repeated - --invert # Show the reverse dependencies for the given package. This flag will invert the tree and display the packages that depend on the given package - --outdated # Show the latest available version of each package in the tree - --show-sizes # Show compressed wheel sizes for packages in the tree - --dev # Include the development dependency group [env: UV_DEV=] - --no-dev # Disable the development dependency group [env: UV_NO_DEV=] - --only-dev # Only include the development dependency group - --group: string@"nu-complete uv groups" # Include dependencies from the specified dependency group - --no-group: string # Disable the specified dependency group [env: `UV_NO_GROUP`=] - --no-default-groups # Ignore the default dependency groups - --only-group: string # Only include dependencies from the specified dependency group - --all-groups # Include dependencies from all dependency groups - --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] - --frozen # Display the requirements without locking the project [env: UV_FROZEN=] - --no-build # Don't build source distributions - --build - --no-build-package: string # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string@"nu-complete uv packages" # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --script: path # Show the dependency tree the specified PEP 723 Python script, rather than the current project - --python-version: string # The Python version to use when filtering the tree - --python-platform: string@"nu-complete uv python_platform" # The platform to use when filtering the tree - --python(-p): string # The Python interpreter to use for locking and filtering. - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv upgrade] [ + --exclude: text # Exclude the named package from upgrades + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...packages: text # The packages to upgrade +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Format Python code in the project - export extern "uv format" [ - --check # Check if files are formatted without applying changes - --diff # Show a diff of formatting changes without applying them - --version: string # The version of Ruff to use for formatting - --exclude-newer: string # Limit candidate Ruff versions to those released prior to the given date - --no-project # Avoid discovering a project or workspace - --show-version # Display the version of Ruff that will be used for formatting - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...extra_args: string # Additional arguments to pass to Ruff - ] +export complete [uv export] [ + --format: words ["requirements.txt" "pylock.toml" "cyclonedx1.5"] # The format to which `uv.lock` should be exported + --all-packages # Export the entire workspace + --package: text # Export the dependencies for specific packages in the workspace + --prune: by "nu-complete uv packages" [group: --group] # Prune the given package from the dependency tree + --extra: text # Include optional dependencies from the specified extra name + --all-extras # Include all optional dependencies + --no-extra: text # Exclude the specified optional dependencies, if `--all-extras` is supplied + --no-all-extras + --dev # Include the development dependency group [env: UV_DEV=] + --no-dev # Disable the development dependency group [env: UV_NO_DEV=] + --only-dev # Only include the development dependency group + --group: by "nu-complete uv groups" # Include dependencies from the specified dependency group + --no-group: text # Disable the specified dependency group [env: `UV_NO_GROUP`=] + --no-default-groups # Ignore the default dependency groups + --only-group: text # Only include dependencies from the specified dependency group + --all-groups # Include dependencies from all dependency groups + --no-annotate # Exclude comment annotations indicating the source of each package + --annotate + --no-header # Exclude the comment header at the top of the generated output file + --header + --emit-index-url # Include `--index-url` and `--extra-index-url` entries in the generated output file + --no-emit-index-url + --emit-find-links # Include `--find-links` entries in the generated output file + --no-emit-find-links + --editable # Export any non-editable dependencies, including the project and any workspace members, as editable + --no-editable # Export any editable dependencies, including the project and any workspace members, as non-editable [env: UV_NO_EDITABLE=] + --no-editable-package: text # Export the specified editable packages as non-editable + --hashes # Include hashes for all dependencies + --no-hashes # Omit hashes in the generated output + --output-file(-o): path # Write the exported requirements to the given file + --no-emit-project # Do not emit the current project + --only-emit-project # Only emit the current project + --no-emit-workspace # Do not emit any workspace members, including the root project + --only-emit-workspace # Only emit workspace members, including the root project + --no-emit-local # Do not include local path dependencies in the exported requirements + --only-emit-local # Only include local path dependencies in the exported requirements + --no-emit-package: by "nu-complete uv packages" [group: --group] # Do not emit the given package(s) + --only-emit-package: by "nu-complete uv packages" [group: --group] # Only emit the given package(s) + --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] + --frozen # Do not update the `uv.lock` before exporting [env: UV_FROZEN=] + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" [group: --group] # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: by "nu-complete uv packages" [group: --group] # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" [group: --group] # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" [group: --group] # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" [group: --group] # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" [group: --group] # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --script: path # Export the dependencies for the specified PEP 723 Python script, rather than the current project + --python(-p): text # The Python interpreter to use during resolution. + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + overrides [--all-extras --no-all-extras] + overrides [--annotate --no-annotate] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--dev --no-dev] + overrides [--editable --no-editable] + overrides [--emit-find-links --no-emit-find-links] + overrides [--emit-index-url --no-emit-index-url] + overrides [--extra --no-extra] + overrides [--group --no-group] + overrides [--hashes --no-hashes] + overrides [--header --no-header] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--dev --no-dev --only-dev] + at-most-one [--extra --all-extras] + at-most-one [--group --only-group --all-groups] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--dev --group] + at-most-one [--package --all-packages] + at-most-one [--script --project] + at-most-one [--color --no-color] + terminal [--help] +} - # Run checks on the project - export extern "uv check" [ - --fix # Apply safe fixes to resolve type-checking errors - --all-packages # Check all packages in the workspace - --package: string@"nu-complete uv packages" # Check specific packages in the workspace - --script: path # Run checks for the specified PEP 723 Python script, rather than the current project - --extra: string # Include optional dependencies from the specified extra name - --all-extras # Include all optional dependencies - --no-extra: string # Exclude the specified optional dependencies, if `--all-extras` is supplied - --no-all-extras - --dev # Include the development dependency group [env: UV_DEV=] - --no-dev # Disable the development dependency group [env: UV_NO_DEV=] - --only-dev # Only include the development dependency group - --group: string@"nu-complete uv groups" # Include dependencies from the specified dependency group - --no-group: string # Disable the specified dependency group [env: `UV_NO_GROUP`=] - --no-default-groups # Ignore the default dependency groups - --only-group: string # Only include dependencies from the specified dependency group - --all-groups # Include dependencies from all dependency groups - --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] - --frozen # Sync without updating the `uv.lock` file [env: UV_FROZEN=] - --no-sync # Avoid syncing the virtual environment [env: UV_NO_SYNC=] - --no-install-project # Do not install the current project [env: UV_NO_INSTALL_PROJECT=] - --isolated # Run checks without mutating project state [env: UV_ISOLATED=] - --python(-p): string # The Python interpreter to use for the project environment - --ty-version: string # The version of ty to use for type checking - --show-version # Display the version of ty that will be used for type checking - --show-command # Display the ty command that will be used for type checking - --no-project # Avoid discovering a project or workspace - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv tree] [ + --universal # Show a platform-independent dependency tree + --format: words ["text" "json"] # The format in which to display the dependency graph + --depth(-d): text # Maximum display depth of the dependency tree + --prune: by "nu-complete uv packages" [group: --group] # Prune the given package from the display of the dependency tree + --package: by "nu-complete uv packages" [group: --group] # Display only the specified packages + --no-dedupe # Do not de-duplicate repeated dependencies. Usually, when a package has already displayed its dependencies, further occurrences will not re-display its dependencies, and will include a (*) to indicate it has already been shown. This flag will cause those duplicates to be repeated + --invert # Show the reverse dependencies for the given package. This flag will invert the tree and display the packages that depend on the given package + --outdated # Show the latest available version of each package in the tree + --show-sizes # Show compressed wheel sizes for packages in the tree + --dev # Include the development dependency group [env: UV_DEV=] + --no-dev # Disable the development dependency group [env: UV_NO_DEV=] + --only-dev # Only include the development dependency group + --group: by "nu-complete uv groups" # Include dependencies from the specified dependency group + --no-group: text # Disable the specified dependency group [env: `UV_NO_GROUP`=] + --no-default-groups # Ignore the default dependency groups + --only-group: text # Only include dependencies from the specified dependency group + --all-groups # Include dependencies from all dependency groups + --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] + --frozen # Display the requirements without locking the project [env: UV_FROZEN=] + --no-build # Don't build source distributions + --build + --no-build-package: text # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: text # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" [group: --group] # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: by "nu-complete uv packages" [group: --group] # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" [group: --group] # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" [group: --group] # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --script: path # Show the dependency tree the specified PEP 723 Python script, rather than the current project + --python-version: text # The Python version to use when filtering the tree + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform to use when filtering the tree + --python(-p): text # The Python interpreter to use for locking and filtering. + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--dev --no-dev] + overrides [--group --no-group] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--dev --no-dev --only-dev] + at-most-one [--group --only-group --all-groups] + at-most-one [--managed-python --no-managed-python] + at-most-one [--dev --group] + at-most-one [--script --project] + at-most-one [--color --no-color] + terminal [--help] +} - # Audit the project's dependencies - export extern "uv audit" [ - --no-extra: string # Don't audit the specified optional dependencies - --no-dev # Don't audit the development dependency group [env: UV_NO_DEV=] - --no-group: string # Don't audit the specified dependency group [env: `UV_NO_GROUP`=] - --no-default-groups # Don't audit the default dependency groups - --only-group: string # Only audit dependencies from the specified dependency group - --only-dev # Only audit the development dependency group - --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] - --frozen # Audit the requirements without locking the project [env: UV_FROZEN=] - --output-format: string@"nu-complete uv audit output_format" # Select the output format - --ignore: string # Ignore a vulnerability by ID - --ignore-until-fixed: string # Ignore a vulnerability by ID, but only while no fix is available - --service-format: string@"nu-complete uv audit service_format" # The service format to use for vulnerability lookups - --service-url: string # The URL to vulnerability service API endpoint - --no-build # Don't build source distributions - --build - --no-build-package: string # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --script: path # Audit the specified PEP 723 Python script, rather than the current project - --python-version: string # The Python version to use when auditing - --python-platform: string@"nu-complete uv python_platform" # The platform to use when auditing - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv format] [ + --check # Check if files are formatted without applying changes + --diff # Show a diff of formatting changes without applying them + --version: text # The version of Ruff to use for formatting + --exclude-newer: text # Limit candidate Ruff versions to those released prior to the given date + --no-project # Avoid discovering a project or workspace + --show-version # Display the version of Ruff that will be used for formatting + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...extra_args: text # Additional arguments to pass to Ruff +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--project --no-project] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help --version] +} - # Run and install commands provided by Python packages - export extern "uv tool" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv check] [ + --fix # Apply safe fixes to resolve type-checking errors + --all-packages # Check all packages in the workspace + --package: by "nu-complete uv packages" [group: --group] # Check specific packages in the workspace + --script: path # Run checks for the specified PEP 723 Python script, rather than the current project + --extra: text # Include optional dependencies from the specified extra name + --all-extras # Include all optional dependencies + --no-extra: text # Exclude the specified optional dependencies, if `--all-extras` is supplied + --no-all-extras + --dev # Include the development dependency group [env: UV_DEV=] + --no-dev # Disable the development dependency group [env: UV_NO_DEV=] + --only-dev # Only include the development dependency group + --group: by "nu-complete uv groups" # Include dependencies from the specified dependency group + --no-group: text # Disable the specified dependency group [env: `UV_NO_GROUP`=] + --no-default-groups # Ignore the default dependency groups + --only-group: text # Only include dependencies from the specified dependency group + --all-groups # Include dependencies from all dependency groups + --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] + --frozen # Sync without updating the `uv.lock` file [env: UV_FROZEN=] + --no-sync # Avoid syncing the virtual environment [env: UV_NO_SYNC=] + --no-install-project # Do not install the current project [env: UV_NO_INSTALL_PROJECT=] + --isolated # Run checks without mutating project state [env: UV_ISOLATED=] + --python(-p): text # The Python interpreter to use for the project environment + --ty-version: text # The version of ty to use for type checking + --show-version # Display the version of ty that will be used for type checking + --show-command # Display the ty command that will be used for type checking + --no-project # Avoid discovering a project or workspace + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): text # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: text # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: text # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: text # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: text # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: text # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: text # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + overrides [--all-extras --no-all-extras] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--dev --no-dev] + overrides [--extra --no-extra] + overrides [--group --no-group] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--project --no-project] + overrides [--refresh --no-refresh] + overrides [--reinstall --no-reinstall] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--dev --no-dev --only-dev] + at-most-one [--extra --all-extras] + at-most-one [--group --only-group --all-groups] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--dev --group] + at-most-one [--package --all-packages] + at-most-one [--script --project] + at-most-one [--color --no-color] + terminal [--help] +} - # Run a command provided by a Python package - export extern "uv tool run" [ - --from: string # Use the given package to provide the command - --with(-w): string@"nu-complete uv packages" # Run with the given packages installed - --with-editable: path # Run with the given packages installed in editable mode - --with-requirements: path # Run with the packages listed in the given files - --constraints(-c): path # Constrain versions using the given requirements files - --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions - --overrides: path # Override versions using the given requirements files - --isolated # Run the tool in an isolated virtual environment, ignoring any already-installed tools [env: UV_ISOLATED=] - --env-file: path # Load environment variables from a `.env` file - --no-env-file # Avoid reading environment variables from a `.env` file [env: UV_NO_ENV_FILE=] - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string@"nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --lfs # Whether to use Git LFS when adding a dependency from Git - --python(-p): string # The Python interpreter to use to build the run environment. - --show-resolution # Whether to show resolver and installer output from any environment modifications [env: UV_SHOW_RESOLUTION=] - --python-platform: string@"nu-complete uv python_platform" # The platform for which requirements should be installed - --torch-backend: string@"nu-complete uv torch_backend" # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) - --generate-shell-completion: string@"nu-complete uv shell" - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv audit] [ + --no-extra: text # Don't audit the specified optional dependencies + --no-dev # Don't audit the development dependency group [env: UV_NO_DEV=] + --no-group: text # Don't audit the specified dependency group [env: `UV_NO_GROUP`=] + --no-default-groups # Don't audit the default dependency groups + --only-group: text # Only audit dependencies from the specified dependency group + --only-dev # Only audit the development dependency group + --locked # Assert that the `uv.lock` will remain unchanged [env: UV_LOCKED=] + --frozen # Audit the requirements without locking the project [env: UV_FROZEN=] + --output-format: words ["text" "json" "sarif"] # Select the output format + --ignore: text # Ignore a vulnerability by ID + --ignore-until-fixed: text # Ignore a vulnerability by ID, but only while no fix is available + --service-format: words ["osv"] # The service format to use for vulnerability lookups + --service-url: text # The URL to vulnerability service API endpoint + --no-build # Don't build source distributions + --build + --no-build-package: text # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: text # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): text # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: text # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: text # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: text # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --script: path # Audit the specified PEP 723 Python script, rather than the current project + --python-version: text # The Python version to use when auditing + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform to use when auditing + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--no-dev --only-dev] + at-most-one [--managed-python --no-managed-python] + at-most-one [--script --project] + at-most-one [--color --no-color] + terminal [--help] +} - # Run a command provided by a Python package. - export extern "uv tool uvx" [ - --from: string # Use the given package to provide the command - --with(-w): string@"nu-complete uv packages" # Run with the given packages installed - --with-editable: path # Run with the given packages installed in editable mode - --with-requirements: path # Run with the packages listed in the given files - --constraints(-c): path # Constrain versions using the given requirements files - --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions - --overrides: path # Override versions using the given requirements files - --isolated # Run the tool in an isolated virtual environment, ignoring any already-installed tools [env: UV_ISOLATED=] - --env-file: path # Load environment variables from a `.env` file - --no-env-file # Avoid reading environment variables from a `.env` file [env: UV_NO_ENV_FILE=] - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string@"nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --lfs # Whether to use Git LFS when adding a dependency from Git - --python(-p): string # The Python interpreter to use to build the run environment. - --show-resolution # Whether to show resolver and installer output from any environment modifications [env: UV_SHOW_RESOLUTION=] - --python-platform: string@"nu-complete uv python_platform" # The platform for which requirements should be installed - --torch-backend: string@"nu-complete uv torch_backend" # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) - --generate-shell-completion: string@"nu-complete uv shell" - --version(-V) # Display the uvx version - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv tool] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Install commands provided by a Python package - export extern "uv tool install" [ - --from: string # The package to install commands from - --with(-w): string@"nu-complete uv packages" # Include the following additional requirements - --with-requirements: path # Run with the packages listed in the given files - --editable(-e) # Install the target package in editable mode, such that changes in the package's source directory are reflected without reinstallation - --with-editable: path # Include the given packages in editable mode - --with-executables-from: string # Install executables from the following packages - --constraints(-c): path # Constrain versions using the given requirements files - --overrides: path # Override versions using the given requirements files - --excludes: path # Exclude packages from resolution using the given requirements files - --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string@"nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --force # Force installation of the tool - --lfs # Whether to use Git LFS when adding a dependency from Git - --python(-p): string # The Python interpreter to use to build the tool environment. - --python-platform: string@"nu-complete uv python_platform" # The platform for which requirements should be installed - --torch-backend: string@"nu-complete uv torch_backend" # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - package: string@"nu-complete uv packages" # The package to install commands from - ] +export complete [uv tool run] [ + --from: text # Use the given package to provide the command + --with(-w): by "nu-complete uv packages" # Run with the given packages installed + --with-editable: path # Run with the given packages installed in editable mode + --with-requirements: path # Run with the packages listed in the given files + --constraints(-c): path # Constrain versions using the given requirements files + --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions + --overrides: path # Override versions using the given requirements files + --isolated # Run the tool in an isolated virtual environment, ignoring any already-installed tools [env: UV_ISOLATED=] + --env-file: path # Load environment variables from a `.env` file + --no-env-file # Avoid reading environment variables from a `.env` file [env: UV_NO_ENV_FILE=] + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: text # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: by "nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --lfs # Whether to use Git LFS when adding a dependency from Git + --python(-p): text # The Python interpreter to use to build the run environment. + --show-resolution # Whether to show resolver and installer output from any environment modifications [env: UV_SHOW_RESOLUTION=] + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform for which requirements should be installed + --torch-backend: words ["auto" "cpu" "cu132" "cu130" "cu129" "cu128" "cu126" "cu125" "cu124" "cu123" "cu122" "cu121" "cu120" "cu118" "cu117" "cu116" "cu115" "cu114" "cu113" "cu112" "cu111" "cu110" "cu102" "cu101" "cu100" "cu92" "cu91" "cu90" "cu80" "rocm7.2" "rocm7.1" "rocm7.0" "rocm6.4" "rocm6.3" "rocm6.2.4" "rocm6.2" "rocm6.1" "rocm6.0" "rocm5.7" "rocm5.6" "rocm5.5" "rocm5.4.2" "rocm5.4" "rocm5.3" "rocm5.2" "rocm5.1.1" "rocm4.2" "rocm4.1" "rocm4.0.1" "xpu"] # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) + --generate-shell-completion: words ["bash" "elvish" "fish" "nushell" "powershell" "zsh"] + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...command: command # The tool command to run +] where { + at-most-one [--verbose --quiet] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--env-file --no-env-file] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--reinstall --no-reinstall] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Upgrade installed tools - export extern "uv tool upgrade" [ - --all # Upgrade all tools - --python(-p): string # Upgrade a tool, and specify it to use the given Python interpreter to build its environment. Use with `--all` to apply to all tools. - --python-platform: string@"nu-complete uv python_platform" # The platform for which requirements should be installed - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string@"nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-setting-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...name: string@"nu-complete uv packages" # The name of the tool to upgrade, along with an optional version specifier - ] +export complete [uv tool uvx] [ + --from: text # Use the given package to provide the command + --with(-w): by "nu-complete uv packages" # Run with the given packages installed + --with-editable: path # Run with the given packages installed in editable mode + --with-requirements: path # Run with the packages listed in the given files + --constraints(-c): path # Constrain versions using the given requirements files + --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions + --overrides: path # Override versions using the given requirements files + --isolated # Run the tool in an isolated virtual environment, ignoring any already-installed tools [env: UV_ISOLATED=] + --env-file: path # Load environment variables from a `.env` file + --no-env-file # Avoid reading environment variables from a `.env` file [env: UV_NO_ENV_FILE=] + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: text # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: by "nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --lfs # Whether to use Git LFS when adding a dependency from Git + --python(-p): text # The Python interpreter to use to build the run environment. + --show-resolution # Whether to show resolver and installer output from any environment modifications [env: UV_SHOW_RESOLUTION=] + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform for which requirements should be installed + --torch-backend: words ["auto" "cpu" "cu132" "cu130" "cu129" "cu128" "cu126" "cu125" "cu124" "cu123" "cu122" "cu121" "cu120" "cu118" "cu117" "cu116" "cu115" "cu114" "cu113" "cu112" "cu111" "cu110" "cu102" "cu101" "cu100" "cu92" "cu91" "cu90" "cu80" "rocm7.2" "rocm7.1" "rocm7.0" "rocm6.4" "rocm6.3" "rocm6.2.4" "rocm6.2" "rocm6.1" "rocm6.0" "rocm5.7" "rocm5.6" "rocm5.5" "rocm5.4.2" "rocm5.4" "rocm5.3" "rocm5.2" "rocm5.1.1" "rocm4.2" "rocm4.1" "rocm4.0.1" "xpu"] # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) + --generate-shell-completion: words ["bash" "elvish" "fish" "nushell" "powershell" "zsh"] + --version(-V) # Display the uvx version + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--env-file --no-env-file] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--reinstall --no-reinstall] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help --version] +} - # List installed tools - export extern "uv tool list" [ - --show-paths # Whether to display the path to each tool environment and installed executable - --show-version-specifiers # Whether to display the version specifier(s) used to install each tool - --show-with # Whether to display the additional requirements installed with each tool - --show-extras # Whether to display the extra requirements installed with each tool - --show-python # Whether to display the Python version associated with each tool - --outdated # List outdated tools - --no-outdated - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --python-preference: string@"nu-complete uv python_preference" - --no-python-downloads - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv tool install] [ + --from: text # The package to install commands from + --with(-w): by "nu-complete uv packages" # Include the following additional requirements + --with-requirements: path # Run with the packages listed in the given files + --editable(-e) # Install the target package in editable mode, such that changes in the package's source directory are reflected without reinstallation + --with-editable: path # Include the given packages in editable mode + --with-executables-from: text # Install executables from the following packages + --constraints(-c): path # Constrain versions using the given requirements files + --overrides: path # Override versions using the given requirements files + --excludes: path # Exclude packages from resolution using the given requirements files + --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: text # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: by "nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --force # Force installation of the tool + --lfs # Whether to use Git LFS when adding a dependency from Git + --python(-p): text # The Python interpreter to use to build the tool environment. + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform for which requirements should be installed + --torch-backend: words ["auto" "cpu" "cu132" "cu130" "cu129" "cu128" "cu126" "cu125" "cu124" "cu123" "cu122" "cu121" "cu120" "cu118" "cu117" "cu116" "cu115" "cu114" "cu113" "cu112" "cu111" "cu110" "cu102" "cu101" "cu100" "cu92" "cu91" "cu90" "cu80" "rocm7.2" "rocm7.1" "rocm7.0" "rocm6.4" "rocm6.3" "rocm6.2.4" "rocm6.2" "rocm6.1" "rocm6.0" "rocm5.7" "rocm5.6" "rocm5.5" "rocm5.4.2" "rocm5.4" "rocm5.3" "rocm5.2" "rocm5.1.1" "rocm4.2" "rocm4.1" "rocm4.0.1" "xpu"] # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + package: by "nu-complete uv packages" # The package to install commands from +] where { + at-most-one [--verbose --quiet] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--reinstall --no-reinstall] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Audit installed tools and their dependencies - export extern "uv tool audit" [ - --all # Audit all installed tools - --output-format: string@"nu-complete uv tool audit output_format" # Select the output format - --ignore: string # Ignore a vulnerability by ID - --ignore-until-fixed: string # Ignore a vulnerability by ID, but only while no fix is available - --service-format: string@"nu-complete uv tool audit service_format" # The service format to use for vulnerability lookups - --service-url: string # The URL to vulnerability service API endpoint - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...name: string # The names of the installed tools to audit - ] +export complete [uv tool upgrade] [ + --all # Upgrade all tools + --python(-p): text # Upgrade a tool, and specify it to use the given Python interpreter to build its environment. Use with `--all` to apply to all tools. + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform for which requirements should be installed + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --upgrade-package(-P): by "nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: text # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: by "nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-setting-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...name: by "nu-complete uv tools" # The name of the tool to upgrade, along with an optional version specifier +] where { + at-most-one [--verbose --quiet] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--reinstall --no-reinstall] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Uninstall a tool - export extern "uv tool uninstall" [ - --all # Uninstall all tools - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...name: string # The name of the tool to uninstall - ] +export complete [uv tool list] [ + --show-paths # Whether to display the path to each tool environment and installed executable + --show-version-specifiers # Whether to display the version specifier(s) used to install each tool + --show-with # Whether to display the additional requirements installed with each tool + --show-extras # Whether to display the extra requirements installed with each tool + --show-python # Whether to display the Python version associated with each tool + --outdated # List outdated tools + --no-outdated + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: text # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --no-python-downloads + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--outdated --no-outdated] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Ensure that the tool executable directory is on the `PATH` - export extern "uv tool update-shell" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv tool audit] [ + --all # Audit all installed tools + --output-format: words ["text" "json" "sarif"] # Select the output format + --ignore: text # Ignore a vulnerability by ID + --ignore-until-fixed: text # Ignore a vulnerability by ID, but only while no fix is available + --service-format: words ["osv"] # The service format to use for vulnerability lookups + --service-url: text # The URL to vulnerability service API endpoint + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...name: by "nu-complete uv tools" # The names of the installed tools to audit +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Show the path to the uv tools directory - export extern "uv tool dir" [ - --bin # Show the directory into which `uv tool` will install executables. - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv tool uninstall] [ + --all # Uninstall all tools + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...name: by "nu-complete uv tools" # The name of the tool to uninstall +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Manage Python versions and installations - export extern "uv python" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv tool update-shell] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # List the available Python installations - export extern "uv python list" [ - --all-versions # List all Python versions, including old patch versions - --all-platforms # List Python downloads for all platforms - --all-arches # List Python downloads for all architectures - --only-installed # Only show installed Python versions - --only-downloads # Only show available Python downloads - --show-urls # Show the URLs of available Python downloads - --output-format: string@"nu-complete uv output_format" # Select the output format - --python-downloads-json-url: string # URL pointing to JSON of custom Python installations - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - request?: string # A Python request to filter by - ] +export complete [uv tool dir] [ + --bin # Show the directory into which `uv tool` will install executables. + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Download and install Python versions - export extern "uv python install" [ - --install-dir(-i): path # The directory to store the Python installation in - --bin # Install a Python executable into the `bin` directory - --no-bin # Do not install a Python executable into the `bin` directory - --registry # Register the Python installation in the Windows registry - --no-registry # Do not register the Python installation in the Windows registry - --mirror: string # Set the URL to use as the source for downloading Python installations - --pypy-mirror: string # Set the URL to use as the source for downloading PyPy installations - --python-downloads-json-url: string # URL pointing to JSON of custom Python installations - --reinstall(-r) # Reinstall the requested Python version, if it's already installed - --force(-f) # Replace existing Python executables during installation - --upgrade(-U) # Upgrade existing Python installations to the latest patch version - --default # Use as the default Python version - --compile-bytecode # Compile Python's standard library to bytecode after installation - --no-compile-bytecode - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...targets: string # The Python version(s) to install - ] +export complete [uv python] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Upgrade installed Python versions - export extern "uv python upgrade" [ - --install-dir(-i): path # The directory Python installations are stored in - --mirror: string # Set the URL to use as the source for downloading Python installations - --pypy-mirror: string # Set the URL to use as the source for downloading PyPy installations - --reinstall(-r) # Reinstall the latest Python patch, if it's already installed - --python-downloads-json-url: string # URL pointing to JSON of custom Python installations - --compile-bytecode # Compile Python's standard library to bytecode after installation - --no-compile-bytecode - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...targets: string # The Python minor version(s) to upgrade - ] +export complete [uv python list] [ + --all-versions # List all Python versions, including old patch versions + --all-platforms # List Python downloads for all platforms + --all-arches # List Python downloads for all architectures + --only-installed # Only show installed Python versions + --only-downloads # Only show available Python downloads + --show-urls # Show the URLs of available Python downloads + --output-format: words ["text" "json"] # Select the output format + --python-downloads-json-url: text # URL pointing to JSON of custom Python installations + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + request?: text # A Python request to filter by +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + at-most-one [--only-installed --only-downloads] + terminal [--help] +} - # Search for a Python installation - export extern "uv python find" [ - --no-project # Avoid discovering a project or workspace - --system # Only find system Python interpreters - --no-system - --script: path # Find the environment for a Python script, rather than the current project - --show-version # Show the Python version that would be used instead of the path to the interpreter - --resolve-links # Resolve symlinks in the output path - --python-downloads-json-url: string # URL pointing to JSON of custom Python installations - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - request?: string # The Python request - ] +export complete [uv python install] [ + --install-dir(-i): path # The directory to store the Python installation in + --bin # Install a Python executable into the `bin` directory + --no-bin # Do not install a Python executable into the `bin` directory + --registry # Register the Python installation in the Windows registry + --no-registry # Do not register the Python installation in the Windows registry + --mirror: text # Set the URL to use as the source for downloading Python installations + --pypy-mirror: text # Set the URL to use as the source for downloading PyPy installations + --python-downloads-json-url: text # URL pointing to JSON of custom Python installations + --reinstall(-r) # Reinstall the requested Python version, if it's already installed + --force(-f) # Replace existing Python executables during installation + --upgrade(-U) # Upgrade existing Python installations to the latest patch version + --default # Use as the default Python version + --compile-bytecode # Compile Python's standard library to bytecode after installation + --no-compile-bytecode + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...targets: by "nu-complete uv python versions" # The Python version(s) to install +] where { + at-most-one [--verbose --quiet] + overrides [--bin --no-bin] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--registry --no-registry] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Pin to a specific Python version - export extern "uv python pin" [ - --resolved # Write the resolved Python interpreter path instead of the request - --no-resolved - --no-project # Avoid validating the Python pin is compatible with the project or workspace - --global # Update the global Python version pin - --rm # Remove the Python version pin - --python-downloads-json-url: string # URL pointing to JSON of custom Python installations - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - request?: string # The Python version request - ] +export complete [uv python upgrade] [ + --install-dir(-i): path # The directory Python installations are stored in + --mirror: text # Set the URL to use as the source for downloading Python installations + --pypy-mirror: text # Set the URL to use as the source for downloading PyPy installations + --reinstall(-r) # Reinstall the latest Python patch, if it's already installed + --python-downloads-json-url: text # URL pointing to JSON of custom Python installations + --compile-bytecode # Compile Python's standard library to bytecode after installation + --no-compile-bytecode + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...targets: by "nu-complete uv python installed" # The Python minor version(s) to upgrade +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Show the uv Python installation directory - export extern "uv python dir" [ - --bin # Show the directory into which `uv python` will install Python executables. - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv python find] [ + --no-project # Avoid discovering a project or workspace + --system # Only find system Python interpreters + --no-system + --script: path # Find the environment for a Python script, rather than the current project + --show-version # Show the Python version that would be used instead of the path to the interpreter + --resolve-links # Resolve symlinks in the output path + --python-downloads-json-url: text # URL pointing to JSON of custom Python installations + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + request?: text # The Python request +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--project --no-project] + overrides [--system --no-system] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--script --project] + at-most-one [--color --no-color] + terminal [--help] +} - # Uninstall Python versions - export extern "uv python uninstall" [ - --install-dir(-i): path # The directory where the Python was installed - --all # Uninstall all managed Python versions - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...targets: string # The Python version(s) to uninstall - ] +export complete [uv python pin] [ + --resolved # Write the resolved Python interpreter path instead of the request + --no-resolved + --no-project # Avoid validating the Python pin is compatible with the project or workspace + --global # Update the global Python version pin + --rm # Remove the Python version pin + --python-downloads-json-url: text # URL pointing to JSON of custom Python installations + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + request?: text # The Python version request +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--project --no-project] + overrides [--resolved --no-resolved] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Ensure that the Python executable directory is on the `PATH` - export extern "uv python update-shell" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv python dir] [ + --bin # Show the directory into which `uv python` will install Python executables. + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Manage Python packages with a pip-compatible interface - export extern "uv pip" [ - --cert: path # Path to a PEM-encoded CA certificate bundle - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv python uninstall] [ + --install-dir(-i): path # The directory where the Python was installed + --all # Uninstall all managed Python versions + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...targets: by "nu-complete uv python installed" # The Python version(s) to uninstall +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Compile a `requirements.in` file to a `requirements.txt` or `pylock.toml` file - export extern "uv pip compile" [ - --constraints(-c): path # Constrain versions using the given requirements files - --overrides: path # Override versions using the given requirements files - --excludes: path # Exclude packages from resolution using the given requirements files - --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions - --extra: string # Include optional dependencies from the specified extra name; may be provided more than once - --all-extras # Include all optional dependencies - --no-all-extras - --group: string@"nu-complete uv groups" # Install the specified dependency group from a `pyproject.toml` - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string@"nu-complete uv packages" # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --no-deps # Ignore package dependencies, instead only add those packages explicitly listed on the command line to the resulting requirements file - --deps - --output-file(-o): path # Write the compiled requirements to the given `requirements.txt` or `pylock.toml` file - --format: string@"nu-complete uv pip compile format" # The format in which the resolution should be output - --no-strip-extras # Include extras in the output file - --strip-extras - --no-strip-markers # Include environment markers in the output file - --strip-markers - --no-annotate # Exclude comment annotations indicating the source of each package - --annotate - --no-header # Exclude the comment header at the top of the generated output file - --header - --annotation-style: string@"nu-complete uv pip compile annotation_style" # The style of the annotation comments included in the output file, used to indicate the source of each package - --custom-compile-command: string # The header comment to include at the top of the output file generated by `uv pip compile` - --python(-p): string # The Python interpreter to use during resolution. - --system # Install packages into the system Python environment - --no-system - --generate-hashes # Include distribution hashes in the output file - --no-generate-hashes - --no-build # Don't build source distributions - --build - --no-binary: string # Don't install pre-built wheels - --only-binary: string # Only use pre-built wheels; don't build source distributions - --python-version: string # The Python version to use for resolution - --python-platform: string@"nu-complete uv python_platform" # The platform for which requirements should be resolved - --universal # Perform a universal resolution, attempting to generate a single `requirements.txt` output file that is compatible with all operating systems, architectures, and Python implementations - --no-universal - --no-emit-package: string@"nu-complete uv packages" # Specify a package to omit from the output resolution. Its dependencies will still be included in the resolution. Equivalent to pip-compile's `--unsafe-package` option - --emit-index-url # Include `--index-url` and `--extra-index-url` entries in the generated output file - --no-emit-index-url - --emit-find-links # Include `--find-links` entries in the generated output file - --no-emit-find-links - --emit-build-options # Include `--no-binary` and `--only-binary` entries in the generated output file - --no-emit-build-options - --emit-marker-expression # Whether to emit a marker string indicating when it is known that the resulting set of pinned dependencies is valid - --no-emit-marker-expression - --emit-index-annotation # Include comment annotations indicating the index used to resolve each package (e.g., `# from https://pypi.org/simple`) - --no-emit-index-annotation - --torch-backend: string@"nu-complete uv torch_backend" # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) - --allow-unsafe - --no-allow-unsafe - --reuse-hashes - --no-reuse-hashes - --resolver: string@"nu-complete uv pip compile resolver" - --max-rounds: string - --client-cert: string - --emit-trusted-host - --no-emit-trusted-host - --config: string - --no-config - --emit-options - --no-emit-options - --pip-args: string - --cert: path # Path to a PEM-encoded CA certificate bundle - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --help(-h) # Display the concise help for this command - ...src_file: path # Include the packages listed in the given files - ] +export complete [uv python update-shell] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Sync an environment with a `requirements.txt` or `pylock.toml` file - export extern "uv pip sync" [ - --constraints(-c): path # Constrain versions using the given requirements files - --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions - --extra: string # Include optional dependencies from the specified extra name; may be provided more than once - --all-extras # Include all optional dependencies - --no-all-extras - --group: string@"nu-complete uv groups" # Install the specified dependency group from a `pylock.toml` or `pyproject.toml` - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string@"nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --require-hashes # Require a matching hash for each requirement - --no-require-hashes - --verify-hashes - --no-verify-hashes # Disable validation of hashes in the requirements file - --python(-p): string # The Python interpreter into which packages should be installed. - --system # Install packages into the system Python environment - --no-system - --break-system-packages # Allow uv to modify an `EXTERNALLY-MANAGED` Python installation - --no-break-system-packages - --target(-t): path # Install packages into the specified directory, rather than into the virtual or system Python environment. The packages will be installed at the top-level of the directory - --prefix: path # Install packages into `lib`, `bin`, and other top-level folders under the specified directory, as if a virtual environment were present at that location - --no-build # Don't build source distributions - --build - --no-binary: string # Don't install pre-built wheels - --only-binary: string # Only use pre-built wheels; don't build source distributions - --allow-empty-requirements # Allow sync of empty requirements, which will clear the environment of all packages - --no-allow-empty-requirements - --python-version: string # The minimum Python version that should be supported by the requirements (e.g., `3.7` or `3.7.9`) - --python-platform: string@"nu-complete uv python_platform" # The platform for which requirements should be installed - --strict # Validate the Python environment after completing the installation, to detect packages with missing dependencies or other issues - --no-strict - --dry-run # Perform a dry run, i.e., don't actually install anything but resolve the dependencies and print the resulting plan - --torch-backend: string@"nu-complete uv torch_backend" # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) - --ask(-a) - --python-executable: string - --user - --client-cert: string - --config: string - --no-config - --pip-args: string - --cert: path # Path to a PEM-encoded CA certificate bundle - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --help(-h) # Display the concise help for this command - ...src_file: path # Include the packages listed in the given files - ] +export complete [uv pip] [ + --cert: path # Path to a PEM-encoded CA certificate bundle + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Install packages into an environment - export extern "uv pip install" [ - --requirements(-r): path # Install the packages listed in the given files - --editable(-e): string # Install the editable package based on the provided local file path - --no-editable # Install any editable dependencies as non-editable [env: UV_NO_EDITABLE=] - --no-editable-package: string # Install the specified editable packages as non-editable - --constraints(-c): path # Constrain versions using the given requirements files - --overrides: path # Override versions using the given requirements files - --excludes: path # Exclude packages from resolution using the given requirements files - --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions - --extra: string # Include optional dependencies from the specified extra name; may be provided more than once - --all-extras # Include all optional dependencies - --no-all-extras - --group: string@"nu-complete uv groups" # Install the specified dependency group from a `pylock.toml` or `pyproject.toml` - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string@"nu-complete uv packages" # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` - --no-reinstall - --reinstall-package: string@"nu-complete uv packages" # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --compile-bytecode # Compile Python files to bytecode after installation - --no-compile-bytecode - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --no-deps # Ignore package dependencies, instead only installing those packages explicitly listed on the command line or in the requirements files - --deps - --require-hashes # Require a matching hash for each requirement - --no-require-hashes - --verify-hashes - --no-verify-hashes # Disable validation of hashes in the requirements file - --python(-p): string # The Python interpreter into which packages should be installed. - --system # Install packages into the system Python environment - --no-system - --break-system-packages # Allow uv to modify an `EXTERNALLY-MANAGED` Python installation - --no-break-system-packages - --target(-t): path # Install packages into the specified directory, rather than into the virtual or system Python environment. The packages will be installed at the top-level of the directory - --prefix: path # Install packages into `lib`, `bin`, and other top-level folders under the specified directory, as if a virtual environment were present at that location - --no-build # Don't build source distributions - --build - --no-binary: string # Don't install pre-built wheels - --only-binary: string # Only use pre-built wheels; don't build source distributions - --python-version: string # The minimum Python version that should be supported by the requirements (e.g., `3.7` or `3.7.9`) - --python-platform: string@"nu-complete uv python_platform" # The platform for which requirements should be installed - --inexact # Do not remove extraneous packages present in the environment - --exact # Perform an exact sync, removing extraneous packages - --strict # Validate the Python environment after completing the installation, to detect packages with missing dependencies or other issues - --no-strict - --dry-run # Perform a dry run, i.e., don't actually install anything but resolve the dependencies and print the resulting plan - --torch-backend: string@"nu-complete uv torch_backend" # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) - --disable-pip-version-check - --user - --cert: path # Path to a PEM-encoded CA certificate bundle - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...package: string@"nu-complete uv packages" # Install all listed packages - ] +export complete [uv pip compile] [ + --constraints(-c): path # Constrain versions using the given requirements files + --overrides: path # Override versions using the given requirements files + --excludes: path # Exclude packages from resolution using the given requirements files + --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions + --extra: text # Include optional dependencies from the specified extra name; may be provided more than once + --all-extras # Include all optional dependencies + --no-all-extras + --group: by "nu-complete uv groups" # Install the specified dependency group from a `pyproject.toml` + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" [group: --group] # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: by "nu-complete uv packages" [group: --group] # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" [group: --group] # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" [group: --group] # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --no-deps # Ignore package dependencies, instead only add those packages explicitly listed on the command line to the resulting requirements file + --deps + --output-file(-o): path # Write the compiled requirements to the given `requirements.txt` or `pylock.toml` file + --format: words ["requirements.txt" "pylock.toml"] # The format in which the resolution should be output + --no-strip-extras # Include extras in the output file + --strip-extras + --no-strip-markers # Include environment markers in the output file + --strip-markers + --no-annotate # Exclude comment annotations indicating the source of each package + --annotate + --no-header # Exclude the comment header at the top of the generated output file + --header + --annotation-style: words ["line" "split"] # The style of the annotation comments included in the output file, used to indicate the source of each package + --custom-compile-command: text # The header comment to include at the top of the output file generated by `uv pip compile` + --python(-p): text # The Python interpreter to use during resolution. + --system # Install packages into the system Python environment + --no-system + --generate-hashes # Include distribution hashes in the output file + --no-generate-hashes + --no-build # Don't build source distributions + --build + --no-binary: text # Don't install pre-built wheels + --only-binary: text # Only use pre-built wheels; don't build source distributions + --python-version: text # The Python version to use for resolution + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform for which requirements should be resolved + --universal # Perform a universal resolution, attempting to generate a single `requirements.txt` output file that is compatible with all operating systems, architectures, and Python implementations + --no-universal + --no-emit-package: by "nu-complete uv packages" [group: --group] # Specify a package to omit from the output resolution. Its dependencies will still be included in the resolution. Equivalent to pip-compile's `--unsafe-package` option + --emit-index-url # Include `--index-url` and `--extra-index-url` entries in the generated output file + --no-emit-index-url + --emit-find-links # Include `--find-links` entries in the generated output file + --no-emit-find-links + --emit-build-options # Include `--no-binary` and `--only-binary` entries in the generated output file + --no-emit-build-options + --emit-marker-expression # Whether to emit a marker string indicating when it is known that the resulting set of pinned dependencies is valid + --no-emit-marker-expression + --emit-index-annotation # Include comment annotations indicating the index used to resolve each package (e.g., `# from https://pypi.org/simple`) + --no-emit-index-annotation + --torch-backend: words ["auto" "cpu" "cu132" "cu130" "cu129" "cu128" "cu126" "cu125" "cu124" "cu123" "cu122" "cu121" "cu120" "cu118" "cu117" "cu116" "cu115" "cu114" "cu113" "cu112" "cu111" "cu110" "cu102" "cu101" "cu100" "cu92" "cu91" "cu90" "cu80" "rocm7.2" "rocm7.1" "rocm7.0" "rocm6.4" "rocm6.3" "rocm6.2.4" "rocm6.2" "rocm6.1" "rocm6.0" "rocm5.7" "rocm5.6" "rocm5.5" "rocm5.4.2" "rocm5.4" "rocm5.3" "rocm5.2" "rocm5.1.1" "rocm4.2" "rocm4.1" "rocm4.0.1" "xpu"] # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) + --allow-unsafe + --no-allow-unsafe + --reuse-hashes + --no-reuse-hashes + --resolver: words ["backtracking" "legacy"] + --max-rounds: text + --client-cert: text + --emit-trusted-host + --no-emit-trusted-host + --config: text + --no-config + --emit-options + --no-emit-options + --pip-args: text + --cert: path # Path to a PEM-encoded CA certificate bundle + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --help(-h) # Display the concise help for this command + ...src_file: path # Include the packages listed in the given files +] where { + at-most-one [--verbose --quiet] + overrides [--all-extras --no-all-extras] + overrides [--allow-unsafe --no-allow-unsafe] + overrides [--annotate --no-annotate] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--config --no-config] + overrides [--deps --no-deps] + overrides [--emit-build-options --no-emit-build-options] + overrides [--emit-find-links --no-emit-find-links] + overrides [--emit-index-annotation --no-emit-index-annotation] + overrides [--emit-index-url --no-emit-index-url] + overrides [--emit-marker-expression --no-emit-marker-expression] + overrides [--emit-options --no-emit-options] + overrides [--emit-trusted-host --no-emit-trusted-host] + overrides [--generate-hashes --no-generate-hashes] + overrides [--header --no-header] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--reuse-hashes --no-reuse-hashes] + overrides [--strip-extras --no-strip-extras] + overrides [--strip-markers --no-strip-markers] + overrides [--system --no-system] + overrides [--system-certs --no-system-certs] + overrides [--universal --no-universal] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--extra --all-extras] + at-most-one [--offline --refresh] + at-most-one [--system --python] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Uninstall packages from an environment - export extern "uv pip uninstall" [ - --requirements(-r): path # Uninstall the packages listed in the given files - --python(-p): string # The Python interpreter from which packages should be uninstalled. - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for remote requirements files - --system # Use the system Python to uninstall packages - --no-system - --break-system-packages # Allow uv to modify an `EXTERNALLY-MANAGED` Python installation - --no-break-system-packages - --target(-t): path # Uninstall packages from the specified `--target` directory - --prefix: path # Uninstall packages from the specified `--prefix` directory - --dry-run # Perform a dry run, i.e., don't actually uninstall anything but print the resulting plan - --yes(-y) # Don't ask for confirmation of uninstall deletions - --disable-pip-version-check - --cert: path # Path to a PEM-encoded CA certificate bundle - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...package: string@"nu-complete uv packages" # Uninstall all listed packages - ] +export complete [uv pip sync] [ + --constraints(-c): path # Constrain versions using the given requirements files + --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions + --extra: text # Include optional dependencies from the specified extra name; may be provided more than once + --all-extras # Include all optional dependencies + --no-all-extras + --group: by "nu-complete uv groups" # Install the specified dependency group from a `pylock.toml` or `pyproject.toml` + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: by "nu-complete uv packages" [group: --group] # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" [group: --group] # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" [group: --group] # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --require-hashes # Require a matching hash for each requirement + --no-require-hashes + --verify-hashes + --no-verify-hashes # Disable validation of hashes in the requirements file + --python(-p): text # The Python interpreter into which packages should be installed. + --system # Install packages into the system Python environment + --no-system + --break-system-packages # Allow uv to modify an `EXTERNALLY-MANAGED` Python installation + --no-break-system-packages + --target(-t): path # Install packages into the specified directory, rather than into the virtual or system Python environment. The packages will be installed at the top-level of the directory + --prefix: path # Install packages into `lib`, `bin`, and other top-level folders under the specified directory, as if a virtual environment were present at that location + --no-build # Don't build source distributions + --build + --no-binary: text # Don't install pre-built wheels + --only-binary: text # Only use pre-built wheels; don't build source distributions + --allow-empty-requirements # Allow sync of empty requirements, which will clear the environment of all packages + --no-allow-empty-requirements + --python-version: text # The minimum Python version that should be supported by the requirements (e.g., `3.7` or `3.7.9`) + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform for which requirements should be installed + --strict # Validate the Python environment after completing the installation, to detect packages with missing dependencies or other issues + --no-strict + --dry-run # Perform a dry run, i.e., don't actually install anything but resolve the dependencies and print the resulting plan + --torch-backend: words ["auto" "cpu" "cu132" "cu130" "cu129" "cu128" "cu126" "cu125" "cu124" "cu123" "cu122" "cu121" "cu120" "cu118" "cu117" "cu116" "cu115" "cu114" "cu113" "cu112" "cu111" "cu110" "cu102" "cu101" "cu100" "cu92" "cu91" "cu90" "cu80" "rocm7.2" "rocm7.1" "rocm7.0" "rocm6.4" "rocm6.3" "rocm6.2.4" "rocm6.2" "rocm6.1" "rocm6.0" "rocm5.7" "rocm5.6" "rocm5.5" "rocm5.4.2" "rocm5.4" "rocm5.3" "rocm5.2" "rocm5.1.1" "rocm4.2" "rocm4.1" "rocm4.0.1" "xpu"] # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) + --ask(-a) + --python-executable: text + --user + --client-cert: text + --config: text + --no-config + --pip-args: text + --cert: path # Path to a PEM-encoded CA certificate bundle + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --help(-h) # Display the concise help for this command + ...src_file: path # Include the packages listed in the given files +] where { + at-most-one [--verbose --quiet] + overrides [--all-extras --no-all-extras] + overrides [--allow-empty-requirements --no-allow-empty-requirements] + overrides [--break-system-packages --no-break-system-packages] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--config --no-config] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--reinstall --no-reinstall] + overrides [--require-hashes --no-require-hashes] + overrides [--strict --no-strict] + overrides [--system --no-system] + overrides [--system-certs --no-system-certs] + overrides [--verify-hashes --no-verify-hashes] + at-most-one [--quiet --verbose] + at-most-one [--extra --all-extras] + at-most-one [--offline --refresh] + at-most-one [--system --python] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # List, in requirements format, packages installed in an environment - export extern "uv pip freeze" [ - --exclude-editable # Exclude any editable packages from output - --exclude: string # Exclude the specified package(s) from the output - --strict # Validate the Python environment, to detect packages with missing dependencies and other issues - --no-strict - --python(-p): string # The Python interpreter for which packages should be listed. - --path: path # Restrict to the specified installation path for listing packages (can be used multiple times) - --system # List packages in the system Python environment - --no-system - --target(-t): path # List packages from the specified `--target` directory - --prefix: path # List packages from the specified `--prefix` directory - --disable-pip-version-check - --cert: path # Path to a PEM-encoded CA certificate bundle - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv pip install] [ + --requirements(-r): path # Install the packages listed in the given files + --editable(-e): text # Install the editable package based on the provided local file path + --no-editable # Install any editable dependencies as non-editable [env: UV_NO_EDITABLE=] + --no-editable-package: text # Install the specified editable packages as non-editable + --constraints(-c): path # Constrain versions using the given requirements files + --overrides: path # Override versions using the given requirements files + --excludes: path # Exclude packages from resolution using the given requirements files + --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building source distributions + --extra: text # Include optional dependencies from the specified extra name; may be provided more than once + --all-extras # Include all optional dependencies + --no-all-extras + --group: by "nu-complete uv groups" # Install the specified dependency group from a `pylock.toml` or `pyproject.toml` + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" [group: --group] # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: by "nu-complete uv packages" [group: --group] # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --reinstall # Reinstall all packages, regardless of whether they're already installed. Implies `--refresh` + --no-reinstall + --reinstall-package: by "nu-complete uv packages" [group: --group] # Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" [group: --group] # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --compile-bytecode # Compile Python files to bytecode after installation + --no-compile-bytecode + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" [group: --group] # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --no-deps # Ignore package dependencies, instead only installing those packages explicitly listed on the command line or in the requirements files + --deps + --require-hashes # Require a matching hash for each requirement + --no-require-hashes + --verify-hashes + --no-verify-hashes # Disable validation of hashes in the requirements file + --python(-p): text # The Python interpreter into which packages should be installed. + --system # Install packages into the system Python environment + --no-system + --break-system-packages # Allow uv to modify an `EXTERNALLY-MANAGED` Python installation + --no-break-system-packages + --target(-t): path # Install packages into the specified directory, rather than into the virtual or system Python environment. The packages will be installed at the top-level of the directory + --prefix: path # Install packages into `lib`, `bin`, and other top-level folders under the specified directory, as if a virtual environment were present at that location + --no-build # Don't build source distributions + --build + --no-binary: text # Don't install pre-built wheels + --only-binary: text # Only use pre-built wheels; don't build source distributions + --python-version: text # The minimum Python version that should be supported by the requirements (e.g., `3.7` or `3.7.9`) + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform for which requirements should be installed + --inexact # Do not remove extraneous packages present in the environment + --exact # Perform an exact sync, removing extraneous packages + --strict # Validate the Python environment after completing the installation, to detect packages with missing dependencies or other issues + --no-strict + --dry-run # Perform a dry run, i.e., don't actually install anything but resolve the dependencies and print the resulting plan + --torch-backend: words ["auto" "cpu" "cu132" "cu130" "cu129" "cu128" "cu126" "cu125" "cu124" "cu123" "cu122" "cu121" "cu120" "cu118" "cu117" "cu116" "cu115" "cu114" "cu113" "cu112" "cu111" "cu110" "cu102" "cu101" "cu100" "cu92" "cu91" "cu90" "cu80" "rocm7.2" "rocm7.1" "rocm7.0" "rocm6.4" "rocm6.3" "rocm6.2.4" "rocm6.2" "rocm6.1" "rocm6.0" "rocm5.7" "rocm5.6" "rocm5.5" "rocm5.4.2" "rocm5.4" "rocm5.3" "rocm5.2" "rocm5.1.1" "rocm4.2" "rocm4.1" "rocm4.0.1" "xpu"] # The backend to use when fetching packages in the PyTorch ecosystem (e.g., `cpu`, `cu126`, or `auto`) + --disable-pip-version-check + --user + --cert: path # Path to a PEM-encoded CA certificate bundle + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...package: by "nu-complete uv packages" [group: --group] # Install all listed packages +] where { + at-most-one [--verbose --quiet] + overrides [--all-extras --no-all-extras] + overrides [--break-system-packages --no-break-system-packages] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--compile-bytecode --no-compile-bytecode] + overrides [--deps --no-deps] + overrides [--editable --no-editable] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--reinstall --no-reinstall] + overrides [--require-hashes --no-require-hashes] + overrides [--strict --no-strict] + overrides [--system --no-system] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + overrides [--verify-hashes --no-verify-hashes] + at-most-one [--quiet --verbose] + at-most-one [--extra --all-extras] + at-most-one [--offline --refresh] + at-most-one [--system --python] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # List, in tabular format, packages installed in an environment - export extern "uv pip list" [ - --editable(-e) # Only include editable projects - --exclude-editable # Exclude any editable packages from output - --exclude: string # Exclude the specified package(s) from the output - --format: string@"nu-complete uv pip list format" # Select the output format - --outdated # List outdated packages - --no-outdated - --strict # Validate the Python environment, to detect packages with missing dependencies and other issues - --no-strict - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --python(-p): string # The Python interpreter for which packages should be listed. - --system # List packages in the system Python environment - --no-system - --target(-t): path # List packages from the specified `--target` directory - --prefix: path # List packages from the specified `--prefix` directory - --disable-pip-version-check - --cert: path # Path to a PEM-encoded CA certificate bundle - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv pip uninstall] [ + --requirements(-r): path # Uninstall the packages listed in the given files + --python(-p): text # The Python interpreter from which packages should be uninstalled. + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for remote requirements files + --system # Use the system Python to uninstall packages + --no-system + --break-system-packages # Allow uv to modify an `EXTERNALLY-MANAGED` Python installation + --no-break-system-packages + --target(-t): path # Uninstall packages from the specified `--target` directory + --prefix: path # Uninstall packages from the specified `--prefix` directory + --dry-run # Perform a dry run, i.e., don't actually uninstall anything but print the resulting plan + --yes(-y) # Don't ask for confirmation of uninstall deletions + --disable-pip-version-check + --cert: path # Path to a PEM-encoded CA certificate bundle + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...package: by "nu-complete uv packages" # Uninstall all listed packages +] where { + at-most-one [--verbose --quiet] + overrides [--break-system-packages --no-break-system-packages] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system --no-system] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--system --python] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Show information about one or more installed packages - export extern "uv pip show" [ - --strict # Validate the Python environment, to detect packages with missing dependencies and other issues - --no-strict - --files(-f) # Show the full list of installed files for each package - --python(-p): string # The Python interpreter to find the package in. - --system # Show a package in the system Python environment - --no-system - --target(-t): path # Show a package from the specified `--target` directory - --prefix: path # Show a package from the specified `--prefix` directory - --disable-pip-version-check - --cert: path # Path to a PEM-encoded CA certificate bundle - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...package: string@"nu-complete uv packages" # The package(s) to display - ] +export complete [uv pip freeze] [ + --exclude-editable # Exclude any editable packages from output + --exclude: text # Exclude the specified package(s) from the output + --strict # Validate the Python environment, to detect packages with missing dependencies and other issues + --no-strict + --python(-p): text # The Python interpreter for which packages should be listed. + --path: path # Restrict to the specified installation path for listing packages (can be used multiple times) + --system # List packages in the system Python environment + --no-system + --target(-t): path # List packages from the specified `--target` directory + --prefix: path # List packages from the specified `--prefix` directory + --disable-pip-version-check + --cert: path # Path to a PEM-encoded CA certificate bundle + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--strict --no-strict] + overrides [--system --no-system] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--system --python] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Display the dependency tree for an environment - export extern "uv pip tree" [ - --show-version-specifiers # Show the version constraint(s) imposed on each package - --depth(-d): string # Maximum display depth of the dependency tree - --prune: string@"nu-complete uv packages" # Prune the given package from the display of the dependency tree - --package: string@"nu-complete uv packages" # Display only the specified packages - --no-dedupe # Do not de-duplicate repeated dependencies. Usually, when a package has already displayed its dependencies, further occurrences will not re-display its dependencies, and will include a (*) to indicate it has already been shown. This flag will cause those duplicates to be repeated - --invert # Show the reverse dependencies for the given package. This flag will invert the tree and display the packages that depend on the given package - --outdated # Show the latest available version of each package in the tree - --show-sizes # Show compressed wheel sizes for packages in the tree - --strict # Validate the Python environment, to detect packages with missing dependencies and other issues - --no-strict - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --python(-p): string # The Python interpreter for which packages should be listed. - --system # List packages in the system Python environment - --no-system - --disable-pip-version-check - --cert: path # Path to a PEM-encoded CA certificate bundle - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv pip list] [ + --editable(-e) # Only include editable projects + --exclude-editable # Exclude any editable packages from output + --exclude: text # Exclude the specified package(s) from the output + --format: words ["columns" "freeze" "json"] # Select the output format + --outdated # List outdated packages + --no-outdated + --strict # Validate the Python environment, to detect packages with missing dependencies and other issues + --no-strict + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: text # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --python(-p): text # The Python interpreter for which packages should be listed. + --system # List packages in the system Python environment + --no-system + --target(-t): path # List packages from the specified `--target` directory + --prefix: path # List packages from the specified `--prefix` directory + --disable-pip-version-check + --cert: path # Path to a PEM-encoded CA certificate bundle + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--outdated --no-outdated] + overrides [--preview --no-preview] + overrides [--strict --no-strict] + overrides [--system --no-system] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--system --python] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Verify installed packages have compatible dependencies - export extern "uv pip check" [ - --python(-p): string # The Python interpreter for which packages should be checked. - --system # Check packages in the system Python environment - --no-system - --python-version: string # The Python version against which packages should be checked - --python-platform: string@"nu-complete uv python_platform" # The platform for which packages should be checked - --cert: path # Path to a PEM-encoded CA certificate bundle - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv pip show] [ + --strict # Validate the Python environment, to detect packages with missing dependencies and other issues + --no-strict + --files(-f) # Show the full list of installed files for each package + --python(-p): text # The Python interpreter to find the package in. + --system # Show a package in the system Python environment + --no-system + --target(-t): path # Show a package from the specified `--target` directory + --prefix: path # Show a package from the specified `--prefix` directory + --disable-pip-version-check + --cert: path # Path to a PEM-encoded CA certificate bundle + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...package: by "nu-complete uv packages" # The package(s) to display +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--strict --no-strict] + overrides [--system --no-system] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--system --python] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Display debug information (unsupported) - export extern "uv pip debug" [ - --platform: string - --python-version: string - --implementation: string - --abi: string - --cert: path # Path to a PEM-encoded CA certificate bundle - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv pip tree] [ + --show-version-specifiers # Show the version constraint(s) imposed on each package + --depth(-d): text # Maximum display depth of the dependency tree + --prune: by "nu-complete uv packages" # Prune the given package from the display of the dependency tree + --package: by "nu-complete uv packages" # Display only the specified packages + --no-dedupe # Do not de-duplicate repeated dependencies. Usually, when a package has already displayed its dependencies, further occurrences will not re-display its dependencies, and will include a (*) to indicate it has already been shown. This flag will cause those duplicates to be repeated + --invert # Show the reverse dependencies for the given package. This flag will invert the tree and display the packages that depend on the given package + --outdated # Show the latest available version of each package in the tree + --show-sizes # Show compressed wheel sizes for packages in the tree + --strict # Validate the Python environment, to detect packages with missing dependencies and other issues + --no-strict + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: text # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --python(-p): text # The Python interpreter for which packages should be listed. + --system # List packages in the system Python environment + --no-system + --disable-pip-version-check + --cert: path # Path to a PEM-encoded CA certificate bundle + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--strict --no-strict] + overrides [--system --no-system] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--system --python] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Create a virtual environment - export extern "uv venv" [ - --python(-p): string # The Python interpreter to use for the virtual environment. - --system # Ignore virtual environments when searching for the Python interpreter - --no-system # This flag is included for compatibility only, it has no effect - --no-project # Avoid discovering a project or workspace - --seed # Install seed packages (one or more of: `pip`, `setuptools`, and `wheel`) into the virtual environment [env: UV_VENV_SEED=] - --clear(-c) # Remove any existing files or directories at the target path [env: UV_VENV_CLEAR=] - --force # Allow `--clear` to remove a non-virtual environment directory - --no-clear # Fail without prompting if any existing files or directories are present at the target path - --allow-existing # Preserve any existing files or directories at the target path - --prompt: string # Provide an alternative prompt prefix for the virtual environment. - --system-site-packages # Give the virtual environment access to the system site packages directory - --relocatable # Make the virtual environment relocatable [env: UV_VENV_RELOCATABLE=] - --no-relocatable # Don't make the virtual environment relocatable - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --no-seed - --no-pip - --no-setuptools - --no-wheel - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - path?: path # The path to the virtual environment to create - ] +export complete [uv pip check] [ + --python(-p): text # The Python interpreter for which packages should be checked. + --system # Check packages in the system Python environment + --no-system + --python-version: text # The Python version against which packages should be checked + --python-platform: words ["windows" "linux" "macos" "x86_64-pc-windows-msvc" "aarch64-pc-windows-msvc" "i686-pc-windows-msvc" "x86_64-unknown-linux-gnu" "aarch64-apple-darwin" "x86_64-apple-darwin" "aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl" "riscv64-unknown-linux" "x86_64-manylinux2014" "x86_64-manylinux_2_17" "x86_64-manylinux_2_28" "x86_64-manylinux_2_31" "x86_64-manylinux_2_32" "x86_64-manylinux_2_33" "x86_64-manylinux_2_34" "x86_64-manylinux_2_35" "x86_64-manylinux_2_36" "x86_64-manylinux_2_37" "x86_64-manylinux_2_38" "x86_64-manylinux_2_39" "x86_64-manylinux_2_40" "aarch64-manylinux2014" "aarch64-manylinux_2_17" "aarch64-manylinux_2_28" "aarch64-manylinux_2_31" "aarch64-manylinux_2_32" "aarch64-manylinux_2_33" "aarch64-manylinux_2_34" "aarch64-manylinux_2_35" "aarch64-manylinux_2_36" "aarch64-manylinux_2_37" "aarch64-manylinux_2_38" "aarch64-manylinux_2_39" "aarch64-manylinux_2_40" "aarch64-linux-android" "x86_64-linux-android" "wasm32-pyodide2024" "wasm32-pyodide2025" "arm64-apple-ios" "arm64-apple-ios-simulator" "x86_64-apple-ios-simulator"] # The platform for which packages should be checked + --cert: path # Path to a PEM-encoded CA certificate bundle + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system --no-system] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--system --python] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Build Python packages into source distributions and wheels - export extern "uv build" [ - --package: string # Build a specific package in the workspace - --all-packages # Builds all packages in the workspace - --out-dir(-o): path # The output directory to which distributions should be written - --sdist # Build a source distribution ("sdist") from the given directory - --wheel # Build a binary distribution ("wheel") from the given directory - --list # When using the uv build backend, list the files that would be included when building - --build-logs - --no-build-logs # Hide logs from the build backend - --force-pep517 # Always build through PEP 517, don't use the fast path for the uv build backend - --clear # Clear the output directory before the build, removing stale artifacts - --create-gitignore - --no-create-gitignore # Do not create a `.gitignore` file in the output directory - --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building distributions - --require-hashes # Require a matching hash for each requirement - --no-require-hashes - --verify-hashes - --no-verify-hashes # Disable validation of hashes in the requirements file - --python(-p): string # The Python interpreter to use for the build environment. - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string@"nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string@"nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string@"nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string@"nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string@"nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - src?: path # The directory from which distributions should be built, or a source distribution archive to build into a wheel - ] +export complete [uv pip debug] [ + --platform: text + --python-version: text + --implementation: text + --abi: text + --cert: path # Path to a PEM-encoded CA certificate bundle + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Upload distributions to an index - export extern "uv publish" [ - --index: string # The name of an index in the configuration to use for publishing. - --username(-u): string # The username for the upload - --password(-p): string # The password for the upload - --token(-t): string # The token for the upload - --trusted-publishing: string@"nu-complete uv publish trusted_publishing" # Configure trusted publishing - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for remote requirements files - --publish-url: string # The URL of the upload endpoint (not the index URL) - --check-url: string # Check an index URL for existing files to skip duplicate uploads - --skip-existing - --dry-run # Perform a dry run without uploading files - --no-attestations # Do not upload attestations for the published files - --direct # Use direct upload to the registry - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...files: path # Paths to the files to upload. Accepts glob expressions - ] +export complete [uv venv] [ + --python(-p): text # The Python interpreter to use for the virtual environment. + --system # Ignore virtual environments when searching for the Python interpreter + --no-system # This flag is included for compatibility only, it has no effect + --no-project # Avoid discovering a project or workspace + --seed # Install seed packages (one or more of: `pip`, `setuptools`, and `wheel`) into the virtual environment [env: UV_VENV_SEED=] + --clear(-c) # Remove any existing files or directories at the target path [env: UV_VENV_CLEAR=] + --force # Allow `--clear` to remove a non-virtual environment directory + --no-clear # Fail without prompting if any existing files or directories are present at the target path + --allow-existing # Preserve any existing files or directories at the target path + --prompt: text # Provide an alternative prompt prefix for the virtual environment. + --system-site-packages # Give the virtual environment access to the system site packages directory + --relocatable # Make the virtual environment relocatable [env: UV_VENV_RELOCATABLE=] + --no-relocatable # Don't make the virtual environment relocatable + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: text # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --no-seed + --no-pip + --no-setuptools + --no-wheel + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + path?: path # The path to the virtual environment to create +] where { + at-most-one [--verbose --quiet] + overrides [--clear --no-clear] + overrides [--color --no-color] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--project --no-project] + overrides [--refresh --no-refresh] + overrides [--relocatable --no-relocatable] + overrides [--seed --no-seed] + overrides [--system --no-system] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--offline --refresh] + at-most-one [--system --python] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Inspect uv workspaces - export extern "uv workspace" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv build] [ + --package: text # Build a specific package in the workspace + --all-packages # Builds all packages in the workspace + --out-dir(-o): path # The output directory to which distributions should be written + --sdist # Build a source distribution ("sdist") from the given directory + --wheel # Build a binary distribution ("wheel") from the given directory + --list # When using the uv build backend, list the files that would be included when building + --build-logs + --no-build-logs # Hide logs from the build backend + --force-pep517 # Always build through PEP 517, don't use the fast path for the uv build backend + --clear # Clear the output directory before the build, removing stale artifacts + --create-gitignore + --no-create-gitignore # Do not create a `.gitignore` file in the output directory + --build-constraints(-b): path # Constrain build dependencies using the given requirements files when building distributions + --require-hashes # Require a matching hash for each requirement + --no-require-hashes + --verify-hashes + --no-verify-hashes # Disable validation of hashes in the requirements file + --python(-p): text # The Python interpreter to use for the build environment. + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): by "nu-complete uv packages" # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: text # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: by "nu-complete uv packages" # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: by "nu-complete uv packages" # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: by "nu-complete uv packages" # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: by "nu-complete uv packages" # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + src?: path # The directory from which distributions should be built, or a source distribution archive to build into a wheel +] where { + at-most-one [--verbose --quiet] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--build-logs --no-build-logs] + overrides [--color --no-color] + overrides [--create-gitignore --no-create-gitignore] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--require-hashes --no-require-hashes] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + overrides [--verify-hashes --no-verify-hashes] + at-most-one [--quiet --verbose] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--package --all-packages] + at-most-one [--color --no-color] + terminal [--help] +} - # View metadata about the current workspace - export extern "uv workspace metadata" [ - --script: path # View metadata for the specified PEP 723 Python script, rather than the current workspace - --locked # Check if the lockfile is up-to-date [env: UV_LOCKED=] - --frozen # Assert that a `uv.lock` exists without checking if it is up-to-date [env: UV_FROZEN=] - --dry-run # Perform a dry run, without writing the lockfile - --index: string # The indexes to use when resolving dependencies, in addition to the default index - --default-index: string # The default package index (by default: <https://pypi.org/simple>) - --find-links(-f): string # Locations to search for candidate distributions, in addition to those found in the registry indexes - --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` - --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` - --no-upgrade - --upgrade-package(-P): string # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` - --upgrade-group: string # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file - --index-strategy: string@"nu-complete uv index_strategy" # The strategy to use when resolving against multiple index URLs - --keyring-provider: string@"nu-complete uv keyring_provider" # Attempt to use `keyring` for authentication for index URLs - --resolution: string@"nu-complete uv resolution" # The strategy to use when selecting between the different compatible versions for a given package requirement - --prerelease: string@"nu-complete uv prerelease" # The strategy to use when considering pre-release versions - --prerelease-package: string # The strategy to use when considering pre-release versions for a specific package - --pre - --fork-strategy: string@"nu-complete uv fork_strategy" # The strategy to use when selecting multiple versions of a given package across Python versions and platforms - --config-setting(-C): string # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs - --config-settings-package: string # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs - --no-build-isolation # Disable isolation when building source distributions - --build-isolation - --no-build-isolation-package: string # Disable isolation when building source distributions for a specific package - --exclude-newer: string # Limit candidate packages to those that were uploaded prior to the given date - --exclude-newer-package: string # Limit candidate packages for specific packages to those that were uploaded prior to the given date - --link-mode: string@"nu-complete uv link_mode" # The method to use when installing packages from the global cache - --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources - --no-sources-package: string # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] - --no-build # Don't build source distributions - --build - --no-build-package: string # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] - --no-binary # Don't install pre-built wheels - --binary - --no-binary-package: string # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] - --refresh # Refresh all cached data - --no-refresh - --refresh-package: string # Refresh cached data for a specific package - --sync # Sync the environment to include module ownership metadata in the output - --active # Sync dependencies to the active virtual environment - --python(-p): string # The Python interpreter to use during resolution. - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv publish] [ + --index: text # The name of an index in the configuration to use for publishing. + --username(-u): text # The username for the upload + --password(-p): text # The password for the upload + --token(-t): text # The token for the upload + --trusted-publishing: words ["automatic" "always" "never"] # Configure trusted publishing + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for remote requirements files + --publish-url: text # The URL of the upload endpoint (not the index URL) + --check-url: text # Check an index URL for existing files to skip duplicate uploads + --skip-existing + --dry-run # Perform a dry run without uploading files + --no-attestations # Do not upload attestations for the published files + --direct # Use direct upload to the registry + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...files: path # Paths to the files to upload. Accepts glob expressions +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Display the path of a workspace member - export extern "uv workspace dir" [ - --package: string # Display the path to a specific package in the workspace - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv workspace] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # List the members of a workspace - export extern "uv workspace list" [ - --paths # Show paths instead of names - --scripts # List all standalone scripts with inline metadata in the workspace - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv workspace metadata] [ + --script: path # View metadata for the specified PEP 723 Python script, rather than the current workspace + --locked # Check if the lockfile is up-to-date [env: UV_LOCKED=] + --frozen # Assert that a `uv.lock` exists without checking if it is up-to-date [env: UV_FROZEN=] + --dry-run # Perform a dry run, without writing the lockfile + --index: text # The indexes to use when resolving dependencies, in addition to the default index + --default-index: text # The default package index (by default: <https://pypi.org/simple>) + --find-links(-f): text # Locations to search for candidate distributions, in addition to those found in the registry indexes + --no-index # Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via `--find-links` + --upgrade(-U) # Allow package upgrades, ignoring pinned versions in any existing output file. Implies `--refresh` + --no-upgrade + --upgrade-package(-P): text # Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies `--refresh-package` + --upgrade-group: text # Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file + --index-strategy: words ["first-index" "unsafe-first-match" "unsafe-best-match"] # The strategy to use when resolving against multiple index URLs + --keyring-provider: words ["disabled" "subprocess"] # Attempt to use `keyring` for authentication for index URLs + --resolution: words ["highest" "lowest" "lowest-direct"] # The strategy to use when selecting between the different compatible versions for a given package requirement + --prerelease: words ["disallow" "allow" "if-necessary" "explicit" "if-necessary-or-explicit"] # The strategy to use when considering pre-release versions + --prerelease-package: text # The strategy to use when considering pre-release versions for a specific package + --pre + --fork-strategy: words ["fewest" "requires-python"] # The strategy to use when selecting multiple versions of a given package across Python versions and platforms + --config-setting(-C): text # Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs + --config-settings-package: text # Settings to pass to the PEP 517 build backend for a specific package, specified as `PACKAGE:KEY=VALUE` pairs + --no-build-isolation # Disable isolation when building source distributions + --build-isolation + --no-build-isolation-package: text # Disable isolation when building source distributions for a specific package + --exclude-newer: text # Limit candidate packages to those that were uploaded prior to the given date + --exclude-newer-package: text # Limit candidate packages for specific packages to those that were uploaded prior to the given date + --link-mode: words ["clone" "copy" "hardlink" "symlink"] # The method to use when installing packages from the global cache + --no-sources # Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources + --no-sources-package: text # Don't use sources from the `tool.uv.sources` table for the specified packages [env: `UV_NO_SOURCES_PACKAGE`=] + --no-build # Don't build source distributions + --build + --no-build-package: text # Don't build source distributions for a specific package [env: `UV_NO_BUILD_PACKAGE`=] + --no-binary # Don't install pre-built wheels + --binary + --no-binary-package: text # Don't install pre-built wheels for a specific package [env: `UV_NO_BINARY_PACKAGE`=] + --refresh # Refresh all cached data + --no-refresh + --refresh-package: text # Refresh cached data for a specific package + --sync # Sync the environment to include module ownership metadata in the output + --active # Sync dependencies to the active virtual environment + --python(-p): text # The Python interpreter to use during resolution. + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + at-most-one [--locked --frozen] + overrides [--binary --no-binary] + overrides [--build --no-build] + overrides [--build-isolation --no-build-isolation] + overrides [--color --no-color] + overrides [--index --no-index] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--refresh --no-refresh] + overrides [--system-certs --no-system-certs] + overrides [--upgrade --no-upgrade] + at-most-one [--quiet --verbose] + at-most-one [--offline --refresh] + at-most-one [--managed-python --no-managed-python] + at-most-one [--script --project] + at-most-one [--color --no-color] + terminal [--help] +} - # The implementation of the build backend - export extern "uv build-backend" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv workspace dir] [ + --package: text # Display the path to a specific package in the workspace + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # PEP 517 hook `build_sdist` - export extern "uv build-backend build-sdist" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - sdist_directory: path - ] +export complete [uv workspace list] [ + --paths # Show paths instead of names + --scripts # List all standalone scripts with inline metadata in the workspace + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # PEP 517 hook `build_wheel` - export extern "uv build-backend build-wheel" [ - --metadata-directory: path - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - wheel_directory: path - ] +export complete [uv build-backend] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # PEP 660 hook `build_editable` - export extern "uv build-backend build-editable" [ - --metadata-directory: path - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - wheel_directory: path - ] +export complete [uv build-backend build-sdist] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + sdist_directory: path +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # PEP 517 hook `get_requires_for_build_sdist` - export extern "uv build-backend get-requires-for-build-sdist" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv build-backend build-wheel] [ + --metadata-directory: path + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + wheel_directory: path +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # PEP 517 hook `get_requires_for_build_wheel` - export extern "uv build-backend get-requires-for-build-wheel" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv build-backend build-editable] [ + --metadata-directory: path + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + wheel_directory: path +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # PEP 517 hook `prepare_metadata_for_build_wheel` - export extern "uv build-backend prepare-metadata-for-build-wheel" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - wheel_directory: path - ] +export complete [uv build-backend get-requires-for-build-sdist] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # PEP 660 hook `get_requires_for_build_editable` - export extern "uv build-backend get-requires-for-build-editable" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv build-backend get-requires-for-build-wheel] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # PEP 660 hook `prepare_metadata_for_build_editable` - export extern "uv build-backend prepare-metadata-for-build-editable" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - wheel_directory: path - ] +export complete [uv build-backend prepare-metadata-for-build-wheel] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + wheel_directory: path +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Manage uv's cache - export extern "uv cache" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv build-backend get-requires-for-build-editable] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Clear the cache, removing all entries or those linked to specific packages - export extern "uv cache clean" [ - --force # Force removal of the cache, ignoring in-use checks - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...package: string # The packages to remove from the cache - ] +export complete [uv build-backend prepare-metadata-for-build-editable] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + wheel_directory: path +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Prune dangling cache entries and cached environments - export extern "uv cache prune" [ - --ci # Optimize the cache for persistence in a continuous integration environment, like GitHub Actions - --force # Force removal of the cache, ignoring in-use checks - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv cache] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Show the cache directory - export extern "uv cache dir" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv cache clean] [ + --force # Force removal of the cache, ignoring in-use checks + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...package: text # The packages to remove from the cache +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Show the cache size - export extern "uv cache size" [ - --output-format: string@"nu-complete uv cache size output_format" # Select the output format - --human(-H) # Display the cache size in human-readable format (e.g., `1.2GiB` instead of raw bytes) - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv cache prune] [ + --ci # Optimize the cache for persistence in a continuous integration environment, like GitHub Actions + --force # Force removal of the cache, ignoring in-use checks + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Manage the uv executable - export extern "uv self" [ - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv cache dir] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Update uv - export extern "uv self update" [ - --token: string # A GitHub token for authentication. A token is not required but can be used to reduce the chance of encountering rate limits - --dry-run # Run without performing the update - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - target_version?: string # Update to the specified version. If not provided, uv will update to the latest version - ] +export complete [uv cache size] [ + --output-format: words ["auto" "human" "machine"] # Select the output format + --human(-H) # Display the cache size in human-readable format (e.g., `1.2GiB` instead of raw bytes) + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Display uv's version - export extern "uv self version" [ - --short # Only print the version - --output-format: string@"nu-complete uv output_format" - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ] +export complete [uv self] [ + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Clear the cache, removing all entries or those linked to specific packages - export extern "uv clean" [ - --force # Force removal of the cache, ignoring in-use checks - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...package: string # The packages to remove from the cache - ] +export complete [uv self update] [ + --token: text # A GitHub token for authentication. A token is not required but can be used to reduce the chance of encountering rate limits + --dry-run # Run without performing the update + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + target_version?: text # Update to the specified version. If not provided, uv will update to the latest version +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Generate shell completion - export extern "uv generate-shell-completion" [ - --no-cache(-n) - --cache-dir: path - --python-preference: string@"nu-complete uv python_preference" - --no-python-downloads - --quiet(-q) - --verbose(-v) - --color: string@"nu-complete uv color" - --offline - --no-progress - --config-file: path - --no-config - --help(-h) - --version(-V) - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-color # Disable colors - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - shell: string@"nu-complete uv shell" # The shell to generate the completion script for - ] +export complete [uv self version] [ + --short # Only print the version + --output-format: words ["text" "json"] + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} - # Display documentation for a command - export extern "uv help" [ - --no-pager # Disable pager when printing help - --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation - --cache-dir: path # Path to the cache directory - --python-preference: string@"nu-complete uv python_preference" - --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] - --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] - --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] - --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] - --quiet(-q) # Use quiet output - --verbose(-v) # Use verbose output - --no-color # Disable colors - --color: string@"nu-complete uv color" # Control the use of color in output - --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] - --no-system-certs - --offline # Disable network access [env: UV_OFFLINE=] - --no-offline - --allow-insecure-host: string # Allow insecure connections to a host - --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] - --no-preview - --preview-features: string # Enable experimental preview features - --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] - --show-settings # Show the resolved settings for the current command - --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] - --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] - --directory: path # Change to the given directory prior to running the command - --project: path # Discover a project in the given directory - --config-file: path # The path to a `uv.toml` file to use for configuration - --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) - --help(-h) # Display the concise help for this command - ...command: string - ] +export complete [uv clean] [ + --force # Force removal of the cache, ignoring in-use checks + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...package: text # The packages to remove from the cache +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} +export complete [uv generate-shell-completion] [ + --no-cache(-n) + --cache-dir: path + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --no-python-downloads + --quiet(-q) + --verbose(-v) + --color: words ["auto" "always" "never"] + --offline + --no-progress + --config-file: path + --no-config + --help(-h) + --version(-V) + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-color # Disable colors + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + shell: words ["bash" "elvish" "fish" "nushell" "powershell" "zsh"] # The shell to generate the completion script for +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help --version] } -export use completions * +export complete [uv help] [ + --no-pager # Disable pager when printing help + --no-cache(-n) # Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation + --cache-dir: path # Path to the cache directory + --python-preference: words ["only-managed" "managed" "system" "only-system"] + --managed-python # Require use of uv-managed Python versions [env: UV_MANAGED_PYTHON=] + --no-managed-python # Disable use of uv-managed Python versions [env: UV_NO_MANAGED_PYTHON=] + --allow-python-downloads # Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] + --no-python-downloads # Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] + --quiet(-q) # Use quiet output + --verbose(-v) # Use verbose output + --no-color # Disable colors + --color: words ["auto" "always" "never"] # Control the use of color in output + --system-certs # Whether to load TLS certificates from the platform's native certificate store [env: UV_SYSTEM_CERTS=] + --no-system-certs + --offline # Disable network access [env: UV_OFFLINE=] + --no-offline + --allow-insecure-host: text # Allow insecure connections to a host + --preview # Whether to enable all experimental preview features [env: UV_PREVIEW=] + --no-preview + --preview-features: text # Enable experimental preview features + --isolated # Avoid discovering a `pyproject.toml` or `uv.toml` file [env: UV_ISOLATED=] + --show-settings # Show the resolved settings for the current command + --no-progress # Hide all progress outputs [env: UV_NO_PROGRESS=] + --no-installer-metadata # Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories [env: UV_NO_INSTALLER_METADATA=] + --directory: dir cwd # Change to the given directory prior to running the command + --project: path # Discover a project in the given directory + --config-file: path # The path to a `uv.toml` file to use for configuration + --no-config # Avoid discovering configuration files (`pyproject.toml`, `uv.toml`) + --help(-h) # Display the concise help for this command + ...command: words [auth run init add remove version sync lock export tree format audit tool python pip venv build publish cache self generate-shell-completion help] +] where { + at-most-one [--verbose --quiet] + overrides [--color --no-color] + overrides [--managed-python --no-managed-python] + overrides [--offline --no-offline] + overrides [--preview --no-preview] + overrides [--system-certs --no-system-certs] + at-most-one [--quiet --verbose] + at-most-one [--managed-python --no-managed-python] + at-most-one [--color --no-color] + terminal [--help] +} diff --git a/custom-completions/virsh/virsh-completions.nu b/custom-completions/virsh/virsh-completions.nu index 13b2a91b2..41f2fb64c 100644 --- a/custom-completions/virsh/virsh-completions.nu +++ b/custom-completions/virsh/virsh-completions.nu @@ -1,2164 +1,955 @@ -# Specify hypervisor connection URI -extern "virsh" [ - - ...args -] - -# Attach device from an XML file -extern "virsh attach-device" [ - --persistent # Make live change persistent - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Attach disk device -extern "virsh attach-disk" [ - --targetbus # Target bus of disk device - --driver # Driver of disk device - --subdriver # Subdriver of disk device - --iothread # IOThread to be used by supported device - --cache # Cache mode of disk device - --io # IO policy of disk device - --type # Target device type - --mode # Mode of device reading and writing - --serial # Serial of disk device - --wwn # Wwn of disk device - --rawio # Needs rawio capability - --address # Address of disk device - --multifunction # Use multifunction pci under specified address - --print-xml # Print XML document rather than attach the disk - --persistent # Make live change persistent - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Attach network interface -extern "virsh attach-interface" [ - --target # Target network name - --mac # MAC address - --script # Script used to bridge network interface - --model # Model type - --inbound # Control domain's incoming traffics - --outbound # Control domain's outgoing traffics - --persistent # Make live change persistent - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - --print-xml # Print XML document rather than attach the interface - --managed # Libvirt will automatically detach/attach the device from/to host - ...args -] - -# Autostart a domain -extern "virsh autostart" [ - --disable # Disable autostarting - --disable # Disable autostarting - --disable # Disable autostarting - ...args -] - -# Set or query a block device I/O tuning parameters -extern "virsh blkdeviotune" [ - --total-bytes-sec # Total throughput limit, as scaled integer (default bytes) - --read-bytes-sec # Read throughput limit, as scaled integer (default bytes) - --write-bytes-sec # Write throughput limit, as scaled integer (default bytes) - --total-iops-sec # Total I/O operations limit per second - --read-iops-sec # Read I/O operations limit per second - --write-iops-sec # Write I/O operations limit per second - --total-bytes-sec-max # Total max, as scaled integer (default bytes) - --read-bytes-sec-max # Read max, as scaled integer (default bytes) - --write-bytes-sec-max # Write max, as scaled integer (default bytes) - --total-iops-sec-max # Total I/O operations max - --read-iops-sec-max # Read I/O operations max - --write-iops-sec-max # Write I/O operations max - --size-iops-sec # I/O size in bytes - --group-name # Group name to share I/O quota between multiple drives - --total-bytes-sec-max-length # Duration in seconds to allow total max bytes - --read-bytes-sec-max-length # Duration in seconds to allow read max bytes - --write-bytes-sec-max-length # Duration in seconds to allow write max bytes - --total-iops-sec-max-length # Duration in seconds to allow total I/O operations max - --read-iops-sec-max-length # Duration in seconds to allow read I/O operations max - --write-iops-sec-max-length # Duration in seconds to allow write I/O operations max - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Get or set blkio parameters -extern "virsh blkiotune" [ - --weight # IO Weight - --device-weights # Per-device IO Weights, in the form of /path/to/device,weight,... - --device-read-iops-sec # Per-device read I/O limit per second, in the form of /path/to/device,read_iops_sec,... - --device-write-iops-sec # Per-device write I/O limit per second, in the form of /path/to/device,write_iops_sec,... - --device-read-bytes-sec # Per-device bytes read per second, in the form of /path/to/device,read_bytes_sec,... - --device-write-bytes-sec # Per-device bytes wrote per second, in the form of /path/to/device,write_bytes_sec,... - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Start a block commit operation -extern "virsh blockcommit" [ - --bandwidth # Bandwidth limit in MiB/s - --base # Path of base file to commit into (default bottom of chain) - --shallow # Use backing file of top as base - --top # Path of top file to commit from (default top of chain) - --active # Trigger two-stage active commit of top file - --delete # Delete files that were successfully committed - --wait # Wait for job to complete (with --active, wait for job to sync) - --verbose # With --wait, display the progress - --timeout # Implies --wait, abort if copy exceeds timeout (in seconds) - --pivot # Implies --active --wait, pivot when commit is synced - --keep-overlay # Implies --active --wait, quit when commit is synced - --async # With --wait, don't wait for cancel to finish - --keep-relative # Keep the backing chain relatively referenced - --bytes # The bandwidth limit is in bytes/s rather than MiB/s - ...args -] - -# Start a block copy operation -extern "virsh blockcopy" [ - --dest # Path of the copy to create - --bandwidth # Bandwidth limit in MiB/s - --shallow # Make the copy share a backing chain - --reuse-external # Reuse existing destination - --blockdev # Copy destination is block device instead of regular file - --wait # Wait for job to reach mirroring phase - --verbose # With --wait, display the progress - --timeout # Implies --wait, abort if copy exceeds timeout (in seconds) - --pivot # Implies --wait, pivot when mirroring starts - --finish # Implies --wait, quit when mirroring starts - --async # With --wait, don't wait for cancel to finish - --xml # Filename containing XML description of the copy destination - --format # Format of the destination file - --granularity # Power-of-two granularity to use during the copy - --buf-size # Maximum amount of in-flight data during the copy - --bytes # The bandwidth limit is in bytes/s rather than MiB/s - --transient-job # The copy job is not persisted if VM is turned off - ...args -] - -# Manage active block operations -extern "virsh blockjob" [ - --abort # Abort the active job on the specified disk - --async # Implies --abort; request but don't wait for job end - --pivot # Implies --abort; conclude and pivot a copy or commit job - --info # Get active job information for the specified disk - --bytes # Get/set bandwidth in bytes rather than MiB/s - --raw # Implies --info; output details rather than human summary - --bandwidth # Set the bandwidth limit in MiB/s - ...args -] - -# Populate a disk from its backing image -extern "virsh blockpull" [ - --bandwidth # Bandwidth limit in MiB/s - --base # Path of backing file in chain for a partial pull - --wait # Wait for job to finish - --verbose # With --wait, display the progress - --timeout # With --wait, abort if pull exceeds timeout (in seconds) - --async # With --wait, don't wait for cancel to finish - --keep-relative # Keep the backing chain relatively referenced - --bytes # The bandwidth limit is in bytes/s rather than MiB/s - ...args -] - -# Resize block device of domain -extern "virsh blockresize" [ - - ...args -] - -# Change media of CD or floppy drive -extern "virsh change-media" [ - --source # Source of the media - --eject # Eject the media - --insert # Insert the media - --update # Update the media - --current # Alter live or persistent configuration of domain depending on hypervisor driver - --live # Alter live configuration of running domain - --config # Alter persistent configuration, effect observed on next boot - --force # Force media changing - --print-xml # Print XML document rather than change media - --block # Source media is a block device - ...args -] - -# Connect to the guest console -extern "virsh console" [ - --devname # Character device name - --force # Force console connection (disconnect already connected sessions) - --safe # Only connect if safe console handling is supported - ...args -] - -# Compute baseline CPU -extern "virsh cpu-baseline" [ - --features # Show features that are part of the CPU model type - --migratable # Do not include features that block migration - ...args -] - -# Compare host CPU with a CPU described by an XML file -extern "virsh cpu-compare" [ - --error # Report error if CPUs are incompatible - ...args -] - -# Show domain cpu statistics -extern "virsh cpu-stats" [ - --total # Show total statistics only - --start # Show statistics from this CPU - --count # Number of shown CPUs at most - ...args -] - -# Create a domain from an XML file -extern "virsh create" [ - --console # Attach to console after creation - --paused # Leave the guest paused after creation - --autodestroy # Automatically destroy the guest when virsh disconnects - --pass-fds # Pass file descriptors N,M,... to the guest - --validate # Validate the XML against the schema - --xmlfile # Domain snapshot XML - --redefine # Redefine metadata for existing snapshot - --current # With redefine, set current snapshot - --no-metadata # Take snapshot but create no metadata - --halt # Halt domain after snapshot is created - --disk-only # Capture disk state but not vm state - --reuse-external # Reuse any existing external files - --quiesce # Quiesce guest's file systems - --atomic # Require atomic operation - --live # Take a live snapshot - --name # Name of snapshot - --description # Description of snapshot - --print-xml # Print XML document rather than create - --no-metadata # Take snapshot but create no metadata - --halt # Halt domain after snapshot is created - --disk-only # Capture disk state but not vm state - --reuse-external # Reuse any existing external files - --quiesce # Quiesce guest's file systems - --atomic # Require atomic operation - --live # Take a live snapshot - --memspec # Memory attributes: [file=]name[,snapshot=type] - --print-xml # Print XML document, but don't define/create - --source-host # Source-host for underlying storage - --source-path # Source path for underlying storage - --source-dev # Source device for underlying storage - --source-name # Source name for underlying storage - --target # Target for underlying storage - --source-format # Format for underlying storage - --auth-type # Auth type to be used for underlying storage - --auth-username # Auth username to be used for underlying storage - --secret-usage # Auth secret usage to be used for underlying storage - --secret-uuid # Auth secret UUID to be used for underlying storage - --adapter-name # Adapter name to be used for underlying storage - --adapter-wwnn # Adapter wwnn to be used for underlying storage - --adapter-wwpn # Adapter wwpn to be used for underlying storage - --adapter-parent # Adapter parent to be used for underlying storage - --build # Build the pool as normal - --no-overwrite # Do not overwrite any existing data - --overwrite # Overwrite any existing data - --build # Build the pool as normal - --no-overwrite # Do not overwrite any existing data - --overwrite # Overwrite any existing data - --allocation # Initial allocation size, as scaled integer (default bytes) - --format # File format type raw,bochs,qcow,qcow2,qed,vmdk - --backing-vol # The backing volume if taking a snapshot - --backing-vol-format # Format of backing volume if taking a snapshot - --prealloc-metadata # Preallocate metadata (for qcow2 instead of full allocation) - --print-xml # Print XML document, but don't define/create - --prealloc-metadata # Preallocate metadata (for qcow2 instead of full allocation) - --inputpool # Pool name or UUID of the input volume's pool - --prealloc-metadata # Preallocate metadata (for qcow2 instead of full allocation) - --reflink # Use btrfs COW lightweight copy - ...args -] - -# Define (but don't start) a domain -extern "virsh define" [ - --validate # Validate the XML against the schema - --running # Set domain to be running on start - --paused # Set domain to be paused on start - --running # Set domain to be running on restore - --paused # Set domain to be paused on restore - --managed-save # Remove domain managed state file - --storage # Remove associated storage volumes - --remove-all-storage # Remove all associated storage volumes - --delete-snapshots # Delete snapshots associated with volume(s) - --wipe-storage # Wipe data on the removed volumes - --snapshots-metadata # Remove all domain snapshot metadata, if inactive - --nvram # Remove nvram file, if inactive - --keep-nvram # Keep nvram file, if inactive - --print-xml # Print XML document, but don't define/create - --source-host # Source-host for underlying storage - --source-path # Source path for underlying storage - --source-dev # Source device for underlying storage - --source-name # Source name for underlying storage - --target # Target for underlying storage - --source-format # Format for underlying storage - --auth-type # Auth type to be used for underlying storage - --auth-username # Auth username to be used for underlying storage - --secret-usage # Auth secret usage to be used for underlying storage - --secret-uuid # Auth secret UUID to be used for underlying storage - --adapter-name # Adapter name to be used for underlying storage - --adapter-wwnn # Adapter wwnn to be used for underlying storage - --adapter-wwpn # Adapter wwpn to be used for underlying storage - --adapter-parent # Adapter parent to be used for underlying storage - ...args -] - -# Show or set domain's description or title -extern "virsh desc" [ - --live # Modify/get running state - --config # Modify/get persistent configuration - --current # Modify/get current state configuration - --title # Modify/get the title instead of description - --edit # Open an editor to modify the description - ...args -] - -# Destroy (stop) a domain -extern "virsh destroy" [ - --graceful # Terminate gracefully - ...args -] - -# Detach device from an XML file -extern "virsh detach-device" [ - --persistent # Make live change persistent - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Detach disk device -extern "virsh detach-disk" [ - --persistent # Make live change persistent - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Detach network interface -extern "virsh detach-interface" [ - --mac # MAC address - --persistent # Make live change persistent - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Domain display connection URI -extern "virsh domdisplay" [ - --include-password # Includes the password into the connection URI if available - --type # Select particular graphical display (e.g. "vnc", "spice", "rdp") - --all # Show all possible graphical displays - ...args -] - -# Freeze domain's mounted filesystems -extern "virsh domfsfreeze" [ - - ...args -] - -# Thaw domain's mounted filesystems -extern "virsh domfsthaw" [ - - ...args -] - -# Get information of domain's mounted filesystems -extern "virsh domfsinfo" [ - - ...args -] - -# Invoke fstrim on domain's mounted filesystems -extern "virsh domfstrim" [ - --minimum # Just a hint to ignore contiguous free ranges smaller than this (Bytes) - --mountpoint # Which mount point to trim - ...args -] - -# Print the domain's hostname -extern "virsh domhostname" [ - - ...args -] - -# Convert a domain name or UUID to domain id -extern "virsh domid" [ - - ...args -] - -# Set link state of a virtual interface -extern "virsh domif-setlink" [ - --config # Affect next boot - ...args -] - -# Get/set parameters of a virtual interface -extern "virsh domiftune" [ - --inbound # Control domain's incoming traffics - --outbound # Control domain's outgoing traffics - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Abort active domain job -extern "virsh domjobabort" [ - - ...args -] - -# Domain job information -extern "virsh domjobinfo" [ - --completed # Return statistics of a recently completed job - ...args -] - -# Convert a domain id or UUID to domain name -extern "virsh domname" [ - - ...args -] - -# Rename a domain -extern "virsh domrename" [ - - ...args -] - -# Suspend a domain gracefully using power management functions -extern "virsh dompmsuspend" [ - --duration # Duration in seconds - ...args -] - -# Wakeup a domain from pmsuspended state -extern "virsh dompmwakeup" [ - - ...args -] - -# Convert a domain name or id to domain UUID -extern "virsh domuuid" [ - - ...args -] - -# Convert native config to domain XML -extern "virsh domxml-from-native" [ - - ...args -] - -# Convert domain XML to native config -extern "virsh domxml-to-native" [ - --domain # Domain name, id or UUID - --xml # Xml data file to export from - ...args -] - -# Dump the core of a domain to a file for analysis -extern "virsh dump" [ - --live # Perform a live core dump if supported - --crash # Crash the domain after core dump - --bypass-cache # Avoid file system cache when dumping - --reset # Reset the domain after core dump - --verbose # Display the progress of dump - --memory-only # Dump domain's memory only - --format # Specify the format of memory-only dump - --inactive # Show inactive defined XML - --security-info # Include security sensitive information in XML dump - --update-cpu # Update guest CPU according to host CPU - --migratable # Provide XML suitable for migrations - --security-info # Include security sensitive information in XML dump - --security-info # Include security sensitive information in XML dump - --inactive # Show inactive defined XML - --inactive # Show inactive defined XML - --security-info # Include security sensitive information in XML dump - --inactive # Show inactive defined XML - --pool # Pool name or UUID - ...args -] - -# Domain information in XML -extern "virsh dumpxml" [ - --inactive # Show inactive defined XML - --security-info # Include security sensitive information in XML dump - --update-cpu # Update guest CPU according to host CPU - --migratable # Provide XML suitable for migrations - --security-info # Include security sensitive information in XML dump - --security-info # Include security sensitive information in XML dump - --inactive # Show inactive defined XML - --inactive # Show inactive defined XML - --security-info # Include security sensitive information in XML dump - --inactive # Show inactive defined XML - --pool # Pool name or UUID - ...args -] - -# Edit XML configuration for a domain -extern "virsh edit" [ - --skip-validate # Skip validation of the XML against the schema - --running # Set domain to be running on start - --paused # Set domain to be paused on start - --running # Set domain to be running on restore - --paused # Set domain to be paused on restore - --snapshotname # Snapshot name - --current # Also set edited snapshot as current - --rename # Allow renaming an existing snapshot - --clone # Allow cloning to new name - ...args -] - -# Domain Events -extern "virsh event" [ - --domain # Filter by domain name, id, or UUID - --event # Which event type to wait for - --all # Wait for all events instead of just one type - --loop # Loop until timeout or interrupt, rather than one-shot - --timeout # Timeout seconds - --list # List valid event types - --timestamp # Show timestamp for each printed event - --domain # Filter by domain name, id or UUID - --event # Filter by event name - --pretty # Pretty-print any JSON output - --loop # Loop until timeout or interrupt, rather than one-shot - --timeout # Timeout seconds - --regex # Treat event as a regex rather than literal filter - --no-case # Treat event case-insensitively - --timestamp # Show timestamp for each printed event - --event # Which event type to wait for - --loop # Loop until timeout or interrupt, rather than one-shot - --timeout # Timeout seconds - --list # List valid event types - --timestamp # Show timestamp for each printed event - --device # Filter by node device name - --event # Which event type to wait for - --loop # Loop until timeout or interrupt, rather than one-shot - --timeout # Timeout seconds - --list # List valid event types - --timestamp # Show timestamp for each printed event - --secret # Filter by secret name or UUID - --event # Which event type to wait for - --loop # Loop until timeout or interrupt, rather than one-shot - --timeout # Timeout seconds - --list # List valid event types - --timestamp # Show timestamp for each printed event - --pool # Filter by storage pool name or UUID - --event # Which event type to wait for - --loop # Loop until timeout or interrupt, rather than one-shot - --timeout # Timeout seconds - --list # List valid event types - --timestamp # Show timestamp for each printed event - ...args -] - -# Inject NMI to the guest -extern "virsh inject-nmi" [ - - ...args -] - -# View domain IOThreads -extern "virsh iothreadinfo" [ - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Control domain IOThread affinity -extern "virsh iothreadpin" [ - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Add an IOThread to the guest domain -extern "virsh iothreadadd" [ - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Delete an IOThread from the guest domain -extern "virsh iothreaddel" [ - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Send keycodes to the guest -extern "virsh send-key" [ - --codeset # The codeset of keycodes, default:linux - --holdtime # The time (in milliseconds) how long the keys will be held - ...args -] - -# Send signals to processes -extern "virsh send-process-signal" [ - - ...args -] - -# LXC Guest Enter Namespace -extern "virsh lxc-enter-namespace" [ - --noseclabel # Do not change process security label - ...args -] - -# Managed save of a domain state -extern "virsh managedsave" [ - --bypass-cache # Avoid file system cache when saving - --running # Set domain to be running on next start - --paused # Set domain to be paused on next start - --verbose # Display the progress of save - --running # Set domain to be running on start - --paused # Set domain to be paused on start - --security-info # Include security sensitive information in XML dump - --running # Set domain to be running on start - --paused # Set domain to be paused on start - ...args -] - -# Remove managed save of a domain -extern "virsh managedsave-remove" [ - - ...args -] - -# Edit XML for a domain's managed save state file -extern "virsh managedsave-edit" [ - --running # Set domain to be running on start - --paused # Set domain to be paused on start - ...args -] - -# Domain information of managed save state file in XML -extern "virsh managedsave-dumpxml" [ - --security-info # Include security sensitive information in XML dump - ...args -] - -# Redefine the XML for a domain's managed save state file -extern "virsh managedsave-define" [ - --running # Set domain to be running on start - --paused # Set domain to be paused on start - ...args -] - -# Get or set memory parameters -extern "virsh memtune" [ - --hard-limit # Max memory, as scaled integer (default KiB) - --soft-limit # Memory during contention, as scaled integer (default KiB) - --swap-hard-limit # Max memory plus swap, as scaled integer (default KiB) - --min-guarantee # Min guaranteed memory, as scaled integer (default KiB) - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Get or set perf event -extern "virsh perf" [ - --enable # Perf events which will be enabled - --disable # Perf events which will be disabled - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Show or set domain's custom XML metadata -extern "virsh metadata" [ - --live # Modify/get running state - --config # Modify/get persistent configuration - --current # Modify/get current state configuration - --edit # Use an editor to change the metadata - --key # Key to be used as a namespace identifier - --set # New metadata to set - --remove # Remove the metadata corresponding to an uri - ...args -] - -# Migrate domain to another host -extern "virsh migrate" [ - --live # Live migration - --offline # Offline migration - --p2p # Peer-2-peer migration - --direct # Direct migration - --tunnelled # Tunnelled migration - --persistent # Persist VM on destination - --undefinesource # Undefine VM on source - --suspend # Do not restart the domain on the destination host - --copy-storage-all # Migration with non-shared storage with full disk copy - --copy-storage-inc # Migration with non-shared storage with incremental copy - --change-protection # Prevent any configuration changes to domain until migration ends - --unsafe # Force migration even if it may be unsafe - --verbose # Display the progress of migration - --compressed # Compress repeated pages during live migration - --auto-converge # Force convergence during live migration - --rdma-pin-all # Pin all memory before starting RDMA live migration - --abort-on-error # Abort on soft errors during migration - --postcopy # Enable post-copy migration; switch to it using migrate-postcopy command - --postcopy-after-precopy # Automatically switch to post-copy migration after one pass of pre-copy - --migrateuri # Migration URI, usually can be omitted - --graphicsuri # Graphics URI to be used for seamless graphics migration - --listen-address # Listen address that destination should bind to for incoming migration - --dname # Rename to new name during migration - --timeout # Run action specified by --timeout-* if live migration exceeds timeout - --timeout-suspend # Suspend the guest after timeout - --timeout-postcopy # Switch to post-copy after timeout - --xml # Filename containing updated XML for the target - --migrate-disks # Comma separated list of disks to be migrated - --disks-port # Port to use by target server for incoming disks migration - --comp-methods # Comma separated list of compression methods to be used - --comp-mt-level # Compress level for multithread compression - --comp-mt-threads # Number of compression threads for multithread compression - --comp-mt-dthreads # Number of decompression threads for multithread compression - --comp-xbzrle-cache # Page cache size for xbzrle compression - --auto-converge-initial # Initial CPU throttling rate for auto-convergence - --auto-converge-increment # CPU throttling rate increment for auto-convergence - --persistent-xml # Filename containing updated persistent XML for the target - --tls # Use TLS for migration - --size # Requested size of the cache (in bytes) used for compression - ...args -] - -# Set maximum tolerable downtime -extern "virsh migrate-setmaxdowntime" [ - - ...args -] - -# Get maximum tolerable downtime -extern "virsh migrate-getmaxdowntime" [ - - ...args +# Declarative completions for virsh, the libvirt management shell. +# +# Each `export complete` declaration describes one route: its options (with value +# domains), positionals and the rules between options. The live providers below are +# all `@non-destructive` and wrapped in `try`/`catch`, so they quietly return nothing +# when virsh is missing or the hypervisor cannot be reached. + +# Names of every domain, running or not, described by their state. +@non-destructive +export def "nu-complete virsh domains" [] { + try { + ^virsh list --all + | lines + | skip 2 + | where $it !~ '^\s*$' + | parse --regex '^\s*(?<id>\S+)\s+(?<name>\S+)\s+(?<state>.+?)\s*$' + | each {|d| {value: $d.name, description: $d.state} } + } catch { [] } +} + +# Names of every virtual network, active or not. +@non-destructive +export def "nu-complete virsh networks" [] { + try { + ^virsh net-list --all --name | lines | str trim | where $it != '' + } catch { [] } +} + +# Names of every storage pool, active or not. +@non-destructive +export def "nu-complete virsh pools" [] { + try { + ^virsh pool-list --all --name | lines | str trim | where $it != '' + } catch { [] } +} + +# Volume names from every active pool (the `default` pool if listing pools fails), +# described by the pool that holds them. Pass the pool with `--pool`. +@non-destructive +export def "nu-complete virsh volumes" [] { + try { + let pools = try { + ^virsh pool-list --name | lines | str trim | where $it != '' + } catch { ['default'] } + $pools | each {|pool| + try { + ^virsh vol-list --pool $pool + | lines + | skip 2 + | where $it !~ '^\s*$' + | parse --regex '^\s*(?<name>\S+)\s+(?<path>.*?)\s*$' + | each {|v| {value: $v.name, description: $"pool ($pool): ($v.path)"} } + } catch { [] } + } | flatten + } catch { [] } +} + +# Snapshot names of every domain, described by the domain that owns them. +@non-destructive +export def "nu-complete virsh snapshots" [] { + try { + ^virsh list --all --name | lines | str trim | where $it != '' | each {|dom| + try { + ^virsh snapshot-list $dom --name + | lines | str trim | where $it != '' + | each {|s| {value: $s, description: $"domain ($dom)"} } + } catch { [] } + } | flatten + } catch { [] } +} + +# Names of every host network interface, active or not. +@non-destructive +export def "nu-complete virsh interfaces" [] { + try { + ^virsh iface-list --all + | lines + | skip 2 + | where $it !~ '^\s*$' + | parse --regex '^\s*(?<name>\S+)\s+(?<state>\S+)\s*(?<mac>.*?)\s*$' + | each {|i| {value: $i.name, description: $i.state} } + } catch { [] } +} + +# --------------------------------------------------------------------------- +# Root +# --------------------------------------------------------------------------- + +export complete [virsh] [ + --connect(-c): text # Hypervisor connection URI + --debug(-d): words [0 1 2 3 4] # Debug level + --escape(-e): text # Escape sequence for the console + --keepalive-interval(-k): text # Keepalive interval in seconds (0 disables) + --keepalive-count(-K): text # Number of missed keepalive responses before disconnecting + --log(-l): path # Write the log to this file + --quiet(-q) # Quiet mode + --readonly(-r) # Connect read-only + --timing(-t) # Print timing information + --help(-h) # Show the help + --version(-v)?: words [short long] # Show the version + -V # Show the long version +] where { + terminal [--help --version -V] +} + +# --------------------------------------------------------------------------- +# Domain lifecycle +# --------------------------------------------------------------------------- + +export complete [virsh list] [ + --inactive # List inactive domains + --all # List inactive and active domains + --transient # List transient domains + --persistent # List persistent domains + --with-snapshot # List domains with existing snapshots + --without-snapshot # List domains without snapshots + --with-checkpoint # List domains with existing checkpoints + --without-checkpoint # List domains without checkpoints + --state-running # List domains in running state + --state-paused # List domains in paused state + --state-shutoff # List domains in shutoff state + --state-other # List domains in other states + --autostart # List domains with autostart enabled + --no-autostart # List domains with autostart disabled + --with-managed-save # List domains with managed save state + --without-managed-save # List domains without managed save + --uuid # List UUIDs only + --name # List domain names only + --id # List domain IDs only + --table # List as a table + --managed-save # Mark inactive domains with managed save state + --title # Show the domain title +] where { + at-most-one [--name --uuid --table] + at-most-one [--all --inactive] + at-most-one [--transient --persistent] + at-most-one [--with-snapshot --without-snapshot] + at-most-one [--with-checkpoint --without-checkpoint] + at-most-one [--autostart --no-autostart] + at-most-one [--with-managed-save --without-managed-save] +} + +export complete [virsh start] [ + domain: by "nu-complete virsh domains" # Name of the inactive domain + --console # Attach to the console after creation + --paused # Leave the guest paused after creation + --autodestroy # Destroy the guest when virsh disconnects + --bypass-cache # Avoid the file system cache when loading + --force-boot # Force a fresh boot by discarding any managed save + --pass-fds: text # Pass these comma separated file descriptors to the guest + --reset-nvram # Reset the guest's NVRAM to a pristine state +] + +export complete [virsh shutdown] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --mode: words [acpi agent initctl signal paravirt] # Shutdown mode(s), comma separated +] + +export complete [virsh reboot] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --mode: words [acpi agent initctl signal paravirt] # Reboot mode(s), comma separated +] + +export complete [virsh reset] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID +] + +export complete [virsh destroy] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --graceful # Terminate gracefully + --remove-logs # Remove the domain's log files +] + +export complete [virsh suspend] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID +] + +export complete [virsh resume] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID +] + +export complete [virsh define] [ + file: path # File containing an XML domain description + --validate # Validate the XML against the schema +] + +export complete [virsh undefine] [ + domain: by "nu-complete virsh domains" # Domain name or UUID + --managed-save # Remove the domain's managed save image + --storage: text # Comma separated storage volumes (targets or sources) to remove + --remove-all-storage # Remove all associated storage volumes + --delete-storage-volume-snapshots # Delete snapshots of removed storage volumes + --wipe-storage # Wipe data on the removed volumes + --snapshots-metadata # Remove all snapshot metadata + --checkpoints-metadata # Remove all checkpoint metadata + --nvram # Remove NVRAM + --keep-nvram # Keep NVRAM + --tpm # Remove TPM state + --keep-tpm # Keep TPM state +] where { + at-most-one [--remove-all-storage --storage] + at-most-one [--nvram --keep-nvram] + at-most-one [--tpm --keep-tpm] +} + +export complete [virsh create] [ + file: path # File containing an XML domain description + --console # Attach to the console after creation + --paused # Leave the guest paused after creation + --autodestroy # Destroy the guest when virsh disconnects + --pass-fds: text # Pass these comma separated file descriptors to the guest + --validate # Validate the XML against the schema + --reset-nvram # Reset the guest's NVRAM to a pristine state +] + +export complete [virsh edit] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --skip-validate # Skip validation of the XML against the schema +] + +export complete [virsh dumpxml] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --inactive # Show the inactive defined XML + --security-info # Include security sensitive information + --update-cpu # Update guest CPU according to host CPU + --migratable # Provide XML suitable for migrations + --xpath: text # Print only nodes matching this XPath expression + --wrap # Wrap XPath results in a common root element +] + +export complete [virsh dominfo] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID +] + +export complete [virsh domstate] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --reason # Also print the reason for the state +] + +export complete [virsh domid] [ + domain: by "nu-complete virsh domains" # Domain name or UUID +] + +export complete [virsh domuuid] [ + domain: by "nu-complete virsh domains" # Domain name or ID +] + +export complete [virsh domname] [ + domain: text # Domain ID or UUID +] + +export complete [virsh autostart] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --disable # Disable autostarting +] + +export complete [virsh console] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + devname?: text # Character device name + --safe # Only connect if safe console handling is supported + --force # Force the console connection, disconnecting existing sessions + --resume # Resume a paused guest after connecting +] + +export complete [virsh save] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + file: path # Where to save the state + --bypass-cache # Avoid the file system cache when saving + --xml: path # File containing an updated XML for the target + --running # Set the domain to be running on restore + --paused # Set the domain to be paused on restore + --verbose # Display the progress of save + --image-format: words [raw gzip bzip2 xz lzop zstd] # Format of the save image + --parallel-channels: text # Number of extra I/O channels for parallel save +] where { + at-most-one [--running --paused] +} + +export complete [virsh restore] [ + file: path # The state file to restore + --bypass-cache # Avoid the file system cache when restoring + --xml: path # File containing an updated XML for the target + --running # Restore the domain into the running state + --paused # Restore the domain into the paused state + --reset-nvram # Reset the guest's NVRAM to a pristine state + --parallel-channels: text # Number of extra I/O channels for parallel restore +] where { + at-most-one [--running --paused] +} + +export complete [virsh managedsave] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --bypass-cache # Avoid the file system cache when saving + --running # Set the domain to be running on next start + --paused # Set the domain to be paused on next start + --verbose # Display the progress of save +] where { + at-most-one [--running --paused] +} + +export complete [virsh migrate] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + desturi: text # Connection URI of the destination host + migrateuri?: text # Migration URI, usually can be omitted + --live # Live migration + --offline # Offline migration + --p2p # Peer-to-peer migration + --direct # Direct migration + --tunnelled # Tunnelled migration + --persistent # Persist the VM on the destination + --undefinesource # Undefine the VM on the source + --suspend # Do not restart the domain on the destination host + --copy-storage-all # Migration with non-shared storage, full disk copy + --copy-storage-inc # Migration with non-shared storage, incremental copy + --copy-storage-synchronous-writes # Force guest disk writes to be synchronously written to the destination + --change-protection # Prevent incompatible configuration changes during migration + --unsafe # Force migration even if it may be unsafe + --verbose # Display the progress of migration + --compressed # Compress repeated pages during live migration + --auto-converge # Force convergence during live migration + --rdma-pin-all # Pin all memory before starting RDMA live migration + --abort-on-error # Abort on soft errors during migration + --postcopy # Enable post-copy migration + --postcopy-after-precopy # Switch to post-copy after the first pass of pre-copy + --zerocopy # Use zero-copy mechanism for migrating memory pages + --parallel # Enable parallel migration + --parallel-connections: text # Number of connections for parallel migration + --migrate-disks: text # Comma separated list of disks to be migrated + --disks-port: text # Port to use by the target server for incoming disk migration + --disks-uri: text # URI to use for disk migration + --dname: text # Rename the domain to this name during migration + --timeout: text # Run an action after this many seconds of live migration + --timeout-suspend # Suspend the guest after the timeout + --timeout-postcopy # Switch to post-copy after the timeout + --xml: path # File containing an updated XML for the target + --persistent-xml: path # File containing an updated persistent XML for the target + --listen-address: text # Listen address the destination should bind to for incoming migration + --graphicsuri: text # Graphics URI to be used for seamless graphics migration + --comp-methods: text # Comma separated list of compression methods + --comp-mt-level: text # Compress level for multithread compression + --comp-mt-threads: text # Number of compression threads for multithread compression + --comp-mt-dthreads: text # Number of decompression threads for multithread compression + --comp-xbzrle-cache: text # Page cache size for xbzrle compression + --comp-zlib-level: text # Compression level for zlib + --comp-zstd-level: text # Compression level for zstd + --bandwidth: text # Migration bandwidth limit in MiB/s + --postcopy-bandwidth: text # Post-copy migration bandwidth limit in MiB/s + --tls # Use TLS for migration + --tls-destination: text # Override the destination host name used for TLS verification +] where { + at-most-one [--live --offline] + at-most-one [--copy-storage-all --copy-storage-inc] + requires --tunnelled --p2p + requires --postcopy-after-precopy --postcopy + requires --timeout-postcopy --postcopy + requires --timeout-suspend --timeout + requires --timeout-postcopy --timeout + requires --parallel-connections --parallel + requires --rdma-pin-all --live +} + +export complete [virsh setmem] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + size: text # New memory size, as scaled integer (default KiB) + --config # Affect next boot + --live # Affect running domain + --current # Affect current domain +] where { + excludes --current --live + excludes --current --config +} + +export complete [virsh setmaxmem] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + size: text # New maximum memory size, as scaled integer (default KiB) + --config # Affect next boot + --live # Affect running domain + --current # Affect current domain +] where { + excludes --current --live + excludes --current --config +} + +export complete [virsh setvcpus] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + count: text # Number of virtual CPUs + --maximum # Set the maximum limit on virtual CPUs + --config # Affect next boot + --live # Affect running domain + --current # Affect current domain + --guest # Modify CPU state in the guest + --hotpluggable # Make added vCPUs hot(un)pluggable +] where { + excludes --current --live + excludes --current --config + excludes --maximum --live + excludes --guest --config +} + +export complete [virsh vcpucount] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --maximum # Get the maximum count of vCPUs + --active # Get the number of currently active vCPUs + --live # Get the value from the running guest + --config # Get the value to be used on next boot + --current # Get the value according to the current domain state + --guest # Count vCPUs from the guest's point of view +] where { + at-most-one [--live --config --current] + at-most-one [--maximum --active] +} + +# --------------------------------------------------------------------------- +# Domain devices +# --------------------------------------------------------------------------- + +export complete [virsh attach-device] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + file: path # XML file describing the device + --persistent # Make the live change persistent + --config # Affect next boot + --live # Affect running domain + --current # Affect current domain +] where { + overrides [--persistent --config] + excludes --current --live + excludes --current --config + excludes --current --persistent +} + +export complete [virsh detach-device] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + file: path # XML file describing the device + --persistent # Make the live change persistent + --config # Affect next boot + --live # Affect running domain + --current # Affect current domain +] where { + overrides [--persistent --config] + excludes --current --live + excludes --current --config + excludes --current --persistent +} + +export complete [virsh update-device] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + file: path # XML file describing the device + --persistent # Make the live change persistent + --config # Affect next boot + --live # Affect running domain + --current # Affect current domain + --force # Force the device change +] where { + overrides [--persistent --config] + excludes --current --live + excludes --current --config + excludes --current --persistent +} + +export complete [virsh attach-disk] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + source: path # Source of the disk device + target: text # Target of the disk device (e.g. vdb) + --targetbus: words [virtio ide scsi sata usb sd fdc xen] # Target bus of the disk device + --driver: text # Driver of the disk device + --subdriver: words [raw qcow2 qed vmdk vdi vhd vpc] # Subdriver of the disk device + --iothread: text # IOThread to be used by the device + --cache: words [default none writethrough writeback directsync unsafe] # Cache mode + --io: words [threads native io_uring] # IO policy + --type: words [disk cdrom floppy lun] # Target device type + --sourcetype: words [file block network] # Type of the source + --mode: words [readonly shareable] # Mode of device reading and writing + --serial: text # Serial of the disk device + --wwn: text # WWN of the disk device + --alias: text # Custom alias name of the disk device + --rawio # Needs rawio capability + --address: text # Address of the disk device + --multifunction # Use multifunction PCI under the specified address + --print-xml # Print the XML document rather than attaching the disk + --source-protocol: text # Protocol used by the disk device source + --source-host-name: text # Host name of the disk device source + --source-host-transport: text # Host transport of the disk device source + --source-host-socket: path # Host socket of the disk device source + --persistent # Make the live change persistent + --config # Affect next boot + --live # Affect running domain + --current # Affect current domain +] where { + overrides [--persistent --config] + excludes --current --live + excludes --current --config + excludes --current --persistent +} + +export complete [virsh detach-disk] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + target: text # Target of the disk device (e.g. vdb) + --print-xml # Print the XML that would be used instead of detaching + --persistent # Make the live change persistent + --config # Affect next boot + --live # Affect running domain + --current # Affect current domain +] where { + overrides [--persistent --config] + excludes --current --live + excludes --current --config + excludes --current --persistent +} + +export complete [virsh attach-interface] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + type: words [network bridge direct user ethernet hostdev vhostuser] # Network interface type + source: text # Source of the network interface (network or bridge name) + --target: text # Target network name + --mac: text # MAC address + --script: path # Script used to bridge the network interface + --model: words [virtio e1000 e1000e rtl8139 ne2k_pci pcnet] # Model type + --alias: text # Custom alias name of the interface device + --inbound: text # Control the domain's incoming traffic (average,peak,burst,floor) + --outbound: text # Control the domain's outgoing traffic (average,peak,burst) + --managed # Libvirt manages the hostdev + --print-xml # Print the XML document rather than attaching the interface + --source-mode: words [server client] # Mode attribute of the vhostuser source + --persistent # Make the live change persistent + --config # Affect next boot + --live # Affect running domain + --current # Affect current domain +] where { + overrides [--persistent --config] + excludes --current --live + excludes --current --config + excludes --current --persistent +} + +export complete [virsh detach-interface] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + type: words [network bridge direct user ethernet hostdev vhostuser] # Network interface type + --mac: text # MAC address of the interface to detach + --persistent # Make the live change persistent + --config # Affect next boot + --live # Affect running domain + --current # Affect current domain +] where { + overrides [--persistent --config] + excludes --current --live + excludes --current --config + excludes --current --persistent +} + +export complete [virsh domblklist] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --inactive # Get the inactive rather than the running configuration + --details # Additionally display the type and device value +] + +export complete [virsh domiflist] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --inactive # Get the inactive rather than the running configuration +] + +export complete [virsh domifaddr] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --interface: text # Network interface name + --full # Always display the names and MACs of interfaces + --source: words [lease agent arp] # Address source +] + +export complete [virsh vncdisplay] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID +] + +# --------------------------------------------------------------------------- +# Networks +# --------------------------------------------------------------------------- + +export complete [virsh net-list] [ + --inactive # List inactive networks + --all # List inactive and active networks + --persistent # List persistent networks + --transient # List transient networks + --autostart # List networks with autostart enabled + --no-autostart # List networks with autostart disabled + --uuid # List UUIDs only + --name # List network names only + --table # List as a table + --title # Show the network title +] where { + at-most-one [--name --uuid --table] + at-most-one [--all --inactive] + at-most-one [--persistent --transient] + at-most-one [--autostart --no-autostart] +} + +export complete [virsh net-start] [ + network: by "nu-complete virsh networks" # Network name or UUID +] + +export complete [virsh net-destroy] [ + network: by "nu-complete virsh networks" # Network name or UUID +] + +export complete [virsh net-define] [ + file: path # File containing an XML network description + --validate # Validate the XML against the schema +] + +export complete [virsh net-undefine] [ + network: by "nu-complete virsh networks" # Network name or UUID +] + +export complete [virsh net-dumpxml] [ + network: by "nu-complete virsh networks" # Network name or UUID + --inactive # Show the inactive defined XML + --xpath: text # Print only nodes matching this XPath expression + --wrap # Wrap XPath results in a common root element ] -# Get/set compression cache size -extern "virsh migrate-compcache" [ - --size # Requested size of the cache (in bytes) used for compression - ...args +export complete [virsh net-autostart] [ + network: by "nu-complete virsh networks" # Network name or UUID + --disable # Disable autostarting ] -# Set the maximum migration bandwidth -extern "virsh migrate-setspeed" [ - - ...args +export complete [virsh net-info] [ + network: by "nu-complete virsh networks" # Network name or UUID ] -# Get the maximum migration bandwidth -extern "virsh migrate-getspeed" [ - - ...args +export complete [virsh net-edit] [ + network: by "nu-complete virsh networks" # Network name or UUID ] -# Switch running migration from pre-copy to post-copy -extern "virsh migrate-postcopy" [ - - ...args +export complete [virsh net-dhcp-leases] [ + network: by "nu-complete virsh networks" # Network name or UUID + --mac: text # Only show leases for this MAC address ] -# Get or set numa parameters -extern "virsh numatune" [ - --mode # NUMA mode, one of strict, preferred and interleave - --nodeset # NUMA node selections to set - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] +# --------------------------------------------------------------------------- +# Storage pools +# --------------------------------------------------------------------------- -# QEMU Attach -extern "virsh qemu-attach" [ +export complete [virsh pool-list] [ + --inactive # List inactive pools + --all # List inactive and active pools + --transient # List transient pools + --persistent # List persistent pools + --autostart # List pools with autostart enabled + --no-autostart # List pools with autostart disabled + --type: text # Only list pools of these comma separated types + --details # Display extended details + --uuid # List UUIDs only + --name # List pool names only +] where { + at-most-one [--name --uuid --details] + at-most-one [--all --inactive] + at-most-one [--transient --persistent] + at-most-one [--autostart --no-autostart] +} - ...args -] +export complete [virsh pool-start] [ + pool: by "nu-complete virsh pools" # Pool name or UUID + --build # Build the pool before starting + --overwrite # Overwrite any existing data when building + --no-overwrite # Do not overwrite existing data when building +] where { + at-most-one [--overwrite --no-overwrite] +} -# QEMU Monitor Command -extern "virsh qemu-monitor-command" [ - --hmp # Command is in human monitor protocol - --pretty # Pretty-print any qemu monitor protocol output - ...args +export complete [virsh pool-destroy] [ + pool: by "nu-complete virsh pools" # Pool name or UUID ] -# QEMU Monitor Events -extern "virsh qemu-monitor-event" [ - --domain # Filter by domain name, id or UUID - --event # Filter by event name - --pretty # Pretty-print any JSON output - --loop # Loop until timeout or interrupt, rather than one-shot - --timeout # Timeout seconds - --regex # Treat event as a regex rather than literal filter - --no-case # Treat event case-insensitively - --timestamp # Show timestamp for each printed event - ...args +export complete [virsh pool-define] [ + file: path # File containing an XML pool description + --validate # Validate the XML against the schema ] -# QEMU Guest Agent Command -extern "virsh qemu-agent-command" [ - --timeout # Timeout seconds. must be positive - --async # Execute command without waiting for timeout - --block # Execute command without timeout - --pretty # Pretty-print the output - ...args +export complete [virsh pool-undefine] [ + pool: by "nu-complete virsh pools" # Pool name or UUID ] -# Reboot a domain -extern "virsh reboot" [ - - ...args +export complete [virsh pool-refresh] [ + pool: by "nu-complete virsh pools" # Pool name or UUID ] -# Reset a domain -extern "virsh reset" [ - - ...args +export complete [virsh pool-info] [ + pool: by "nu-complete virsh pools" # Pool name or UUID + --bytes # Show pool information in bytes ] -# Restore a domain from a saved state in a file -extern "virsh restore" [ - --bypass-cache # Avoid file system cache when restoring - --xml # Filename containing updated XML for the target - --running # Restore domain into running state - --paused # Restore domain into paused state - ...args +export complete [virsh pool-dumpxml] [ + pool: by "nu-complete virsh pools" # Pool name or UUID + --inactive # Show the inactive defined XML + --xpath: text # Print only nodes matching this XPath expression + --wrap # Wrap XPath results in a common root element ] -# Resume a domain -extern "virsh resume" [ - - ...args +export complete [virsh pool-autostart] [ + pool: by "nu-complete virsh pools" # Pool name or UUID + --disable # Disable autostarting ] -# Save a domain state to a file -extern "virsh save" [ - --bypass-cache # Avoid file system cache when saving - --running # Set domain to be running on next start - --paused # Set domain to be paused on next start - --verbose # Display the progress of save - --running # Set domain to be running on start - --paused # Set domain to be paused on start - --security-info # Include security sensitive information in XML dump - --running # Set domain to be running on start - --paused # Set domain to be paused on start - --bypass-cache # Avoid file system cache when saving - --xml # Filename containing updated XML for the target - --running # Set domain to be running on restore - --paused # Set domain to be paused on restore - --verbose # Display the progress of save - --running # Set domain to be running on restore - --paused # Set domain to be paused on restore - --security-info # Include security sensitive information in XML dump - --running # Set domain to be running on restore - --paused # Set domain to be paused on restore - ...args -] +export complete [virsh pool-build] [ + pool: by "nu-complete virsh pools" # Pool name or UUID + --overwrite # Overwrite any existing data + --no-overwrite # Do not overwrite existing data +] where { + at-most-one [--overwrite --no-overwrite] +} -# Redefine the XML for a domain's saved state file -extern "virsh save-image-define" [ - --running # Set domain to be running on restore - --paused # Set domain to be paused on restore - ...args +export complete [virsh pool-delete] [ + pool: by "nu-complete virsh pools" # Pool name or UUID ] -# Saved state domain information in XML -extern "virsh save-image-dumpxml" [ - --security-info # Include security sensitive information in XML dump - ...args -] +# --------------------------------------------------------------------------- +# Storage volumes +# --------------------------------------------------------------------------- -# Edit XML for a domain's saved state file -extern "virsh save-image-edit" [ - --running # Set domain to be running on restore - --paused # Set domain to be paused on restore - ...args +export complete [virsh vol-list] [ + pool: by "nu-complete virsh pools" # Pool name or UUID + --details # Display extended details ] -# Show/set scheduler parameters -extern "virsh schedinfo" [ - --weight # Weight for XEN_CREDIT - --cap # Cap for XEN_CREDIT - --current # Get/set current scheduler info - --config # Get/set value to be used on next boot - --live # Get/set value from running domain - ...args -] +export complete [virsh vol-create-as] [ + pool: by "nu-complete virsh pools" # Pool name + name: text # Name of the volume + capacity: text # Size of the volume, as scaled integer (default bytes) + --allocation: text # Initial allocation size, as scaled integer + --format: words [raw bochs qcow qcow2 qed vmdk] # File format type + --backing-vol: by "nu-complete virsh volumes" # Backing volume for a copy-on-write image + --backing-vol-format: words [raw qcow2 qed vmdk] # Format of the backing volume + --prealloc-metadata # Preallocate metadata (qcow2 only) + --print-xml # Print the XML document rather than creating the volume + --validate # Validate the XML against the schema +] + +export complete [virsh vol-delete] [ + vol: by "nu-complete virsh volumes" # Volume name, key or path + --pool: by "nu-complete virsh pools" # Pool name or UUID + --delete-snapshots # Delete snapshots associated with the volume +] + +export complete [virsh vol-info] [ + vol: by "nu-complete virsh volumes" # Volume name, key or path + --pool: by "nu-complete virsh pools" # Pool name or UUID + --bytes # Show volume information in bytes + --physical # Return the physical size of the volume in allocation +] + +export complete [virsh vol-dumpxml] [ + vol: by "nu-complete virsh volumes" # Volume name, key or path + --pool: by "nu-complete virsh pools" # Pool name or UUID + --xpath: text # Print only nodes matching this XPath expression + --wrap # Wrap XPath results in a common root element +] + +export complete [virsh vol-resize] [ + vol: by "nu-complete virsh volumes" # Volume name, key or path + capacity: text # New capacity, as scaled integer (default bytes) + --pool: by "nu-complete virsh pools" # Pool name or UUID + --allocate # Allocate the new capacity + --delta # Use the capacity as a delta to the current size + --shrink # Allow the resize to shrink the volume +] + +export complete [virsh vol-clone] [ + vol: by "nu-complete virsh volumes" # Original volume name, key or path + newname: text # Name of the clone + --pool: by "nu-complete virsh pools" # Pool name or UUID + --prealloc-metadata # Preallocate metadata (qcow2 only) + --reflink # Use btrfs COW lightweight copy + --print-xml # Print the XML document rather than cloning the volume +] + +export complete [virsh vol-upload] [ + vol: by "nu-complete virsh volumes" # Volume name, key or path + file: path # Local file to upload + --pool: by "nu-complete virsh pools" # Pool name or UUID + --offset: text # Volume offset to upload to + --length: text # Amount of data to upload + --sparse # Preserve sparseness of the volume +] + +export complete [virsh vol-download] [ + vol: by "nu-complete virsh volumes" # Volume name, key or path + file: path # Local file to download into + --pool: by "nu-complete virsh pools" # Pool name or UUID + --offset: text # Volume offset to download from + --length: text # Amount of data to download + --sparse # Preserve sparseness of the volume +] + +export complete [virsh vol-path] [ + vol: by "nu-complete virsh volumes" # Volume name or key + --pool: by "nu-complete virsh pools" # Pool name or UUID +] + +# --------------------------------------------------------------------------- +# Snapshots +# --------------------------------------------------------------------------- + +export complete [virsh snapshot-create] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + xmlfile?: path # Domain snapshot XML + --redefine # Redefine metadata for an existing snapshot + --current # With --redefine, set the current snapshot + --no-metadata # Take the snapshot but create no metadata + --halt # Halt the domain after the snapshot is created + --disk-only # Capture disk state but not VM state + --reuse-external # Reuse any existing external files + --quiesce # Quiesce the guest's file systems + --atomic # Require atomic operation + --live # Take a live snapshot + --validate # Validate the XML against the schema +] where { + requires --current --redefine +} + +export complete [virsh snapshot-create-as] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --name: text # Name of the snapshot + --description: text # Description of the snapshot + --print-xml # Print XML rather than creating the snapshot + --no-metadata # Take the snapshot but create no metadata + --halt # Halt the domain after the snapshot is created + --disk-only # Capture disk state but not VM state + --reuse-external # Reuse any existing external files + --quiesce # Quiesce the guest's file systems + --atomic # Require atomic operation + --live # Take a live snapshot + --memspec: text # Memory attributes: [file=]name[,snapshot=type] + --diskspec: text # Disk attributes: disk[,snapshot=type][,driver=type][,file=name] +] + +export complete [virsh snapshot-list] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + --parent # Add a column showing the parent snapshot + --roots # List only snapshots without parents + --leaves # List only snapshots without children + --no-leaves # List only snapshots that are not leaves + --metadata # List only snapshots that have metadata + --no-metadata # List only snapshots without metadata + --inactive # Filter by snapshots taken while inactive + --active # Filter by snapshots taken while active + --disk-only # Filter by disk-only snapshots + --internal # Filter by internal snapshots + --external # Filter by external snapshots + --tree # List snapshots in a tree + --from: by "nu-complete virsh snapshots" # Limit the list to children of this snapshot + --current # Limit the list to children of the current snapshot + --descendants # With --from, list all descendants + --name # List snapshot names only + --topological # Sort the list topologically +] where { + at-most-one [--parent --roots --tree] + at-most-one [--leaves --no-leaves] + at-most-one [--metadata --no-metadata] + at-most-one [--from --current] +} + +export complete [virsh snapshot-revert] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + snapshotname?: by "nu-complete virsh snapshots" # Snapshot name + --current # Revert to the current snapshot + --running # After reverting, change state to running + --paused # After reverting, change state to paused + --force # Try harder on risky reverts + --reset-nvram # Re-initialize NVRAM from its pristine template +] where { + at-most-one [--running --paused] +} + +export complete [virsh snapshot-delete] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + snapshotname?: by "nu-complete virsh snapshots" # Snapshot name + --current # Delete the current snapshot + --children # Delete the snapshot and all its children + --children-only # Delete only the children + --metadata # Delete only libvirt metadata, leaving the snapshot contents behind +] where { + at-most-one [--children --children-only] +} + +export complete [virsh snapshot-info] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + snapshotname?: by "nu-complete virsh snapshots" # Snapshot name + --current # Show information about the current snapshot +] + +export complete [virsh snapshot-dumpxml] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + snapshotname: by "nu-complete virsh snapshots" # Snapshot name + --security-info # Include security sensitive information + --xpath: text # Print only nodes matching this XPath expression + --wrap # Wrap XPath results in a common root element +] + +export complete [virsh snapshot-current] [ + domain: by "nu-complete virsh domains" # Domain name, ID or UUID + snapshotname?: by "nu-complete virsh snapshots" # Make this snapshot current + --name # List the name only + --security-info # Include security sensitive information +] + +# --------------------------------------------------------------------------- +# Host interfaces +# --------------------------------------------------------------------------- + +export complete [virsh iface-list] [ + --inactive # List inactive interfaces + --all # List inactive and active interfaces +] where { + at-most-one [--all --inactive] +} + +export complete [virsh iface-start] [ + interface: by "nu-complete virsh interfaces" # Interface name or MAC address +] + +export complete [virsh iface-destroy] [ + interface: by "nu-complete virsh interfaces" # Interface name or MAC address +] + +export complete [virsh iface-define] [ + file: path # File containing an XML interface description + --validate # Validate the XML against the schema +] + +export complete [virsh iface-undefine] [ + interface: by "nu-complete virsh interfaces" # Interface name or MAC address +] + +export complete [virsh iface-dumpxml] [ + interface: by "nu-complete virsh interfaces" # Interface name or MAC address + --inactive # Show the inactive defined XML + --xpath: text # Print only nodes matching this XPath expression + --wrap # Wrap XPath results in a common root element +] + +# --------------------------------------------------------------------------- +# Host and hypervisor +# --------------------------------------------------------------------------- -# Take a screenshot of a current domain console and store it into a file -extern "virsh screenshot" [ - --file # Where to store the screenshot - --screen # ID of a screen to take screenshot of - ...args -] - -# Change lifecycle actions -extern "virsh set-lifecycle-action" [ - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Set the user password inside the domain -extern "virsh set-user-password" [ - --encrypted # The password is already encrypted - ...args -] - -# Change maximum memory limit -extern "virsh setmaxmem" [ - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Change memory allocation -extern "virsh setmem" [ - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Change number of virtual CPUs -extern "virsh setvcpus" [ - --maximum # Set maximum limit on next boot - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - --guest # Modify cpu state in the guest - --hotpluggable # Make added vcpus hot(un)pluggable - ...args -] - -# Gracefully shutdown a domain -extern "virsh shutdown" [ - - ...args -] - -# Start a (previously defined) inactive domain -extern "virsh start" [ - --disable # Disable autostarting - --console # Attach to console after creation - --paused # Leave the guest paused after creation - --autodestroy # Automatically destroy the guest when virsh disconnects - --bypass-cache # Avoid file system cache when loading - --force-boot # Force fresh boot by discarding any managed save - --pass-fds # Pass file descriptors N,M,... to the guest - --disable # Disable autostarting - --disable # Disable autostarting - --build # Build the pool as normal - --no-overwrite # Do not overwrite any existing data - --overwrite # Overwrite any existing data - ...args -] - -# Suspend a domain -extern "virsh suspend" [ - --duration # Duration in seconds - ...args -] - -# TTY console -extern "virsh ttyconsole" [ - - ...args -] - -# Undefine a domain -extern "virsh undefine" [ - --managed-save # Remove domain managed state file - --storage # Remove associated storage volumes - --remove-all-storage # Remove all associated storage volumes - --delete-snapshots # Delete snapshots associated with volume(s) - --wipe-storage # Wipe data on the removed volumes - --snapshots-metadata # Remove all domain snapshot metadata, if inactive - --nvram # Remove nvram file, if inactive - --keep-nvram # Keep nvram file, if inactive - ...args -] - -# Update device from an XML file -extern "virsh update-device" [ - --persistent # Make live change persistent - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - --force # Force device update - ...args -] - -# Domain vcpu counts -extern "virsh vcpucount" [ - --maximum # Get maximum count of vcpus - --active # Get number of currently active vcpus - --live # Get value from running domain - --config # Get value to be used on next boot - --current # Get value according to current domain state - --guest # Retrieve vcpu count from the guest instead of the hypervisor - ...args -] - -# Detailed domain vcpu information -extern "virsh vcpuinfo" [ - --pretty # Return human readable output - ...args -] - -# Control or query domain vcpu affinity -extern "virsh vcpupin" [ - --vcpu # Vcpu number - --cpulist # Host cpu number(s) to set, or omit option to query - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] +export complete [virsh nodeinfo] [] -# Control or query domain emulator affinity -extern "virsh emulatorpin" [ - --cpulist # Host cpu number(s) to set, or omit option to query - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args +export complete [virsh capabilities] [ + --xpath: text # Print only nodes matching this XPath expression + --wrap # Wrap XPath results in a common root element ] -# Vnc display -extern "virsh vncdisplay" [ +export complete [virsh hostname] [] - ...args -] - -# Query or modify state of vcpu in the guest (via agent) -extern "virsh guestvcpus" [ - --cpulist # List of cpus to enable or disable - --enable # Enable cpus specified by cpulist - --disable # Disable cpus specified by cpulist - ...args -] - -# Attach/detach vcpu or groups of threads -extern "virsh setvcpu" [ - --maximum # Set maximum limit on next boot - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - --guest # Modify cpu state in the guest - --hotpluggable # Make added vcpus hot(un)pluggable - --enable # Enable cpus specified by cpumap - --disable # Disable cpus specified by cpumap - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Set the threshold for block-threshold event -extern "virsh domblkthreshold" [ - - ...args -] - -# Show errors on block devices -extern "virsh domblkerror" [ - - ...args -] - -# Domain block device size information -extern "virsh domblkinfo" [ - --human # Human readable output - ...args -] - -# List all domain blocks -extern "virsh domblklist" [ - --inactive # Get inactive rather than running configuration - --details # Additionally display the type and device value - ...args -] - -# Get device block stats for a domain -extern "virsh domblkstat" [ - --device # Block device - --human # Print a more human readable output - ...args -] - -# Domain control interface state -extern "virsh domcontrol" [ - - ...args -] - -# Get link state of a virtual interface -extern "virsh domif-getlink" [ - --config # Get persistent interface state - ...args -] - -# Get network interfaces' addresses for a running domain -extern "virsh domifaddr" [ - --interface # Network interface name - --full # Always display names and MACs of interfaces - --source # Address source: 'lease' or 'agent' - ...args -] - -# List all domain virtual interfaces -extern "virsh domiflist" [ - --inactive # Get inactive rather than running configuration - ...args -] - -# Get network interface stats for a domain -extern "virsh domifstat" [ - - ...args -] - -# Domain information -extern "virsh dominfo" [ - - ...args -] - -# Get memory statistics for a domain -extern "virsh dommemstat" [ - --period # Period in seconds to set collection - --config # Affect next boot - --live # Affect running domain - --current # Affect current domain - ...args -] - -# Domain state -extern "virsh domstate" [ - --reason # Also print reason for the state - ...args -] - -# Get statistics about one or multiple domains -extern "virsh domstats" [ - --state # Report domain state - --cpu-total # Report domain physical cpu usage - --balloon # Report domain balloon statistics - --vcpu # Report domain virtual cpu information - --interface # Report domain network interface information - --block # Report domain block device statistics - --perf # Report domain perf event statistics - --list-active # List only active domains - --list-inactive # List only inactive domains - --list-persistent # List only persistent domains - --list-transient # List only transient domains - --list-running # List only running domains - --list-paused # List only paused domains - --list-shutoff # List only shutoff domains - --list-other # List only domains in other states - --raw # Do not pretty-print the fields - --enforce # Enforce requested stats parameters - --backing # Add backing chain information to block stats - ...args -] - -# Domain time -extern "virsh domtime" [ - --now # Set to the time of the host running virsh - --pretty # Print domain's time in human readable form - --sync # Instead of setting given time, synchronize from domain's RTC - --time # Time to set - ...args -] - -# List domains -extern "virsh list" [ - --inactive # Get inactive rather than running configuration - --details # Additionally display the type and device value - --inactive # Get inactive rather than running configuration - --inactive # List inactive domains - --all # List inactive & active domains - --transient # List transient domains - --persistent # List persistent domains - --with-snapshot # List domains with existing snapshot - --without-snapshot # List domains without a snapshot - --state-running # List domains in running state - --state-paused # List domains in paused state - --state-shutoff # List domains in shutoff state - --state-other # List domains in other states - --autostart # List domains with autostart enabled - --no-autostart # List domains with autostart disabled - --with-managed-save # List domains with managed save state - --without-managed-save # List domains without managed save - --uuid # List UUID's only - --name # List domain names only - --table # List table (default) - --managed-save # Mark inactive domains with managed save state - --title # Show domain title - --inactive # List inactive interfaces - --all # List inactive & active interfaces - --inactive # List inactive networks - --all # List inactive & active networks - --persistent # List persistent networks - --transient # List transient networks - --autostart # List networks with autostart enabled - --no-autostart # List networks with autostart disabled - --uuid # List UUID's only - --name # List network names only - --table # List table (default) - --tree # List devices in a tree - --cap # Capability names, separated by comma - --ephemeral # List ephemeral secrets - --no-ephemeral # List non-ephemeral secrets - --private # List private secrets - --no-private # List non-private secrets - --parent # Add a column showing parent snapshot - --roots # List only snapshots without parents - --leaves # List only snapshots without children - --no-leaves # List only snapshots that are not leaves (with children) - --metadata # List only snapshots that have metadata that would prevent undefine - --no-metadata # List only snapshots that have no metadata managed by libvirt - --inactive # Filter by snapshots taken while inactive - --active # Filter by snapshots taken while active (system checkpoints) - --disk-only # Filter by disk-only snapshots - --internal # Filter by internal snapshots - --external # Filter by external snapshots - --tree # List snapshots in a tree - --from # Limit list to children of given snapshot - --current # Limit list to children of current snapshot - --descendants # With --from, list all descendants - --name # List snapshot names only - --inactive # List inactive pools - --all # List inactive & active pools - --transient # List transient pools - --persistent # List persistent pools - --autostart # List pools with autostart enabled - --no-autostart # List pools with autostart disabled - --type # Only list pool of specified type(s) (if supported) - --details # Display extended details for pools - --uuid # List UUID of active pools only - --name # List name of active pools only - --details # Display extended details for volumes - ...args -] - -# Manipulate pages pool size -extern "virsh allocpages" [ - --cellno # NUMA cell number - --add # Instead of setting new pool size add pages to it - --all # Set on all NUMA cells - ...args -] - -# Capabilities -extern "virsh capabilities" [ - --virttype # Virtualization type (/domain/@type) - --emulatorbin # Path to emulator binary (/domain/devices/emulator) - --arch # Domain architecture (/domain/os/type/@arch) - --machine # Machine type (/domain/os/type/@machine) - ...args -] - -# CPU models -extern "virsh cpu-models" [ - - ...args -] - -# Domain capabilities -extern "virsh domcapabilities" [ - --virttype # Virtualization type (/domain/@type) - --emulatorbin # Path to emulator binary (/domain/devices/emulator) - --arch # Domain architecture (/domain/os/type/@arch) - --machine # Machine type (/domain/os/type/@machine) - ...args -] - -# NUMA free memory -extern "virsh freecell" [ - --cellno # NUMA cell number - --all # Show free memory for all NUMA cells - ...args -] - -# NUMA free pages -extern "virsh freepages" [ - --cellno # NUMA cell number - --pagesize # Page size (in kibibytes) - --all # Show free pages for all NUMA cells - ...args -] - -# Print the hypervisor hostname -extern "virsh hostname" [ - - ...args -] - -# Connection vcpu maximum -extern "virsh maxvcpus" [ - --type # Domain type - ...args -] - -# Get or set node memory parameters -extern "virsh node-memory-tune" [ - --shm-pages-to-scan # Number of pages to scan before the shared memory service goes to sleep - --shm-sleep-millisecs # Number of millisecs the shared memory service should sleep before next scan - --shm-merge-across-nodes # Specifies if pages from different numa nodes can be merged - ...args -] +export complete [virsh uri] [] -# Node cpu map -extern "virsh nodecpumap" [ - --pretty # Return human readable output - ...args +export complete [virsh version] [ + --daemon # Report the daemon version too ] - -# Prints cpu stats of the node -extern "virsh nodecpustats" [ - --cpu # Prints specified cpu statistics only - --percent # Prints by percentage during 1 second - ...args -] - -# Node information -extern "virsh nodeinfo" [ - - ...args -] - -# Prints memory stats of the node -extern "virsh nodememstats" [ - --cell # Prints specified cell statistics only - ...args -] - -# Suspend the host node for a given time duration -extern "virsh nodesuspend" [ - - ...args -] - -# Print the hypervisor sysinfo -extern "virsh sysinfo" [ - - ...args -] - -# Print the hypervisor canonical URI -extern "virsh uri" [ - - ...args -] - -# Show version -extern "virsh version" [ - --daemon # Report daemon version too - ...args -] - -# Create a snapshot of current interfaces settings -extern "virsh iface-begin" [ - - ...args -] - -# Create a bridge device and attach an existing network device to it -extern "virsh iface-bridge" [ - --no-stp # Do not enable STP for this bridge - --delay # Number of seconds to squelch traffic on newly connected ports - --no-start # Don't start the bridge immediately - ...args -] - -# Commit changes made since iface-begin and free restore point -extern "virsh iface-commit" [ - - ...args -] - -# Define or modify an inactive persistent physical host interface -extern "virsh iface-define" [ - - ...args -] - -# Destroy a physical host interface -extern "virsh iface-destroy" [ - - ...args -] - -# Interface information in XML -extern "virsh iface-dumpxml" [ - --inactive # Show inactive defined XML - ...args -] - -# Edit XML configuration for a physical host interface -extern "virsh iface-edit" [ - - ...args -] - -# List physical host interfaces -extern "virsh iface-list" [ - --inactive # List inactive interfaces - --all # List inactive & active interfaces - ...args -] - -# Convert an interface name to interface MAC address -extern "virsh iface-mac" [ - - ...args -] - -# Convert an interface MAC address to interface name -extern "virsh iface-name" [ - - ...args -] - -# Rollback to previous saved configuration created via iface-begin -extern "virsh iface-rollback" [ - - ...args -] - -# Start a physical host interface -extern "virsh iface-start" [ - - ...args -] - -# Undefine a bridge device after detaching its slave device -extern "virsh iface-unbridge" [ - --no-start # Don't start the un-slaved interface immediately - ...args -] - -# Undefine a physical host interface -extern "virsh iface-undefine" [ - - ...args -] - -# Define or update a network filter -extern "virsh nwfilter-define" [ - - ...args -] - -# Network filter information in XML -extern "virsh nwfilter-dumpxml" [ - - ...args -] - -# Edit XML configuration for a network filter -extern "virsh nwfilter-edit" [ - - ...args -] - -# List network filters -extern "virsh nwfilter-list" [ - - ...args -] - -# Undefine a network filter -extern "virsh nwfilter-undefine" [ - - ...args -] - -# Autostart a network -extern "virsh net-autostart" [ - --disable # Disable autostarting - ...args -] - -# Create a network from an XML file -extern "virsh net-create" [ - - ...args -] - -# Define or modify an inactive persistent virtual network -extern "virsh net-define" [ - - ...args -] - -# Destroy (stop) a network -extern "virsh net-destroy" [ - - ...args -] - -# Print lease info for a given network -extern "virsh net-dhcp-leases" [ - --mac # MAC address - ...args -] - -# Network information in XML -extern "virsh net-dumpxml" [ - --inactive # Show inactive defined XML - ...args -] - -# Edit XML configuration for a network -extern "virsh net-edit" [ - - ...args -] - -# Network Events -extern "virsh net-event" [ - --event # Which event type to wait for - --loop # Loop until timeout or interrupt, rather than one-shot - --timeout # Timeout seconds - --list # List valid event types - --timestamp # Show timestamp for each printed event - ...args -] - -# Network information -extern "virsh net-info" [ - - ...args -] - -# List networks -extern "virsh net-list" [ - --inactive # List inactive networks - --all # List inactive & active networks - --persistent # List persistent networks - --transient # List transient networks - --autostart # List networks with autostart enabled - --no-autostart # List networks with autostart disabled - --uuid # List UUID's only - --name # List network names only - --table # List table (default) - ...args -] - -# Convert a network UUID to network name -extern "virsh net-name" [ - - ...args -] - -# Start a (previously defined) inactive network -extern "virsh net-start" [ - - ...args -] - -# Undefine a persistent network -extern "virsh net-undefine" [ - - ...args -] - -# Update parts of an existing network's configuration -extern "virsh net-update" [ - --parent-index # Which parent object to search through - --config # Affect next network startup - --live # Affect running network - --current # Affect current state of network - ...args -] - -# Convert a network name to network UUID -extern "virsh net-uuid" [ - - ...args -] - -# Create a device defined by an XML file on the node -extern "virsh nodedev-create" [ - - ...args -] - -# Destroy (stop) a device on the node -extern "virsh nodedev-destroy" [ - - ...args -] - -# Detach node device from its device driver -extern "virsh nodedev-detach" [ - --driver # Pci device assignment backend driver (e.g. 'vfio' or 'kvm') - ...args -] - -# Node device details in XML -extern "virsh nodedev-dumpxml" [ - - ...args -] - -# Enumerate devices on this host -extern "virsh nodedev-list" [ - --tree # List devices in a tree - --cap # Capability names, separated by comma - ...args -] - -# Reattach node device to its device driver -extern "virsh nodedev-reattach" [ - - ...args -] - -# Reset node device -extern "virsh nodedev-reset" [ - - ...args -] - -# Node Device Events -extern "virsh nodedev-event" [ - --device # Filter by node device name - --event # Which event type to wait for - --loop # Loop until timeout or interrupt, rather than one-shot - --timeout # Timeout seconds - --list # List valid event types - --timestamp # Show timestamp for each printed event - ...args -] - -# Define or modify a secret -extern "virsh secret-define" [ - - ...args -] - -# Secret attributes in XML -extern "virsh secret-dumpxml" [ - - ...args -] - -# Secret Events -extern "virsh secret-event" [ - --secret # Filter by secret name or UUID - --event # Which event type to wait for - --loop # Loop until timeout or interrupt, rather than one-shot - --timeout # Timeout seconds - --list # List valid event types - --timestamp # Show timestamp for each printed event - ...args -] - -# Output a secret value -extern "virsh secret-get-value" [ - - ...args -] - -# List secrets -extern "virsh secret-list" [ - --ephemeral # List ephemeral secrets - --no-ephemeral # List non-ephemeral secrets - --private # List private secrets - --no-private # List non-private secrets - ...args -] - -# Set a secret value -extern "virsh secret-set-value" [ - - ...args -] - -# Undefine a secret -extern "virsh secret-undefine" [ - - ...args -] - -# Create a snapshot from XML -extern "virsh snapshot-create" [ - --xmlfile # Domain snapshot XML - --redefine # Redefine metadata for existing snapshot - --current # With redefine, set current snapshot - --no-metadata # Take snapshot but create no metadata - --halt # Halt domain after snapshot is created - --disk-only # Capture disk state but not vm state - --reuse-external # Reuse any existing external files - --quiesce # Quiesce guest's file systems - --atomic # Require atomic operation - --live # Take a live snapshot - --name # Name of snapshot - --description # Description of snapshot - --print-xml # Print XML document rather than create - --no-metadata # Take snapshot but create no metadata - --halt # Halt domain after snapshot is created - --disk-only # Capture disk state but not vm state - --reuse-external # Reuse any existing external files - --quiesce # Quiesce guest's file systems - --atomic # Require atomic operation - --live # Take a live snapshot - --memspec # Memory attributes: [file=]name[,snapshot=type] - ...args -] - -# Create a snapshot from a set of args -extern "virsh snapshot-create-as" [ - --name # Name of snapshot - --description # Description of snapshot - --print-xml # Print XML document rather than create - --no-metadata # Take snapshot but create no metadata - --halt # Halt domain after snapshot is created - --disk-only # Capture disk state but not vm state - --reuse-external # Reuse any existing external files - --quiesce # Quiesce guest's file systems - --atomic # Require atomic operation - --live # Take a live snapshot - --memspec # Memory attributes: [file=]name[,snapshot=type] - ...args -] - -# Get or set the current snapshot -extern "virsh snapshot-current" [ - --name # List the name, rather than the full xml - --security-info # Include security sensitive information in XML dump - --snapshotname # Name of existing snapshot to make current - ...args -] - -# Delete a domain snapshot -extern "virsh snapshot-delete" [ - --snapshotname # Snapshot name - --current # Delete current snapshot - --children # Delete snapshot and all children - --children-only # Delete children but not snapshot - --metadata # Delete only libvirt metadata, leaving snapshot contents behind - ...args -] - -# Dump XML for a domain snapshot -extern "virsh snapshot-dumpxml" [ - --security-info # Include security sensitive information in XML dump - ...args -] - -# Edit XML for a snapshot -extern "virsh snapshot-edit" [ - --snapshotname # Snapshot name - --current # Also set edited snapshot as current - --rename # Allow renaming an existing snapshot - --clone # Allow cloning to new name - ...args -] - -# Snapshot information -extern "virsh snapshot-info" [ - --snapshotname # Snapshot name - --current # Info on current snapshot - ...args -] - -# List snapshots for a domain -extern "virsh snapshot-list" [ - --parent # Add a column showing parent snapshot - --roots # List only snapshots without parents - --leaves # List only snapshots without children - --no-leaves # List only snapshots that are not leaves (with children) - --metadata # List only snapshots that have metadata that would prevent undefine - --no-metadata # List only snapshots that have no metadata managed by libvirt - --inactive # Filter by snapshots taken while inactive - --active # Filter by snapshots taken while active (system checkpoints) - --disk-only # Filter by disk-only snapshots - --internal # Filter by internal snapshots - --external # Filter by external snapshots - --tree # List snapshots in a tree - --from # Limit list to children of given snapshot - --current # Limit list to children of current snapshot - --descendants # With --from, list all descendants - --name # List snapshot names only - ...args -] - -# Get the name of the parent of a snapshot -extern "virsh snapshot-parent" [ - --snapshotname # Find parent of snapshot name - --current # Find parent of current snapshot - ...args -] - -# Revert a domain to a snapshot -extern "virsh snapshot-revert" [ - --snapshotname # Snapshot name - --current # Revert to current snapshot - --running # After reverting, change state to running - --paused # After reverting, change state to paused - --force # Try harder on risky reverts - ...args -] - -# Find potential storage pool sources -extern "virsh find-storage-pool-sources-as" [ - --host # Optional host to query - --port # Optional port to query - --initiator # Optional initiator IQN to use for query - ...args -] - -# Discover potential storage pool sources -extern "virsh find-storage-pool-sources" [ - --host # Optional host to query - --port # Optional port to query - --initiator # Optional initiator IQN to use for query - --srcSpec # Optional file of source xml to query for pools - ...args -] - -# Autostart a pool -extern "virsh pool-autostart" [ - --disable # Disable autostarting - ...args -] - -# Build a pool -extern "virsh pool-build" [ - --no-overwrite # Do not overwrite any existing data - --overwrite # Overwrite any existing data - ...args -] - -# Create a pool from a set of args -extern "virsh pool-create-as" [ - --print-xml # Print XML document, but don't define/create - --source-host # Source-host for underlying storage - --source-path # Source path for underlying storage - --source-dev # Source device for underlying storage - --source-name # Source name for underlying storage - --target # Target for underlying storage - --source-format # Format for underlying storage - --auth-type # Auth type to be used for underlying storage - --auth-username # Auth username to be used for underlying storage - --secret-usage # Auth secret usage to be used for underlying storage - --secret-uuid # Auth secret UUID to be used for underlying storage - --adapter-name # Adapter name to be used for underlying storage - --adapter-wwnn # Adapter wwnn to be used for underlying storage - --adapter-wwpn # Adapter wwpn to be used for underlying storage - --adapter-parent # Adapter parent to be used for underlying storage - --build # Build the pool as normal - --no-overwrite # Do not overwrite any existing data - --overwrite # Overwrite any existing data - ...args -] - -# Create a pool from an XML file -extern "virsh pool-create" [ - --print-xml # Print XML document, but don't define/create - --source-host # Source-host for underlying storage - --source-path # Source path for underlying storage - --source-dev # Source device for underlying storage - --source-name # Source name for underlying storage - --target # Target for underlying storage - --source-format # Format for underlying storage - --auth-type # Auth type to be used for underlying storage - --auth-username # Auth username to be used for underlying storage - --secret-usage # Auth secret usage to be used for underlying storage - --secret-uuid # Auth secret UUID to be used for underlying storage - --adapter-name # Adapter name to be used for underlying storage - --adapter-wwnn # Adapter wwnn to be used for underlying storage - --adapter-wwpn # Adapter wwpn to be used for underlying storage - --adapter-parent # Adapter parent to be used for underlying storage - --build # Build the pool as normal - --no-overwrite # Do not overwrite any existing data - --overwrite # Overwrite any existing data - --build # Build the pool as normal - --no-overwrite # Do not overwrite any existing data - --overwrite # Overwrite any existing data - ...args -] - -# Define a pool from a set of args -extern "virsh pool-define-as" [ - --print-xml # Print XML document, but don't define/create - --source-host # Source-host for underlying storage - --source-path # Source path for underlying storage - --source-dev # Source device for underlying storage - --source-name # Source name for underlying storage - --target # Target for underlying storage - --source-format # Format for underlying storage - --auth-type # Auth type to be used for underlying storage - --auth-username # Auth username to be used for underlying storage - --secret-usage # Auth secret usage to be used for underlying storage - --secret-uuid # Auth secret UUID to be used for underlying storage - --adapter-name # Adapter name to be used for underlying storage - --adapter-wwnn # Adapter wwnn to be used for underlying storage - --adapter-wwpn # Adapter wwpn to be used for underlying storage - --adapter-parent # Adapter parent to be used for underlying storage - ...args -] - -# Define or modify an inactive persistent storage pool -extern "virsh pool-define" [ - --print-xml # Print XML document, but don't define/create - --source-host # Source-host for underlying storage - --source-path # Source path for underlying storage - --source-dev # Source device for underlying storage - --source-name # Source name for underlying storage - --target # Target for underlying storage - --source-format # Format for underlying storage - --auth-type # Auth type to be used for underlying storage - --auth-username # Auth username to be used for underlying storage - --secret-usage # Auth secret usage to be used for underlying storage - --secret-uuid # Auth secret UUID to be used for underlying storage - --adapter-name # Adapter name to be used for underlying storage - --adapter-wwnn # Adapter wwnn to be used for underlying storage - --adapter-wwpn # Adapter wwpn to be used for underlying storage - --adapter-parent # Adapter parent to be used for underlying storage - ...args -] - -# Delete a pool -extern "virsh pool-delete" [ - - ...args -] - -# Destroy (stop) a pool -extern "virsh pool-destroy" [ - - ...args -] - -# Pool information in XML -extern "virsh pool-dumpxml" [ - --inactive # Show inactive defined XML - ...args -] - -# Edit XML configuration for a storage pool -extern "virsh pool-edit" [ - - ...args -] - -# Storage pool information -extern "virsh pool-info" [ - --bytes # Return pool info in bytes - ...args -] - -# List pools -extern "virsh pool-list" [ - --inactive # List inactive pools - --all # List inactive & active pools - --transient # List transient pools - --persistent # List persistent pools - --autostart # List pools with autostart enabled - --no-autostart # List pools with autostart disabled - --type # Only list pool of specified type(s) (if supported) - --details # Display extended details for pools - --uuid # List UUID of active pools only - --name # List name of active pools only - ...args -] - -# Convert a pool UUID to pool name -extern "virsh pool-name" [ - - ...args -] - -# Refresh a pool -extern "virsh pool-refresh" [ - - ...args -] - -# Start a (previously defined) inactive pool -extern "virsh pool-start" [ - --build # Build the pool as normal - --no-overwrite # Do not overwrite any existing data - --overwrite # Overwrite any existing data - ...args -] - -# Undefine an inactive pool -extern "virsh pool-undefine" [ - - ...args -] - -# Convert a pool name to pool UUID -extern "virsh pool-uuid" [ - - ...args -] - -# Storage Pool Events -extern "virsh pool-event" [ - --pool # Filter by storage pool name or UUID - --event # Which event type to wait for - --loop # Loop until timeout or interrupt, rather than one-shot - --timeout # Timeout seconds - --list # List valid event types - --timestamp # Show timestamp for each printed event - ...args -] - -# Clone a volume -extern "virsh vol-clone" [ - --pool # Pool name or UUID - --prealloc-metadata # Preallocate metadata (for qcow2 instead of full allocation) - --reflink # Use btrfs COW lightweight copy - ...args -] - -# Create a volume from a set of args -extern "virsh vol-create-as" [ - --allocation # Initial allocation size, as scaled integer (default bytes) - --format # File format type raw,bochs,qcow,qcow2,qed,vmdk - --backing-vol # The backing volume if taking a snapshot - --backing-vol-format # Format of backing volume if taking a snapshot - --prealloc-metadata # Preallocate metadata (for qcow2 instead of full allocation) - --print-xml # Print XML document, but don't define/create - ...args -] - -# Create a vol from an XML file -extern "virsh vol-create" [ - --allocation # Initial allocation size, as scaled integer (default bytes) - --format # File format type raw,bochs,qcow,qcow2,qed,vmdk - --backing-vol # The backing volume if taking a snapshot - --backing-vol-format # Format of backing volume if taking a snapshot - --prealloc-metadata # Preallocate metadata (for qcow2 instead of full allocation) - --print-xml # Print XML document, but don't define/create - --prealloc-metadata # Preallocate metadata (for qcow2 instead of full allocation) - --inputpool # Pool name or UUID of the input volume's pool - --prealloc-metadata # Preallocate metadata (for qcow2 instead of full allocation) - --reflink # Use btrfs COW lightweight copy - ...args -] - -# Create a vol, using another volume as input -extern "virsh vol-create-from" [ - --inputpool # Pool name or UUID of the input volume's pool - --prealloc-metadata # Preallocate metadata (for qcow2 instead of full allocation) - --reflink # Use btrfs COW lightweight copy - ...args -] - -# Delete a vol -extern "virsh vol-delete" [ - --pool # Pool name or UUID - --delete-snapshots # Delete snapshots associated with volume (must be supported by storage driver) - ...args -] - -# Download volume contents to a file -extern "virsh vol-download" [ - --pool # Pool name or UUID - --offset # Volume offset to download from - --length # Amount of data to download - --sparse # Preserve sparseness of volume - ...args -] - -# Vol information in XML -extern "virsh vol-dumpxml" [ - --pool # Pool name or UUID - ...args -] - -# Storage vol information -extern "virsh vol-info" [ - --pool # Pool name or UUID - --bytes # Sizes are represented in bytes rather than pretty units - --physical # Return the physical size of the volume in allocation field - ...args -] - -# Returns the volume key for a given volume name or path -extern "virsh vol-key" [ - --pool # Pool name or UUID - ...args -] - -# List vols -extern "virsh vol-list" [ - --details # Display extended details for volumes - ...args -] - -# Returns the volume name for a given volume key or path -extern "virsh vol-name" [ - - ...args -] - -# Returns the volume path for a given volume name or key -extern "virsh vol-path" [ - --pool # Pool name or UUID - ...args -] - -# Returns the storage pool for a given volume key or path -extern "virsh vol-pool" [ - --uuid # Return the pool UUID rather than pool name - ...args -] - -# Resize a vol -extern "virsh vol-resize" [ - --pool # Pool name or UUID - --allocate # Allocate the new capacity, rather than leaving it sparse - --delta # Use capacity as a delta to current size, rather than the new size - --shrink # Allow the resize to shrink the volume - ...args -] - -# Upload file contents to a volume -extern "virsh vol-upload" [ - --pool # Pool name or UUID - --offset # Volume offset to upload to - --length # Amount of data to upload - --sparse # Preserve sparseness of volume - ...args -] - -# Wipe a vol -extern "virsh vol-wipe" [ - --pool # Pool name or UUID - --algorithm # Perform selected wiping algorithm - ...args -] \ No newline at end of file diff --git a/custom-completions/vscode/vscode-completions.nu b/custom-completions/vscode/vscode-completions.nu index d91739eb9..4d5f34120 100644 --- a/custom-completions/vscode/vscode-completions.nu +++ b/custom-completions/vscode/vscode-completions.nu @@ -1,71 +1,126 @@ +# Declarative completions for Visual Studio Code (`code`). -export extern "code" [ - command?: string # file or string to to open. Type `code -` to read from stdin - --diff(-d): string # <file> <file> Perform a three-way merge by providing paths for two modified versions of a file, the common origin of both modified versions and the output file to save merge results - --merge(-m) # <path1> <path2> <base> <result> Perform a three-way merge by providing paths for two modified versions of a file, the common origin of both modified versions and the output file to save merge results - --add(-a): string # Add folder(s) to the last active window - --goto(-g) # <file:line[:character]> Open a file at the path on the specified line and character position - --new-window(-n) # Force to open a new window - --reuse-window(-r) # Force to open a file or folder in an already opened window - --wait(-w) # Wait for the files to be closed before returning - --user-data-dir # Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code - --profile # <profileName> Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created. A folder or workspace must be provided for the profile to take effect - --help(-h) # Print usage - --extensions-dir: path # Set the root path for extensions - --list-extensions # List the installed extensions - --install-extension: string # <ext-id | path> Installs or updates an extension. The argument is either an extension id or a path to a VSIX. The identifier of an extension is '${publisher}.${name}' - --uninstall-extension: string # <ext-id> Uninstalls an extension - --enable-proposed-api: string # <ext-id> Enables proposed API features for extensions. Can receive one or more extension IDs to enable individually - --version(-v) # Print version - --verbose # Print verbose output (implies --wait) - --log: string@"nu-complete log level" # Log level to use. Default is 'info'. You can also configure the log level of an extension by passing extension id and log level. For example: 'vscode.csharp:trace' - --status(-s) # Print process usage and diagnostics information - --prof-startup # Run CPU profiler during startup - --disable-extensions # Disable all installed extensions. This option is not persisted and is effective only when the command opens a new window - --disable-extension: string # <ext-id> Disable the provided extension. This option is not persisted and is effective only when the command opens a new window - --sync: string@"nu-complete on-off" # Turn sync on or off - --inspect-extensions: number # <port> Allow debugging and profiling of extensions. Check the developer tools for the connection URI - --inspect-brk-extensions: number # <port> Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI - --disable-gpu # Disable GPU hardware acceleration - --disable-chromium-sandbox # Use this option only when there is requirement to launch the application as sudo user on Linux or when running as an elevated user in an applocker environment on Windows - --telemetry # Shows all telemetry events which VS code collects -] - -def "nu-complete log level" [] { - ["critical", "error", "warn", "info", "debug", "trace", "off"] +# Installed extensions, read from the extensions manifest (much faster than `code --list-extensions`). +@non-destructive +export def "nu-complete code extensions" [] { + try { + let manifest = $env.VSCODE_EXTENSIONS? | default ("~/.vscode/extensions" | path expand) | path join extensions.json + open $manifest | each {|e| {value: $e.identifier.id, description: ($e.version? | default "")} } + } catch { + try { ^code --list-extensions | lines } catch { [] } + } } - -def "nu-complete on-off" [] { - ["on", "off"] +# Profiles created in the editor. +@non-destructive +export def "nu-complete code profiles" [] { + try { + let base = match $nu.os-info.name { + "macos" => "~/Library/Application Support/Code" + "windows" => ($env.APPDATA | path join Code) + _ => "~/.config/Code" + } + open ($base | path expand | path join User globalStorage storage.json) | get userDataProfiles | get name + } catch { [] } } -def "nu-complete code extensions" [] { - ^code --list-extensions | lines +# Visual Studio Code +export complete [code] [ + --diff(-d) # Compare two files with each other + --merge(-m) # Three-way merge: <path1> <path2> <base> <result> + --add(-a): dir # Add folder(s) to the last active window + --remove: dir # Remove folder(s) from the last active window + --goto(-g): path # Open a file at file:line[:character] + --new-window(-n) # Force a new window + --reuse-window(-r) # Force an already opened window + --wait(-w) # Wait for the files to be closed before returning + --locale: words [en de es fr it ja ko ru zh-cn zh-tw pt-br] # The locale to use + --user-data-dir: dir # Directory for user data (separate instances) + --profile: by "nu-complete code profiles" # Open with this profile + --extensions-dir: dir # Root path for extensions + --list-extensions # List the installed extensions + --show-versions # Show versions of installed extensions (with --list-extensions) + --category: words [azure "data science" debuggers "extension packs" education formatters keymaps "language packs" linters "machine learning" notebooks programming languages "scm providers" snippets testing themes visualization other] # Filter installed extensions by category + --install-extension: text # Install or update an extension (id or path to a VSIX) + --pre-release # Install the pre-release version (with --install-extension) + --force # Update to the latest version without prompting + --uninstall-extension: by "nu-complete code extensions" # Uninstall an extension + --update-extensions # Update the installed extensions + --enable-proposed-api: by "nu-complete code extensions" # Enable proposed API features for extensions + --disable-extension: by "nu-complete code extensions" # Disable an extension for the new window + --disable-extensions # Disable all installed extensions for the new window + --version(-v) # Print version + --verbose # Print verbose output (implies --wait) + --log: words [critical error warn info debug trace off] # Log level + --status(-s) # Print process usage and diagnostics information + --prof-startup # Run the CPU profiler during startup + --sync: words [on off] # Turn sync on or off + --inspect-extensions: text # Port for debugging and profiling extensions + --inspect-brk-extensions: text # Same, with the extension host paused after start + --disable-gpu # Disable GPU hardware acceleration + --disable-chromium-sandbox # Disable the Chromium sandbox + --disable-lcd-text # Disable LCD font rendering + --telemetry # Show all telemetry events VS Code collects + --help(-h) # Print usage + ...paths: path # Files or folders to open (`-` reads from stdin) +] where { + excludes --new-window --reuse-window + excludes --diff --merge + requires --show-versions --list-extensions + requires --category --list-extensions + requires --pre-release --install-extension + excludes --disable-extensions --disable-extension + terminal [--help --version --status --list-extensions --install-extension --uninstall-extension --update-extensions --telemetry] } -export extern "code --list-extensions" [ - --category # Filters installed extensions by provided category - --show-versions # Show versions of installed extensions -] - -export extern "code --disable-extension" [ - extension: string@"nu-complete code extensions" -] +# Make the current machine accessible from vscode.dev or other machines through a secure tunnel +export complete [code tunnel] [ + --name: text # Name of the tunnel + --accept-server-license-terms # Accept the server license terms + --server-data-dir: dir # Directory to keep the server data in + --cli-data-dir: dir # Directory to keep the CLI data in + --no-sleep # Keep the machine awake while the tunnel runs + --random-name # Pick a random tunnel name + --verbose # Print verbose output + --log: words [trace debug info warn error critical off] # Log level + --help(-h) # Print help + command?: words [prune kill restart status rename unregister user service] # Tunnel subcommand +] where { + excludes --name --random-name + terminal [--help] +} -export extern "code --uninstall-extension" [ - extension: string@"nu-complete code extensions" -] +# Run a server that displays the editor UI in browsers +export complete [code serve-web] [ + --host: hosts # Host to listen on + --port: text # Port to listen on + --socket-path: path # Unix socket to listen on instead of a port + --connection-token: text # Secret that must be included with all requests + --connection-token-file: path # File containing the connection token + --without-connection-token # Do not require a connection token + --accept-server-license-terms # Accept the server license terms + --server-base-path: text # Path under which the server is served + --server-data-dir: dir # Directory to keep the server data in + --help(-h) # Print help +] where { + excludes --socket-path --port + at-most-one [--connection-token --connection-token-file --without-connection-token] + terminal [--help] +} -export extern "code --install-extension" [ - --pre-release # Installs the pre-release version of the extension - --force # update to latest version -] +# Manage the installed VS Code CLI +export complete [code update] [ + --check # Only check for updates + --help(-h) # Print help +] where { terminal [--help] } -export extern "code tunnel" [ - # TODO -] +# Print process usage and diagnostics information +export complete [code status] [ + --help(-h) # Print help +] where { terminal [--help] } -export extern "code serve-web" [ - # TODO -] +# Print the version +export complete [code version] [ + --help(-h) # Print help + command?: words [use show] # Version subcommand +] where { terminal [--help] } diff --git a/custom-completions/windows/windows-completions.nu b/custom-completions/windows/windows-completions.nu index 7c6feac27..94fcd7e7a 100644 --- a/custom-completions/windows/windows-completions.nu +++ b/custom-completions/windows/windows-completions.nu @@ -1,6 +1,8 @@ export module win { # open in visual studio + @example "Open a solution in Visual Studio" { win open in visual-studio C:/src/app/app.sln } + @example "Open a project in Visual Studio" { win open in visual-studio C:/src/app/myproject.csproj } export def "open in visual-studio" [file: path] { let vswhere = $'($env."ProgramFiles(x86)")\Microsoft Visual Studio\Installer\vswhere.exe' if not ($vswhere | path exists) { error make {msg: $"($vswhere) not found" } } @@ -15,23 +17,60 @@ export module win { } # file version and signature viewer from file + @example "Show the version and signature of an executable" { win read version C:/Windows/System32/notepad.exe } + @example "Show the version and signature of a DLL" { win read version C:/Windows/System32/kernel32.dll } export def "read version" [file: path] { ^sigcheck -nobanner $file | lines | skip 1 | parse --regex '\s*(?<name>.+?):(?<value>.+)' } - # application for CPU spikes, unhandled exception and hung window monitoring cli tool - # + # Sysinternals ProcDump: dump processes on CPU spikes, unhandled exceptions or hung windows. # https://learn.microsoft.com/en-us/sysinternals/downloads/procdump#using-procdump - # - # Examples: - # Install ProcDump as the (AeDebug) postmortem debugger: - # procdump -ma -i c:\dumps - # - # Uninstall ProcDump as the (AeDebug) postmortem debugger: - # procdump -u - export extern "procdump" [ ...args: any ] + export complete [procdump] profile single-dash-v1 [ + -ma # Full dump (all process memory) + -mp # MiniPlus dump + -mm # Mini dump (default) + -mt # Triage dump + -mk # Also write a kernel dump + -mc: text # Custom dump with this MINIDUMP_TYPE mask + -md: path # Callback DLL for MiniDumpCallbackRoutine + -a # Avoid suspension (clone the process) + -at: text # Avoid outage: cancel trigger after N seconds + -b # Treat debug breakpoints as exceptions + -c: text # CPU threshold percentage + -cl: text # CPU lower threshold percentage + -e # Dump on unhandled exceptions (-e 1 for first-chance) + -f: text # Include filter on exception or debug-log content + -fx: text # Exclude filter on exception or debug-log content + -g # Run as a native debugger in a managed process + -h # Dump on a hung window + -i: dir # Install as the AeDebug postmortem debugger, writing dumps here + -k # Kill the process after cloning or at the end of collection + -l # Display the debug logging of the process + -m: text # Commit memory threshold in MB + -ml: text # Commit memory lower threshold in MB + -n: text # Number of dumps to write before exiting + -o # Overwrite an existing dump file + -p: text # Performance counter threshold + -pl: text # Performance counter lower threshold + -r # Reflect (clone) the process for the dump + -s: text # Consecutive seconds before a dump [default: 10] + -t # Dump on process termination + -u # Uninstall as the postmortem debugger + -w # Wait for the process to launch + -wer # Queue the dump to Windows Error Reporting + -x: dir # Launch an image and dump into this folder + -accepteula # Accept the Sysinternals license + -? # Show help + target?: processes # Process name or PID + dump?: path # Dump file or folder + ] where { + at-most-one [-ma -mp -mm -mt -mc] + at-most-one [-i -u] + } # list logical disks somehing akin to unix's df command + @example "List the logical disks with their free space" { win disk free } + @example "Disks that are more than 90% full" { win disk free | where Use% > 90 } export def "disk free" [] { (wmic logicaldisk get deviceid,size,freespace,volumename,description | str trim | detect columns diff --git a/custom-completions/winget/winget-completions.nu b/custom-completions/winget/winget-completions.nu index 6f13feb31..873564a0b 100644 --- a/custom-completions/winget/winget-completions.nu +++ b/custom-completions/winget/winget-completions.nu @@ -1,28 +1,11 @@ # Written by Genna # Windows Package Manager +# winget's `-?` help alias cannot be declared as a short flag; use `--help`. -def "nu-complete winget install locale" [] { - [ - "ar-SA","bn-BD","bn-IN","cs-CZ","da-DK","de-AT","de-CH","de-DE","el-GR", - "en-AU","en-CA","en-GB","en-IE","en-IN","en-NZ","en-US","en-ZA","es-AR", - "es-CL","es-CO","es-ES","es-MX","es-US","fi-FI","fr-BE","fr-CA","fr-CH", - "fr-FR","he-IL","hi-IN","hu-HU","id-ID","it-CH","it-IT","jp-JP","ko-KR", - "nl-BE","nl-NL","no-NO","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK", - "sv-SE","ta-IN","ta-LK","th-TH","tr-TR","zh-CN","zh-HK","zh-TW" - ] -} - -def "nu-complete winget install source" [] { - ^winget source list | lines | skip 2 | split column ' ' | get column1 -} - -def "nu-complete winget install scope" [] { - ["user", "machine"] -} - -def "nu-complete winget source type" [] { - ["Microsoft.PreIndexed.Package"] +@non-destructive +export def "nu-complete winget install source" [] { + try { ^winget source list | lines | skip 2 | split column ' ' | get column1 } catch { [] } } def "nu-complete winget flagify" [name: string, value: any, --short(-s)] { @@ -40,145 +23,196 @@ def "nu-complete winget trimLoadingSymbol" [] { str replace -r r#'^[^\w]*'# "" } -def "nu-complete winget uninstall package id" [] { - ^winget export -s winget -o __winget-temp__.json | ignore - let results = (open __winget-temp__.json | get Sources.Packages | first | get PackageIdentifier) - rm __winget-temp__.json | ignore - $results +@non-destructive +export def "nu-complete winget uninstall package id" [] { + try { winget list | get id | str trim | where $it != '' } catch { [] } } -def "nu-complete winget uninstall package name" [] { - winget list | get name | str trim | str replace "…" "..." +@non-destructive +export def "nu-complete winget uninstall package name" [] { + try { winget list | get name | str trim | str replace "…" "..." } catch { [] } } -def "nu-complete winget install name" [] { - let path = ($env.TMP | path join winget-packages.csv) - - let completions = if ($path | path exists) and (ls $path | first | get modified | ((date now) - $in) < 1day) { - open $path | get name | each { |it| $"(char dq)($it)(char dq)" } | str replace "…" "" +# Package rows from winget's search cache (`winget-packages.csv` in TMP) while it is less than a +# day old, else from a fresh `winget search`. Read-only: the cache is never written here. +def "nu-complete winget cached packages" [] { + let dir = ($env.TMP? | default $env.TEMP?) + let path = if $dir != null { $dir | path join winget-packages.csv } + if $path != null and ($path | path exists) and (((date now) - (ls $path | first | get modified)) < 1day) { + open $path } else { - # Chinese characters break parsing, filter broken entries with `where source == winget` - let data = (winget search | where source == winget | select name id) - $data | save --force $path | ignore - $data | get name | each { |it| $"(char dq)($it)(char dq)" } | str replace "…" "" - } - { - completions: $completions - options: { - case_sensitive: false - positional: false - } + # Chinese characters break parsing; keep only the well-formed `winget` source rows + winget search | where source == winget | select name id } } -def "nu-complete winget install id" [] { - let path = ($env.TMP | path join winget-packages.csv) +@non-destructive +export def "nu-complete winget install name" [] { + try { nu-complete winget cached packages | get name | str replace "…" "" } catch { [] } +} - if ($path | path exists) and (ls $path | first | get modified | ((date now) - $in) < 1day) { - open $path | get id | str replace "…" "" - } else { - # Chinese characters break parsing, filter broken entries with `where source == winget` - let data = (winget search | where source == winget | select name id) - $data | save --force $path | ignore - $data | get id | str replace "…" "" - } +@non-destructive +export def "nu-complete winget install id" [] { + try { + nu-complete winget cached packages + | each {|p| {value: ($p.id | str replace "…" ""), description: $p.name} } + } catch { [] } } -export extern winget [ - --version(-v), # Display the version of the tool - --info, # Display general info of the tool - --help(-?), # Display the help for this command +export complete [winget] [ + --version(-v) # Display the version of the tool + --info # Display general info of the tool + --help # Display the help for this command ] # Installs the given package -export extern "winget install" [ - query?: string@"nu-complete winget install name", - --query(-q): string@"nu-complete winget install name", # The query used to search for a package - --manifest(-m): path, # The path to the manifest of the package - --id: string@"nu-complete winget install id", # Filter results by id - --name: string@"nu-complete winget install name", # Filter results by name - --moniker: string, # Filter results by moniker - --version(-v): string, # Use the specified version; default is the latest version - --source(-s): string@"nu-complete winget install source", # Find package using the specified source - --scope: string@"nu-complete winget install scope", # Select install scope (user or machine) - --exact(-e), # Find package using exact match - --interactive(-i), # Request interactive installation; user input may be needed - --silent(-h), # Request silent installation - --locale: string@"nu-complete winget install locale", # Locale to use (BCP47 format) - --log(-o): path, # Log location (if supported) - --override: string, # Override arguments to be passed on to the installer - --location(-l): path, # Location to install to (if supported) - --force, # Override the installer hash check - --accept_package_agreements, # Accept all licence agreements for packages - --header: string, # Optional Windows-Package-Manager REST source HTTP header - --accept_source_agreements, # Accept all source agreements during source operations - --help(-?) # Display the help for this command +export complete [winget install] [ + query?: by "nu-complete winget install name" + --query(-q): by "nu-complete winget install name" # The query used to search for a package + --manifest(-m): path # The path to the manifest of the package + --id: by "nu-complete winget install id" # Filter results by id + --name: by "nu-complete winget install name" # Filter results by name + --moniker: text # Filter results by moniker + --version(-v): text # Use the specified version; default is the latest version + --source(-s): by "nu-complete winget install source" # Find package using the specified source + --scope: words [user machine] # Select install scope (user or machine) + --exact(-e) # Find package using exact match + --interactive(-i) # Request interactive installation; user input may be needed + --silent(-h) # Request silent installation + --locale: words [ar-SA bn-BD bn-IN cs-CZ da-DK de-AT de-CH de-DE el-GR en-AU en-CA en-GB en-IE en-IN en-NZ en-US en-ZA es-AR es-CL es-CO es-ES es-MX es-US fi-FI fr-BE fr-CA fr-CH fr-FR he-IL hi-IN hu-HU id-ID it-CH it-IT jp-JP ko-KR nl-BE nl-NL no-NO pl-PL pt-BR pt-PT ro-RO ru-RU sk-SK sv-SE ta-IN ta-LK th-TH tr-TR zh-CN zh-HK zh-TW] # Locale to use (BCP47 format) + --log(-o): path # Log location (if supported) + --override: text # Override arguments to be passed on to the installer + --location(-l): path # Location to install to (if supported) + --force # Override the installer hash check + --accept_package_agreements # Accept all licence agreements for packages + --header: text # Optional Windows-Package-Manager REST source HTTP header + --accept_source_agreements # Accept all source agreements during source operations + --help # Display the help for this command ] -export alias "winget add" = winget install -export extern "winget show" [ - pos_query?: string, - --query(-q): string, # The query used to search for a package - --manifest(-m): string # The path to the manifest of the application to show - --id: string, # Filter results by id - --name: string, # Filter results by name - --moniker: string, # Filter results by moniker - --version(-v): string, # Use the specified version; default is the latest version - --source(-s): string@"nu-complete winget install source", # Find package using the specified source - --exact(-e), # Find package using exact match - --scope: string@"nu-complete winget install scope", # Select install scope (user or machine). Doesn't work rn, use ^winget - --architecture(-a): string # Select the architecture to show - --installer-type: string # Select the installer type to show - --locale: string@"nu-complete winget install locale", # Locale to use (BCP47 format) - --versions # Show available versions of the application - --header: string, # Optional Windows-Package-Manager REST source HTTP header - --authentication-mode: string # Specify authentication window preference (silent, silentPreferred or interactive) - --authentication-account: string # Specify the account to be used for authentication - --accept_source_agreements, # Accept all source agreements during source operations - --help(-?), # Display the help for this command - --wait # Prompts the user to press any key before exiting - --logs # Open the default logs location - --open-logs # Open the default logs location - --verbose # Used to override the logging setting and create a verbose log - --verbose-logs # Used to override the logging setting and create a verbose log - --nowarn # Suppresses warning outputs. - --ignore-warnings # Suppresses warning outputs - --disable-interactivity # Disable interactive prompts - --proxy # Set a proxy to use for this execution - --no-proxy # Disable the use of proxy for this execution +# Alias of `winget install` +export complete [winget add] [ + query?: by "nu-complete winget install name" + --query(-q): by "nu-complete winget install name" # The query used to search for a package + --manifest(-m): path # The path to the manifest of the package + --id: by "nu-complete winget install id" # Filter results by id + --name: by "nu-complete winget install name" # Filter results by name + --moniker: text # Filter results by moniker + --version(-v): text # Use the specified version; default is the latest version + --source(-s): by "nu-complete winget install source" # Find package using the specified source + --scope: words [user machine] # Select install scope (user or machine) + --exact(-e) # Find package using exact match + --interactive(-i) # Request interactive installation; user input may be needed + --silent(-h) # Request silent installation + --locale: words [ar-SA bn-BD bn-IN cs-CZ da-DK de-AT de-CH de-DE el-GR en-AU en-CA en-GB en-IE en-IN en-NZ en-US en-ZA es-AR es-CL es-CO es-ES es-MX es-US fi-FI fr-BE fr-CA fr-CH fr-FR he-IL hi-IN hu-HU id-ID it-CH it-IT jp-JP ko-KR nl-BE nl-NL no-NO pl-PL pt-BR pt-PT ro-RO ru-RU sk-SK sv-SE ta-IN ta-LK th-TH tr-TR zh-CN zh-HK zh-TW] # Locale to use (BCP47 format) + --log(-o): path # Log location (if supported) + --override: text # Override arguments to be passed on to the installer + --location(-l): path # Location to install to (if supported) + --force # Override the installer hash check + --accept_package_agreements # Accept all licence agreements for packages + --header: text # Optional Windows-Package-Manager REST source HTTP header + --accept_source_agreements # Accept all source agreements during source operations + --help # Display the help for this command +] +export complete [winget show] [ + pos_query?: text + --query(-q): text # The query used to search for a package + --manifest(-m): text # The path to the manifest of the application to show + --id: text # Filter results by id + --name: text # Filter results by name + --moniker: text # Filter results by moniker + --version(-v): text # Use the specified version; default is the latest version + --source(-s): by "nu-complete winget install source" # Find package using the specified source + --exact(-e) # Find package using exact match + --scope: words [user machine] # Select install scope (user or machine). Doesn't work rn, use ^winget + --architecture(-a): text # Select the architecture to show + --installer-type: text # Select the installer type to show + --locale: words [ar-SA bn-BD bn-IN cs-CZ da-DK de-AT de-CH de-DE el-GR en-AU en-CA en-GB en-IE en-IN en-NZ en-US en-ZA es-AR es-CL es-CO es-ES es-MX es-US fi-FI fr-BE fr-CA fr-CH fr-FR he-IL hi-IN hu-HU id-ID it-CH it-IT jp-JP ko-KR nl-BE nl-NL no-NO pl-PL pt-BR pt-PT ro-RO ru-RU sk-SK sv-SE ta-IN ta-LK th-TH tr-TR zh-CN zh-HK zh-TW] # Locale to use (BCP47 format) + --versions # Show available versions of the application + --header: text # Optional Windows-Package-Manager REST source HTTP header + --authentication-mode: text # Specify authentication window preference (silent, silentPreferred or interactive) + --authentication-account: text # Specify the account to be used for authentication + --accept_source_agreements # Accept all source agreements during source operations + --help # Display the help for this command + --wait # Prompts the user to press any key before exiting + --logs # Open the default logs location + --open-logs # Open the default logs location + --verbose # Used to override the logging setting and create a verbose log + --verbose-logs # Used to override the logging setting and create a verbose log + --nowarn # Suppresses warning outputs. + --ignore-warnings # Suppresses warning outputs + --disable-interactivity # Disable interactive prompts + --proxy: text # Set a proxy to use for this execution + --no-proxy # Disable the use of proxy for this execution ] -export alias "winget view" = winget show +# Alias of `winget show` +export complete [winget view] [ + pos_query?: text + --query(-q): text # The query used to search for a package + --manifest(-m): text # The path to the manifest of the application to show + --id: text # Filter results by id + --name: text # Filter results by name + --moniker: text # Filter results by moniker + --version(-v): text # Use the specified version; default is the latest version + --source(-s): by "nu-complete winget install source" # Find package using the specified source + --exact(-e) # Find package using exact match + --scope: words [user machine] # Select install scope (user or machine). Doesn't work rn, use ^winget + --architecture(-a): text # Select the architecture to show + --installer-type: text # Select the installer type to show + --locale: words [ar-SA bn-BD bn-IN cs-CZ da-DK de-AT de-CH de-DE el-GR en-AU en-CA en-GB en-IE en-IN en-NZ en-US en-ZA es-AR es-CL es-CO es-ES es-MX es-US fi-FI fr-BE fr-CA fr-CH fr-FR he-IL hi-IN hu-HU id-ID it-CH it-IT jp-JP ko-KR nl-BE nl-NL no-NO pl-PL pt-BR pt-PT ro-RO ru-RU sk-SK sv-SE ta-IN ta-LK th-TH tr-TR zh-CN zh-HK zh-TW] # Locale to use (BCP47 format) + --versions # Show available versions of the application + --header: text # Optional Windows-Package-Manager REST source HTTP header + --authentication-mode: text # Specify authentication window preference (silent, silentPreferred or interactive) + --authentication-account: text # Specify the account to be used for authentication + --accept_source_agreements # Accept all source agreements during source operations + --help # Display the help for this command + --wait # Prompts the user to press any key before exiting + --logs # Open the default logs location + --open-logs # Open the default logs location + --verbose # Used to override the logging setting and create a verbose log + --verbose-logs # Used to override the logging setting and create a verbose log + --nowarn # Suppresses warning outputs. + --ignore-warnings # Suppresses warning outputs + --disable-interactivity # Disable interactive prompts + --proxy: text # Set a proxy to use for this execution + --no-proxy # Disable the use of proxy for this execution +] # Manage sources of packages -export extern "winget source" [ - --help(-?) # Display the help for this command +export complete [winget source] [ + --help # Display the help for this command ] # Add a new source -export extern "winget source add" [ - --name(-n): string, # Name of the source - --arg(-a): string, # Argument given to the source - --type(-t): string@"nu-complete winget source type", # Type of the source - --header: string, # Optional Windows-Package-Manager REST source HTTP header - --accept_source_agreements, # Accept all source agreements during source operations - --help(-?) # Display the help for this command +export complete [winget source add] [ + --name(-n): text # Name of the source + --arg(-a): text # Argument given to the source + --type(-t): words [Microsoft.PreIndexed.Package] # Type of the source + --header: text # Optional Windows-Package-Manager REST source HTTP header + --accept_source_agreements # Accept all source agreements during source operations + --help # Display the help for this command ] # List current sources +@example "List the sources" "winget source list" +@example "Print the sources as raw CLI output" "winget source list --raw" export def "winget source list" [ pos_name?: string, # Name of the source --name(-n): string, # Name of the source --raw, # Output the raw CLI output instead of structured data + --show-help(-?) # Display the help for this command ] { + # `--help` is reserved for Nushell's own help of this command: winget's is `--show-help`. let flagify = { |name, value| nu-complete winget flagify $name $value } let params = ([ "source" "list" $pos_name (do $flagify name $name) + (do $flagify help $show_help) ] | compact --empty) - if $raw { + if $raw or $show_help { ^winget ...$params } else { let output = (^winget ...$params | lines) @@ -192,33 +226,43 @@ export def "winget source list" [ export alias "winget source ls" = winget source list # Update current sources -export extern "winget source update" [ - --name(-n): string, # Name of the source - --help(-?) # Display the help for this command +export complete [winget source update] [ + --name(-n): text # Name of the source + --help # Display the help for this command ] -export alias "winget source refresh" = winget source update +# Alias of `winget source update` +export complete [winget source refresh] [ + --name(-n): text # Name of the source + --help # Display the help for this command +] # Remove current sources -export extern "winget source remove" [ - --name(-n): string, # Name of the source - --help(-?) # Display the help for this command +export complete [winget source remove] [ + --name(-n): text # Name of the source + --help # Display the help for this command ] -export alias "winget source rm" = winget source remove +# Alias of `winget source remove` +export complete [winget source rm] [ + --name(-n): text # Name of the source + --help # Display the help for this command +] # Reset sources -export extern "winget source reset" [ - --name(-n): string, # Name of the source - --force, # Forces the reset of the sources - --help(-?) # Display the help for this command +export complete [winget source reset] [ + --name(-n): text # Name of the source + --force # Forces the reset of the sources + --help # Display the help for this command ] # Export current sources -export extern "winget source export" [ - --name(-n): string, # Name of the source - --help(-?) # Display the help for this command +export complete [winget source export] [ + --name(-n): text # Name of the source + --help # Display the help for this command ] # Find and show basic info of packages +@example "Search for a package" "winget search firefox" +@example "Find a package by exact id" "winget search --id Mozilla.Firefox --exact" export def "winget search" [ pos_query?: string, --query(-q): string, # The query used to search for a package @@ -233,7 +277,9 @@ export def "winget search" [ --header: string, # Optional Windows-Package-Manager REST source HTTP header --accept_source_agreements, # Accept all source agreements during source operations --raw, # Output the raw CLI output instead of structured data + --show-help(-?) # Display the help for this command ] { + # `--help` is reserved by Nushell for the command's own help: winget's is `--show-help`. let flagify = { |name, value| nu-complete winget flagify $name $value } let params = [ @@ -253,6 +299,7 @@ export def "winget search" [ (do $flagify exact $exact) (do $flagify header $header) (do $flagify accept_source_agreements $accept_source_agreements) + (do $flagify help $show_help) ] | flatten | where { not ($in | is-empty) } @@ -260,7 +307,7 @@ export def "winget search" [ let output = ^winget ...$params | nu-complete winget trimLoadingSymbol - if $raw { + if $raw or $show_help { $output } else { let lines = ($output | detect columns --guess) | rename name id version match source @@ -275,6 +322,8 @@ export def "winget search" [ export alias "winget find" = winget search # Display installed packages in a structured way. +@example "List the installed packages" "winget list" +@example "List one package by id" "winget list --id Mozilla.Firefox" export def "winget list" [ pos_query?: string, --query(-q): string, # The query used to search for a package @@ -290,7 +339,9 @@ export def "winget list" [ --accept_source_agreements, # Accept all source agreements during source operations --upgrade_available # Filter results by available upgrade --raw, # Output the raw CLI output instead of structured data + --show-help(-?) # Display the help for this command ] { + # `--help` is reserved by Nushell for the command's own help: winget's is `--show-help`. let flagify = { |name, value| nu-complete winget flagify $name $value } let params = ( @@ -312,6 +363,7 @@ export def "winget list" [ (do $flagify header $header) (do $flagify accept_source_agreements $accept_source_agreements) (do $flagify upgrade-available $upgrade_available) + (do $flagify help $show_help) ] | flatten | where { not ($in | is-empty) }) @@ -319,7 +371,7 @@ export def "winget list" [ let output = ^winget ...$params | nu-complete winget trimLoadingSymbol - if $raw { + if $show_help or $raw { $output } else { let lines = ($output | detect columns --guess) | rename name id version available source @@ -337,112 +389,112 @@ export def "winget list" [ export alias "winget ls" = winget list # Add a pin. This subcommand requires that you specify the exact package to pin. If there is any ambiguity, you will be prompted to further filter the add subcommand to an exact application. -export extern "winget pin add" [ - query?: string, - --query(-q): string, # The query used to search for a package - --id: string, # Limit search by ID - --name: string, # Limit search by name - --moniker: string, # Limit search by moniker listed - --tag: string # Limit search by tag listed - --cmd: string # Limit search by command - --command: string # Limit search by command - --exact(-e), # Uses exact query string - --version(-v): string, # Pin exact version, wildcard * can be used as last part, changes pin behavior to gating - --source(-s): string@"nu-complete winget install source", # Restrict search to source - --header: string # Optional REST source HTTP header - --authentication-mode: string # Specify authentication window preference (silent, silentPreferred or interactive) - --authentication-account: string # Specify the account to be used for authentication - --accept-source-agreements, # Accept all source agreements during source operations - --force, # Override the installer hash check - --blocking # Block from upgrading until the pin is removed, preventing override arguments. Changes pin behavior to be blocking. - --installed: string # Pin a specific installed version - --help(-?) # Display the help for this command - --wait # Prompts the user to press any key before exiting - --logs # Open the default logs location - --open-logs # Open the default logs location - --verbose # Override the logging setting and create a verbose log - --verbose-logs # Override the logging setting and create a verbose log - --nowarn # Suppress waring outputs - --ignore-warnings # Suppress waring outputs - --disable-interactivity # Disable interactive prompts - --proxy: string # Use a proxy - --no-proxy # Do not use a proxy +export complete [winget pin add] [ + query?: text + --query(-q): text # The query used to search for a package + --id: text # Limit search by ID + --name: text # Limit search by name + --moniker: text # Limit search by moniker listed + --tag: text # Limit search by tag listed + --cmd: text # Limit search by command + --command: text # Limit search by command + --exact(-e) # Uses exact query string + --version(-v): text # Pin exact version, wildcard * can be used as last part, changes pin behavior to gating + --source(-s): by "nu-complete winget install source" # Restrict search to source + --header: text # Optional REST source HTTP header + --authentication-mode: text # Specify authentication window preference (silent, silentPreferred or interactive) + --authentication-account: text # Specify the account to be used for authentication + --accept-source-agreements # Accept all source agreements during source operations + --force # Override the installer hash check + --blocking # Block from upgrading until the pin is removed, preventing override arguments. Changes pin behavior to be blocking. + --installed: text # Pin a specific installed version + --help # Display the help for this command + --wait # Prompts the user to press any key before exiting + --logs # Open the default logs location + --open-logs # Open the default logs location + --verbose # Override the logging setting and create a verbose log + --verbose-logs # Override the logging setting and create a verbose log + --nowarn # Suppress waring outputs + --ignore-warnings # Suppress waring outputs + --disable-interactivity # Disable interactive prompts + --proxy: text # Use a proxy + --no-proxy # Do not use a proxy ] # Remove a pin. This subcommand requires that you specify the exact package pin to remove. If there is any ambiguity, you will be prompted to further filter the remove subcommand to an exact application. -export extern "winget pin remove" [ - query?: string, - --query(-q): string, # The query used to search for a package - --id: string, # Limit search by ID - --name: string, # Limit search by name - --moniker: string, # Limit search by moniker listed - --source(-s): string@"nu-complete winget install source", # Restrict search to source - --tag: string # Limit search by tag listed - --cmd: string # Limit search by command - --command: string # Limit search by command - --exact(-e), # Uses exact query string - --header: string # Optional REST source HTTP header - --authentication-mode: string # Specify authentication window preference (silent, silentPreferred or interactive) - --authentication-account: string # Specify the account to be used for authentication - --accept-source-agreements, # Accept all source agreements during source operations - --installed: string # Pin a specific installed version - --help(-?) # Display the help for this command - --wait # Prompts the user to press any key before exiting - --logs # Open the default logs location - --open-logs # Open the default logs location - --verbose # Override the logging setting and create a verbose log - --verbose-logs # Override the logging setting and create a verbose log - --nowarn # Suppress waring outputs - --ignore-warnings # Suppress waring outputs - --disable-interactivity # Disable interactive prompts - --proxy: string # Use a proxy - --no-proxy # Do not use a proxy +export complete [winget pin remove] [ + query?: text + --query(-q): text # The query used to search for a package + --id: text # Limit search by ID + --name: text # Limit search by name + --moniker: text # Limit search by moniker listed + --source(-s): by "nu-complete winget install source" # Restrict search to source + --tag: text # Limit search by tag listed + --cmd: text # Limit search by command + --command: text # Limit search by command + --exact(-e) # Uses exact query string + --header: text # Optional REST source HTTP header + --authentication-mode: text # Specify authentication window preference (silent, silentPreferred or interactive) + --authentication-account: text # Specify the account to be used for authentication + --accept-source-agreements # Accept all source agreements during source operations + --installed: text # Pin a specific installed version + --help # Display the help for this command + --wait # Prompts the user to press any key before exiting + --logs # Open the default logs location + --open-logs # Open the default logs location + --verbose # Override the logging setting and create a verbose log + --verbose-logs # Override the logging setting and create a verbose log + --nowarn # Suppress waring outputs + --ignore-warnings # Suppress waring outputs + --disable-interactivity # Disable interactive prompts + --proxy: text # Use a proxy + --no-proxy # Do not use a proxy ] # List all current pins -export extern "winget pin list" [ - query?: string, - --query(-q): string, # The query used to search for a package - --id: string, # Limit search by ID - --name: string, # Limit search by name - --moniker: string, # Limit search by moniker listed - --source(-s): string@"nu-complete winget install source", # Restrict search to source - --tag: string # Limit search by tag listed - --cmd: string # Limit search by command - --command: string # Limit search by command - --exact(-e), # Uses exact query string - --header: string # Optional REST source HTTP header - --authentication-mode: string # Specify authentication window preference (silent, silentPreferred or interactive) - --authentication-account: string # Specify the account to be used for authentication - --accept-source-agreements, # Accept all source agreements during source operations - --help(-?) # Display the help for this command - --wait # Prompts the user to press any key before exiting - --logs # Open the default logs location - --open-logs # Open the default logs location - --verbose # Override the logging setting and create a verbose log - --verbose-logs # Override the logging setting and create a verbose log - --nowarn # Suppress waring outputs - --ignore-warnings # Suppress waring outputs - --disable-interactivity # Disable interactive prompts - --proxy: string # Use a proxy - --no-proxy # Do not use a proxy +export complete [winget pin list] [ + query?: text + --query(-q): text # The query used to search for a package + --id: text # Limit search by ID + --name: text # Limit search by name + --moniker: text # Limit search by moniker listed + --source(-s): by "nu-complete winget install source" # Restrict search to source + --tag: text # Limit search by tag listed + --cmd: text # Limit search by command + --command: text # Limit search by command + --exact(-e) # Uses exact query string + --header: text # Optional REST source HTTP header + --authentication-mode: text # Specify authentication window preference (silent, silentPreferred or interactive) + --authentication-account: text # Specify the account to be used for authentication + --accept-source-agreements # Accept all source agreements during source operations + --help # Display the help for this command + --wait # Prompts the user to press any key before exiting + --logs # Open the default logs location + --open-logs # Open the default logs location + --verbose # Override the logging setting and create a verbose log + --verbose-logs # Override the logging setting and create a verbose log + --nowarn # Suppress waring outputs + --ignore-warnings # Suppress waring outputs + --disable-interactivity # Disable interactive prompts + --proxy: text # Use a proxy + --no-proxy # Do not use a proxy ] # Reset all pins. Without --force, shows all that would be removed. With --force, removes them. -export extern "winget pin reset" [ - --force # Direct run the command and continue with non security related issues - --source(-s): string@"nu-complete winget install source", # Restrict search to source - --help(-?) # Display the help for this command - --wait # Prompts the user to press any key before exiting - --logs # Open the default logs location - --open-logs # Open the default logs location - --verbose # Override the logging setting and create a verbose log - --verbose-logs # Override the logging setting and create a verbose log - --nowarn # Suppress waring outputs - --ignore-warnings # Suppress waring outputs - --disable-interactivity # Disable interactive prompts - --proxy: string # Use a proxy - --no-proxy # Do not use a proxy +export complete [winget pin reset] [ + --force # Direct run the command and continue with non security related issues + --source(-s): by "nu-complete winget install source" # Restrict search to source + --help # Display the help for this command + --wait # Prompts the user to press any key before exiting + --logs # Open the default logs location + --open-logs # Open the default logs location + --verbose # Override the logging setting and create a verbose log + --verbose-logs # Override the logging setting and create a verbose log + --nowarn # Suppress waring outputs + --ignore-warnings # Suppress waring outputs + --disable-interactivity # Disable interactive prompts + --proxy: text # Use a proxy + --no-proxy # Do not use a proxy ] def "winget upgrades" [] { @@ -475,91 +527,144 @@ def "winget upgrades" [] { } # Upgrades the given package -export extern "winget upgrade" [ - query?: string, - --query(-q): string, # The query used to search for a package - --manifest(-m): path, # The path to the manifest of the package - --id: string, # Filter results by id - --name: string, # Filter results by name - --moniker: string, # Filter results by moniker - --version(-v): string, # Use the specified version; default is the latest version - --source(-s): string@"nu-complete winget install source", # Find package using the specified source - --exact(-e), # Find package using exact match - --interactive(-i), # Request interactive installation; user input may be needed - --silent(-h), # Request silent installation - --log(-o): path, # Log location (if supported) - --override: string, # Override arguments to be passed on to the installer - --location(-l): path, # Location to install to (if supported) - --force, # Override the installer hash check - --accept_package_agreements, # Accept all licence agreements for packages - --header: string, # Optional Windows-Package-Manager REST source HTTP header - --accept_source_agreements, # Accept all source agreements during source operations - --all, # Update all installed packages to latest if available - --help(-?) # Display the help for this command +export complete [winget upgrade] [ + query?: text + --query(-q): text # The query used to search for a package + --manifest(-m): path # The path to the manifest of the package + --id: text # Filter results by id + --name: text # Filter results by name + --moniker: text # Filter results by moniker + --version(-v): text # Use the specified version; default is the latest version + --source(-s): by "nu-complete winget install source" # Find package using the specified source + --exact(-e) # Find package using exact match + --interactive(-i) # Request interactive installation; user input may be needed + --silent(-h) # Request silent installation + --log(-o): path # Log location (if supported) + --override: text # Override arguments to be passed on to the installer + --location(-l): path # Location to install to (if supported) + --force # Override the installer hash check + --accept_package_agreements # Accept all licence agreements for packages + --header: text # Optional Windows-Package-Manager REST source HTTP header + --accept_source_agreements # Accept all source agreements during source operations + --all # Update all installed packages to latest if available + --help # Display the help for this command ] -export alias "winget update" = winget upgrade +# Alias of `winget upgrade` +export complete [winget update] [ + query?: text + --query(-q): text # The query used to search for a package + --manifest(-m): path # The path to the manifest of the package + --id: text # Filter results by id + --name: text # Filter results by name + --moniker: text # Filter results by moniker + --version(-v): text # Use the specified version; default is the latest version + --source(-s): by "nu-complete winget install source" # Find package using the specified source + --exact(-e) # Find package using exact match + --interactive(-i) # Request interactive installation; user input may be needed + --silent(-h) # Request silent installation + --log(-o): path # Log location (if supported) + --override: text # Override arguments to be passed on to the installer + --location(-l): path # Location to install to (if supported) + --force # Override the installer hash check + --accept_package_agreements # Accept all licence agreements for packages + --header: text # Optional Windows-Package-Manager REST source HTTP header + --accept_source_agreements # Accept all source agreements during source operations + --all # Update all installed packages to latest if available + --help # Display the help for this command +] # Uninstalls the given package -export extern "winget uninstall" [ - query?: string@"nu-complete winget uninstall package name", - --query(-q): string@"nu-complete winget uninstall package name", # The query used to search for a package - --manifest(-m): path, # The path to the manifest of the package - --id: string@"nu-complete winget uninstall package id", # Filter results by id - --name: string@"nu-complete winget uninstall package name", # Filter results by name - --moniker: string, # Filter results by moniker - --version(-v): string, # Use the specified version; default is the latest version - --source(-s): string@"nu-complete winget install source", # Find package using the specified source - --exact(-e), # Find package using exact match - --interactive(-i), # Request interactive installation; user input may be needed - --silent(-h), # Request silent installation - --log(-o): path, # Log location (if supported) - --help(-?) # Display the help for this command +export complete [winget uninstall] [ + query?: by "nu-complete winget uninstall package name" + --query(-q): by "nu-complete winget uninstall package name" # The query used to search for a package + --manifest(-m): path # The path to the manifest of the package + --id: by "nu-complete winget uninstall package id" # Filter results by id + --name: by "nu-complete winget uninstall package name" # Filter results by name + --moniker: text # Filter results by moniker + --version(-v): text # Use the specified version; default is the latest version + --source(-s): by "nu-complete winget install source" # Find package using the specified source + --exact(-e) # Find package using exact match + --interactive(-i) # Request interactive installation; user input may be needed + --silent(-h) # Request silent installation + --log(-o): path # Log location (if supported) + --help # Display the help for this command ] -export alias "winget remove" = winget uninstall -export alias "winget rm" = winget uninstall +# Alias of `winget uninstall` +export complete [winget remove] [ + query?: by "nu-complete winget uninstall package name" + --query(-q): by "nu-complete winget uninstall package name" # The query used to search for a package + --manifest(-m): path # The path to the manifest of the package + --id: by "nu-complete winget uninstall package id" # Filter results by id + --name: by "nu-complete winget uninstall package name" # Filter results by name + --moniker: text # Filter results by moniker + --version(-v): text # Use the specified version; default is the latest version + --source(-s): by "nu-complete winget install source" # Find package using the specified source + --exact(-e) # Find package using exact match + --interactive(-i) # Request interactive installation; user input may be needed + --silent(-h) # Request silent installation + --log(-o): path # Log location (if supported) + --help # Display the help for this command +] +# Alias of `winget uninstall` +export complete [winget rm] [ + query?: by "nu-complete winget uninstall package name" + --query(-q): by "nu-complete winget uninstall package name" # The query used to search for a package + --manifest(-m): path # The path to the manifest of the package + --id: by "nu-complete winget uninstall package id" # Filter results by id + --name: by "nu-complete winget uninstall package name" # Filter results by name + --moniker: text # Filter results by moniker + --version(-v): text # Use the specified version; default is the latest version + --source(-s): by "nu-complete winget install source" # Find package using the specified source + --exact(-e) # Find package using exact match + --interactive(-i) # Request interactive installation; user input may be needed + --silent(-h) # Request silent installation + --log(-o): path # Log location (if supported) + --help # Display the help for this command +] # Helper to hash installer files -export extern "winget hash" [ - file?: path, # File to be hashed - --file(-f): path, # File to be hashed - --msix(-m), # Input file will be treated as msix; signature hash will be provided if signed - --help(-?) # Display the help for this command +export complete [winget hash] [ + file?: path # File to be hashed + --file(-f): path # File to be hashed + --msix(-m) # Input file will be treated as msix; signature hash will be provided if signed + --help # Display the help for this command ] # Validates a manifest file -export extern "winget validate" [ - manifest?: path, # The path to the manifest to be validated - --manifest: path, # The path to the manifest to be validated - --help(-?) # Display the help for this command +export complete [winget validate] [ + manifest?: path # The path to the manifest to be validated + --manifest: path # The path to the manifest to be validated + --help # Display the help for this command ] # Open settings or set administrator settings -export extern "winget settings" [ - --enable: string, # Enables the specific administrator setting - --disable: string, # Disables the specific administrator setting - --help(-?) # Display the help for this command +export complete [winget settings] [ + --enable: text # Enables the specific administrator setting + --disable: text # Disables the specific administrator setting + --help # Display the help for this command ] # Shows the status of experimental features -export extern "winget features" [ - --help(-?) # Display the help for this command +export complete [winget features] [ + --help # Display the help for this command ] # Exports a list of the installed packages -export extern "winget export" [ - output?: path, # File where the result is to be written - --output(-o): path, # File where the result is to be written - --source(-s): string@"nu-complete winget install source", # Export packages from the specified source - --include-versions, # Include package versions in produced file - --accept_source_agreements, # Accept all source agreements during source operations - --help(-?) # Display the help for this command +export complete [winget export] [ + output?: path # File where the result is to be written + --output(-o): path # File where the result is to be written + --source(-s): by "nu-complete winget install source" # Export packages from the specified source + --include-versions # Include package versions in produced file + --accept_source_agreements # Accept all source agreements during source operations + --help # Display the help for this command ] -export extern "winget import" [ - import_file?: path, # File describing the packages to install - --import-file(-i): path, # File describing the packages to install - --ignore-unavailable, # Ignore unavailable packages - --ignore-versions, # Ignore package versions - --accept_package_agreements, # Accept all licence agreements for packages - --accept_source_agreements # Accept all source agreements during source operations +export complete [winget import] [ + import_file?: path # File describing the packages to install + --import-file(-i): path # File describing the packages to install + --ignore-unavailable # Ignore unavailable packages + --ignore-versions # Ignore package versions + --accept_package_agreements # Accept all licence agreements for packages + --accept_source_agreements # Accept all source agreements during source operations ] + diff --git a/custom-completions/xgettext/xgettext-completions.nu b/custom-completions/xgettext/xgettext-completions.nu index 41922f0f0..8332a002a 100644 --- a/custom-completions/xgettext/xgettext-completions.nu +++ b/custom-completions/xgettext/xgettext-completions.nu @@ -1,45 +1,56 @@ -# Get list of input files from FILE -extern "xgettext" [ - --files-from(-f) # Get list of input files from FILE - --directory(-D) # Add DIRECTORY to list for input files search - --default-domain(-d) # Use NAME - --output(-o) # Write output to specified file - --output-dir(-p) # Output files will be placed in directory DIR - --language(-L) # Recognise the specified programming language - --from-code # Encoding of input files (except for Python, Tcl, Glade) - --join-existing(-j) # Join messages with existing file - --exclude-file(-x) # Entries from FILE - --add-comments(-c) # Place comment block with TAG (or those preceding keyword lines) in output file - --extract-all(-a) # Extract all strings (only some languages) - --keyword(-k) # Look for this as an additional keyword - --flag # Additional flag for strings inside the argument number ARG of keyword WORD - --trigraphs(-T) # Understand ANSI C trigraphs for input (only languages C, C++, ObjectiveC) - --qt # Recognize Qt format strings (only language C++) - --boost # Recognize Boost format strings (only language C++) - --debug # More detailed formatstring recognition result - --no-escape(-e) # Do not use C escapes in output (default) - --escape(-E) # Use C escapes in output, no extended chars - --force-po # Write PO file even if empty - --indent(-i) # Write the - --no-location # Do not write #: filename:line lines - --add-location(-n) # Generate #: filename:line lines (default) - --strict # Write out strict Uniforum conforming - --properties-output # Write out a Java - --stringtable-output # Write out a NeXTstep/GNUstep - --width(-w) # Set output page width - --no-wrap # Do not break long message lines into several lines - --sort-output(-s) # Generate sorted output - --sort-by-file(-F) # Sort output by file location - --omit-header # Dont write header with msgid "" entry - --copyright-holder # Set copyright holder in output - --foreign-user # Omit FSF copyright in output for foreign user - --msgid-bugs-address # Set report address for msgid bugs - --msgstr-prefix(-m) # Use STRING or "" as prefix for msgstr entries - --msgstr-suffix(-M) # Use STRING or "" as suffix for msgstr entries - --help(-h) # Display this help and exit - --version(-V) # Output version information and exit - ...args -] +# xgettext: extract translatable strings from source files. -export alias "xgettext --c++" = ^xgettext --language=C++ -export alias "xgettext -C" = ^xgettext --language=C++ +export complete [xgettext] [ + --files-from(-f): path # Read the list of input files from FILE + --directory(-D): dir # Add DIRECTORY to the input search path + --default-domain(-d): text # Use NAME.po for output + --output(-o): path # Write output to this file + --output-dir(-p): dir # Place output files in DIR + --language(-L): words [C C++ ObjectiveC PO Python Java JavaProperties "C#" JavaScript TypeScript TSX Scheme Guile Lisp EmacsLisp librep Rust Go Ruby Shell awk Lua Smalltalk Vala Tcl Perl PHP GCC-source YCP NXStringTable RST RSJ Glade AppData Desktop] # Source language + -C # Shorthand for --language=C++ (--c++) + --from-code: text # Encoding of input files + --join-existing(-j) # Join messages with the existing file + --exclude-file(-x): path # Skip entries listed in this file + --add-comments(-c)?: text # Copy comment blocks (optionally only those starting with TAG) + --extract-all(-a) # Extract all strings + --keyword(-k)?: text # Additional keyword to look for + --flag: text # WORD:ARG:FLAG for strings of a keyword argument + --trigraphs(-T) # Understand ANSI C trigraphs + --qt # Recognize Qt format strings + --kde # Recognize KDE 4 format strings + --boost # Recognize Boost format strings + --debug # More detailed format-string recognition + --no-escape(-e) # Do not use C escapes (default) + --escape(-E) # Use C escapes, no extended chars + --force-po # Write a PO file even if empty + --indent(-i) # Write the .po file indented + --no-location # Do not write #: filename:line lines + --add-location(-n)?: words [full file never] # Write #: filename:line lines + --strict # Write strict Uniforum .po output + --properties-output # Write a Java .properties file + --stringtable-output # Write a NeXTstep/GNUstep .strings file + --its: path # Apply ITS rules from this file + --itstool # Write itstool comments + --width(-w): text # Output page width + --no-wrap # Do not wrap long message lines + --sort-output(-s) # Sort output + --sort-by-file(-F) # Sort output by file location + --omit-header # Do not write the msgid "" header + --copyright-holder: text # Copyright holder in output + --foreign-user # Omit the FSF copyright + --package-name: text # Package name in the header + --package-version: text # Package version in the header + --msgid-bugs-address: text # Report address for msgid bugs + --msgstr-prefix(-m)?: text # Prefix for msgstr entries + --msgstr-suffix(-M)?: text # Suffix for msgstr entries + --help(-h) # Show help and exit + --version(-V) # Show version and exit + ...files: path # Input files +] where { + overrides [--escape --no-escape] + overrides [--add-location --no-location] + at-most-one [--sort-output --sort-by-file] + at-most-one [--properties-output --stringtable-output] + overrides [--language -C] + terminal [--help --version] +} diff --git a/custom-completions/yarn/yarn-completions.nu b/custom-completions/yarn/yarn-completions.nu index 6d820e85d..393454b48 100644 --- a/custom-completions/yarn/yarn-completions.nu +++ b/custom-completions/yarn/yarn-completions.nu @@ -2,7 +2,8 @@ # This is for yarn v2(berry) and higher, which is not installed by default. see https://yarnpkg.com/getting-started/migration for a migration guide # Before running any command after this is installed, please run `refresh-cache` to update the NPM registry and yarn plugin cache -def "nu-complete yarn run" [] { +@non-destructive +export def "nu-complete yarn run" [] { let userScripts = try { open ./package.json @@ -22,7 +23,8 @@ def "nu-complete yarn run" [] { $userScripts | append $binaries } -def 'nu-complete yarn' [] { +@non-destructive +export def 'nu-complete yarn' [] { let commands = [ {value:'add', description:'Add dependencies to the project'} {value:'bin', description:'Get the path to a binary script'} @@ -33,7 +35,7 @@ def 'nu-complete yarn' [] { {value: 'config', description: 'Display the current configuration'} {value: 'constraints query', description: 'Query the constraints fact database'} {value: 'constraints source', description: 'Print the source code for the constraints'} - {value: 'yarn constraints', description: 'Check that the project constraints are met'} + {value: 'constraints', description: 'Check that the project constraints are met'} {value: 'dedupe', description: 'Deduplicate dependencies with overlapping ranges'} {value: 'dlx', description: 'Run a package in a temporary environment'} {value: 'exec', description: 'Execute a shell script'} @@ -87,10 +89,7 @@ def 'nu-complete yarn' [] { $commands | append $runnables } -export extern "yarn" [ - command?: string@"nu-complete yarn" -] - +@non-destructive def 'nu-complete yarn mode' [] { ["skip-build", "update-lockfile"] } @@ -104,529 +103,557 @@ export def "refresh-cache" [] { ^yarn plugin list --json | lines | each { |it| from json } | to csv | save $yarnPluginCacheFilePath } -def "nu-complete yarn add" [] { - let cacheFilePath = ($nu.config-path | path dirname | path join "yarnCache" | path join $"npmCache.csv") - # TODO switch to dataframes - open $cacheFilePath | $in.package +@non-destructive +export def "nu-complete yarn add" [] { + try { + let cacheFilePath = ($nu.config-path | path dirname | path join "yarnCache" | path join $"npmCache.csv") + # TODO switch to dataframes + open $cacheFilePath | $in.package + } catch { [] } } -# Add dependencies to the project -export extern "yarn add" [ - --json # Format the output as an NDJSON stream - --exact(-E) # Don't use any semver modifier on the resolved range - --tilde(-T) # Use the ~ semver modifier on the resolved range - --caret(-C) # Use the ^ semver modifier on the resolved range - --dev(-D) # Add a package as a dev dependency - --peer(-P) # Add a package as a peer dependency - --optional(-O) # Add / upgrade a package to an optional regular / peer dependency - --prefer-dev # Add / upgrade a package to a dev dependency - --interactive(-i) # Reuse the specified package from other workspaces in the project - --cached # Reuse the highest version already used somewhere within the project - --mode: string@"nu-complete yarn mode" # Change what artifacts installs generate - package: string@"nu-complete yarn add" -] - -def 'nu-complete yarn bin' [] { - ^yarn bin --json - |lines - |each { |it| $it | from json } - |$in.name +@non-destructive +export def 'nu-complete yarn bin' [] { + try { + ^yarn bin --json + |lines + |each { |it| $it | from json } + |$in.name + } catch { [] } } -# Get the path to a binary script -export extern "yarn bin" [ - --json # Format the output as an NDJSON stream - --verbose(-v) # Print both the binary name and the locator of the package that provides the binary - binary?: string@"nu-complete yarn bin" -] - -# Remove the shared cache files -export extern "yarn cache clean" [ - --mirror # Remove the global cache files instead of the local cache files - --all # Remove both the global cache files and the local cache files of the current project -] - -def "nu-complete yarn config" [] { - ^yarn config --json - |lines - |each { |it| $it | from json } - |$in.key +@non-destructive +export def "nu-complete yarn config" [] { + try { + ^yarn config --json + |lines + |each { |it| $it | from json } + |$in.key + } catch { [] } } -# Read a configuration settings -export extern "yarn config get" [ - --json # Format the output as an NDJSON stream - --no-redacted # Don't redact secrets (such as tokens) from the output - name: string@"nu-complete yarn config" -] +@non-destructive +def 'nu-complete yarn dedupe strategy' [] { + ["highest"] +} -# Change a configuration settings -export extern "yarn config set" [ - --json # Set complex configuration settings to JSON values - --home(-H) # Update the home configuration instead of the project configuration - name: string@"nu-complete yarn config" - value: string -] +@non-destructive +export def "nu-complete yarn dlx" [] { + try { + let cacheFilePath = ($nu.config-path | path dirname | path join "yarnCache" | path join $"npmCache.csv") + # TODO switch to dataframes + open $cacheFilePath | $in.package + } catch { [] } +} -# Unset a configuration setting -export extern "yarn config unset" [ - --home(-H) # Update the home configuration instead of the project configuration - name: string@"nu-complete yarn config" -] +@non-destructive +export def "nu-complete yarn explain peer-requirements" [] { + try { + let cacheFilePath = ($nu.config-path | path dirname | path join "yarnCache" | path join $"(open ./package.json | get name)-peerReqs.json") + + if ($cacheFilePath | path exists) { + let cache = (open $cacheFilePath) + + let hash = ($cache | get hash) + let computedHash = (open yarn.lock | hash sha256) + + if $hash == $computedHash { + $cache | get hashes + } else { + ^yarn explain peer-requirements | lines | parse -r '.+: (?P<hash>\w+) → .*' | $in.hash + } + } else { + let hashes = (^yarn explain peer-requirements | lines | parse -r '.+: (?P<hash>\w+) → .*' | $in.hash) + let computedHash = (open yarn.lock | hash sha256) + + let cache = { + hash: $computedHash, + hashes: $hashes + } + + $cache | save $cacheFilePath + $hashes + } + } catch { [] } +} -# Display the current configuration -export extern "yarn config" [ - --verbose(-v) # Print the setting description on top of the regular key/value information - --json # Format the output as an NDJSON stream - --why # Print the reason why a setting is set a particular way -] +@non-destructive +export def "nu-complete yarn info" [] { + try { + let packagejson = (open ./package.json) + let deps = ($packagejson | get dependencies | columns) + let devDeps = ($packagejson | get devDependencies | columns) + + $deps | append $devDeps + } catch { [] } +} -# Query the constraints fact database -export extern "yarn constraints query" [ - --json # Format the output as NDJSON stream - query: string -] +@non-destructive +def "nu-complete yarn npm audit severity" [] { + ["info", "low", "moderate", "high", "critical"] +} -# Print the source code for the constraints -export extern "yarn constraints source" [ - --verbose(-v) # Also print the fact database automatically compiled from the workspace manifests -] +@non-destructive +export def "nu-complete yarn patch" [] { + try { + let packagejson = (open ./package.json) + let deps = ($packagejson | get dependencies | columns) + let devDeps = ($packagejson | get devDependencies | columns) + + $deps | append $devDeps + } catch { [] } +} -# Check that the project constraints are met -export extern "yarn constraints" [ - --fix # Attempt to automatically fix unambiguous issues, following a multi-pass process -] +@non-destructive +export def "nu-complete yarn plugin import" [] { + try { + let yarnPluginCacheFilePath = ($nu.config-path | path dirname | path join "yarnCache" | path join $"yarnPluginCache.csv") + open $yarnPluginCacheFilePath | get name + } catch { [] } +} -def 'nu-complete yarn dedupe strategy' [] { - ["highest"] +@non-destructive +export def "nu-complete yarn plugin remove" [] { + try { + open ./.yarnrc.yml | get plugins | get spec + } catch { [] } } -# Deduplicate dependencies with overlapping ranges -export extern "yarn dedupe" [ - --strategy(-s): string@"nu-complete yarn dedupe strategy" # The strategy to use when deduping dependencies - --check(-c) # Exit with exit code 1 when duplicates are found, without persisting the dependency tree - --json # Format the output as an NDJSON stream - --mode: string@"nu-complete yarn mode" # Change what artifacts installs generate - package: string -] +@non-destructive +export def "nu-complete yarn rebuild" [] { + try { + let packagejson = (open ./package.json) + let deps = ($packagejson | get dependencies | columns) + let devDeps = ($packagejson | get devDependencies | columns) + + $deps | append $devDeps + } catch { [] } +} -def "nu-complete yarn dlx" [] { - let cacheFilePath = ($nu.config-path | path dirname | path join "yarnCache" | path join $"npmCache.csv") - # TODO switch to dataframes - open $cacheFilePath | $in.package +@non-destructive +export def "nu-complete yarn version strategy" [] { + try { + let originalStrats = ["patch", "minor", "major"] + let preStrats = ($originalStrats | each { |it| $"pre($it)" } | append "prerelease") + let otherStrats = ["decline"] + + $originalStrats | append $preStrats | append $otherStrats + } catch { [] } } -# Run a package in a temporary environment -export extern "yarn dlx" [ - --package(-p) # The package(s) to install before running the command - --quiet(-q) # Only report critical errors instead of printing the full install logs - package: string@"nu-complete yarn dlx" - ...args: string -] +@non-destructive +export def "nu-complete yarn why" [] { + try { + let packagejson = (open ./package.json) + let deps = ($packagejson | get dependencies | columns) + let devDeps = ($packagejson | get devDependencies | columns) + + $deps | append $devDeps + } catch { [] } +} -# Execute a shell script -export extern "yarn exec" [ - ...command: string -] +@non-destructive +export def "nu-complete yarn workspace" [] { + try { + ^yarn workspaces list --json | lines | each {|it| from json} | get name + } catch { [] } +} -def "nu-complete yarn explain peer-requirements" [] { - let cacheFilePath = ($nu.config-path | path dirname | path join "yarnCache" | path join $"(open ./package.json | get name)-peerReqs.json") +export complete [yarn] [ + --version(-v) # Print the version of yarn + --help(-h) # Print the help of a command + ...script: by "nu-complete yarn run" # A package.json script or binary (yarn <script> = yarn run <script>) + --cwd: dir cwd # Run the command in the given directory +] where { + terminal [--help --version] +} - if ($cacheFilePath | path exists) { - let cache = (open $cacheFilePath) +export complete [yarn add] [ + --json # Format the output as an NDJSON stream + --exact(-E) # Don't use any semver modifier on the resolved range + --tilde(-T) # Use the ~ semver modifier on the resolved range + --caret(-C) # Use the ^ semver modifier on the resolved range + --dev(-D) # Add a package as a dev dependency + --peer(-P) # Add a package as a peer dependency + --optional(-O) # Add / upgrade a package to an optional regular / peer dependency + --prefer-dev # Add / upgrade a package to a dev dependency + --interactive(-i) # Reuse the specified package from other workspaces in the project + --cached # Reuse the highest version already used somewhere within the project + --mode: words ["skip-build" "update-lockfile"] # Change what artifacts installs generate + ...package: by "nu-complete yarn add" +] where { + at-most-one [--exact --tilde --caret] + at-most-one [--dev --peer --prefer-dev] +} - let hash = ($cache | get hash) - let computedHash = (open yarn.lock | hash sha256) +export complete [yarn bin] [ + --json # Format the output as an NDJSON stream + --verbose(-v) # Print both the binary name and the locator of the package that provides the binary + binary?: by "nu-complete yarn bin" +] - if $hash == $computedHash { - $cache | get hashes - } else { - ^yarn explain peer-requirements | lines | parse -r '.+: (?P<hash>\w+) → .*' | $in.hash - } - } else { - let hashes = (^yarn explain peer-requirements | lines | parse -r '.+: (?P<hash>\w+) → .*' | $in.hash) - let computedHash = (open yarn.lock | hash sha256) +export complete [yarn cache clean] [ + --mirror # Remove the global cache files instead of the local cache files + --all # Remove both the global cache files and the local cache files of the current project +] - let cache = { - hash: $computedHash, - hashes: $hashes - } +export complete [yarn config get] [ + --json # Format the output as an NDJSON stream + --no-redacted # Don't redact secrets (such as tokens) from the output + name: by "nu-complete yarn config" +] - $cache | save $cacheFilePath - $hashes - } -} +export complete [yarn config set] [ + --json # Set complex configuration settings to JSON values + --home(-H) # Update the home configuration instead of the project configuration + name: by "nu-complete yarn config" + value: text +] -# Explain a set of peer requirements -export extern "yarn explain peer-requirements" [ - hash?: string@"nu-complete yarn explain peer-requirements" +export complete [yarn config unset] [ + --home(-H) # Update the home configuration instead of the project configuration + name: by "nu-complete yarn config" ] -# Explain an error code -export extern "yarn explain" [ - --json # Format the output as an NDJSON stream - code: string +export complete [yarn config] [ + --verbose(-v) # Print the setting description on top of the regular key/value information + --json # Format the output as an NDJSON stream + --why # Print the reason why a setting is set a particular way ] +export complete [yarn constraints query] [ + --json # Format the output as NDJSON stream + query: text +] -def "nu-complete yarn info" [] { - let packagejson = (open ./package.json) - let deps = ($packagejson | get dependencies | columns) - let devDeps = ($packagejson | get devDependencies | columns) +export complete [yarn constraints source] [ + --verbose(-v) # Also print the fact database automatically compiled from the workspace manifests +] - $deps | append $devDeps -} +export complete [yarn constraints] [ + --fix # Attempt to automatically fix unambiguous issues, following a multi-pass process +] -# See information related to packages -export extern "yarn info" [ - --all(-A) # Print versions of a package from the whole project - --recursive(-R) # Print information for all packages, including transitive dependencies - --extra(-X): string # An array of requests of extra data provided by plugins - --cache # Print information about the cache entry of a package (path, size, checksum) - --dependents # Print all dependents for each matching package - --manifest # Print data obtained by looking at the package archive (license, homepage, ...) - --name-only # Only print the name for the matching packages - --virtuals # Print each instance of the virtual packages - --json # Format the output as an NDJSON stream - package: string@"nu-complete yarn info" +export complete [yarn dedupe] [ + --strategy(-s): words ["highest"] # The strategy to use when deduping dependencies + --check(-c) # Exit with exit code 1 when duplicates are found, without persisting the dependency tree + --json # Format the output as an NDJSON stream + --mode: words ["skip-build" "update-lockfile"] # Change what artifacts installs generate + package: text ] -# Install the project dependencies -export extern "yarn install" [ - --json # Format the output as an NDJSON stream - --immutable # Abort with an error exit code if the lockfile was to be modified - --immutable-cache # Abort with an error exit code if the cache folder was to be modified - --check-cache # Always refetch the packages and ensure that their checksums are consistent - --inline-builds # Verbosely print the output of the build steps of dependencies - --mode: string@"nu-complete yarn mode" # Change what artifacts installs generate +export complete [yarn dlx] [ + --package(-p) # The package(s) to install before running the command + --quiet(-q) # Only report critical errors instead of printing the full install logs + package: by "nu-complete yarn dlx" + ...args: text ] -# Connect the local project to another one -export extern "yarn link" [ - --all(-A) # Link all workspaces belonging to the target project to the current one - --private(-p) # Also link private workspaces belonging to the target project to the current one - --relative(-r) # Link workspaces using relative paths instead of absolute paths - path: string +export complete [yarn exec] [ + ...command: text ] -# Run node with the hook already setup -export extern "yarn node" [ - ...command: string +export complete [yarn explain peer-requirements] [ + hash?: by "nu-complete yarn explain peer-requirements" ] -def "nu-complete yarn npm audit severity" [] { - ["info", "low", "moderate", "high", "critical"] -} +export complete [yarn explain] [ + --json # Format the output as an NDJSON stream + code: text +] -# Perform a vulnerability audit against the installed packages. -export extern "yarn npm audit" [ - --all(-A) # Audit dependencies from all workspaces - --recursive(-R) # Audit transitive dependencies as well - --environment: string # Which environments to cover - --json # Format the output as an NDJSON stream - --severity: string@"nu-complete yarn npm audit severity" # Minimal severity requested for packages to be displayed +export complete [yarn info] [ + --all(-A) # Print versions of a package from the whole project + --recursive(-R) # Print information for all packages, including transitive dependencies + --extra(-X): text # An array of requests of extra data provided by plugins + --cache # Print information about the cache entry of a package (path, size, checksum) + --dependents # Print all dependents for each matching package + --manifest # Print data obtained by looking at the package archive (license, homepage, ...) + --name-only # Only print the name for the matching packages + --virtuals # Print each instance of the virtual packages + --json # Format the output as an NDJSON stream + package: by "nu-complete yarn info" ] -# Show information about a package -export extern "yarn npm info" [ - --json # Format the output as an NDJSON stream - --fields(-f): string # A comma-separated list of manifest fields that should be displayed - package: string +export complete [yarn init] [ + --private(-p) # Make the package private + --workspace(-w) # Initialize a workspace within an existing project + --install(-i) # Install the newly created project's dependencies ] -# Store new login info to access the npm registry -export extern "yarn npm login" [ - --scope(-s) # Login to the registry configured for a given scope - --publish # Login to the publish registry +export complete [yarn install] [ + --json # Format the output as an NDJSON stream + --immutable # Abort with an error exit code if the lockfile was to be modified + --immutable-cache # Abort with an error exit code if the cache folder was to be modified + --check-cache # Always refetch the packages and ensure that their checksums are consistent + --inline-builds # Verbosely print the output of the build steps of dependencies + --mode: words ["skip-build" "update-lockfile"] # Change what artifacts installs generate ] -# Logout of the npm registry. -export extern "yarn npm logout" [ - --scope(-s) # Logout of the registry configured for a given scope - --publish # Logout of the publish registry - --all(-A) # Logout of all registries +export complete [yarn link] [ + --all(-A) # Link all workspaces belonging to the target project to the current one + --private(-p) # Also link private workspaces belonging to the target project to the current one + --relative(-r) # Link workspaces using relative paths instead of absolute paths + path: text ] -# Publish the active workspace to the npm registry -export extern "yarn npm publish" [ - --access: string # The access level of the published package (public or restricted) - --tag: string # The tag on the registry that the package should be attached to - --tolerate-republish # Warn and exit when republishing an already existing version of a package - --opt: string # The OTP token to use with the command +export complete [yarn node] [ + ...command: text + --eval(-e): text # Evaluate the script + --print(-p): text # Print the result of evaluating the script instead of showing it + --require(-r): text # Preload a module before running the script + --inspect # Activate the Node.js inspector + --inspect-brk # Activate the inspector and break before user code starts ] -# Add a tag for a specific version of a package -export extern "yarn npm tag add" [ - package: string - tag: string +export complete [yarn npm audit] [ + --all(-A) # Audit dependencies from all workspaces + --recursive(-R) # Audit transitive dependencies as well + --environment: text # Which environments to cover + --json # Format the output as an NDJSON stream + --severity: words ["info" "low" "moderate" "high" "critical"] # Minimal severity requested for packages to be displayed +] where { + at-most-one [--all --recursive] +} + +export complete [yarn npm info] [ + --json # Format the output as an NDJSON stream + --fields(-f): text # A comma-separated list of manifest fields that should be displayed + package: text ] -# List all dist-tags of a package -export extern "yarn npm tag list" [ - --json # Format the output as an NDJSON stream - package: string +export complete [yarn npm login] [ + --scope(-s) # Login to the registry configured for a given scope + --publish # Login to the publish registry ] -# Remove a tag from a package -export extern "yarn npm tag remove" [ - package: string - tag: string +export complete [yarn npm logout] [ + --scope(-s) # Logout of the registry configured for a given scope + --publish # Logout of the publish registry + --all(-A) # Logout of all registries ] -# Display the name of the authenticated user -export extern "yarn npm whoami" [ - --scope(-s) # Print username for the registry configured for a given scope - --publish # Print username for the publish registry +export complete [yarn npm publish] [ + --access: text # The access level of the published package (public or restricted) + --tag: text # The tag on the registry that the package should be attached to + --tolerate-republish # Warn and exit when republishing an already existing version of a package + --opt: text # The OTP token to use with the command ] -# Generate a tarball from the active workspace -export extern "yarn pack" [ - --install-if-needed # Run a priliminary yarn install if the package contains build scripts - --dry-run(-n) # Print the file paths without actually generating the package archive - --json # Format the output as an NDJSON stream - --out(-o): string # Create the archive at the specified path +export complete [yarn npm tag add] [ + package: text + tag: text ] -# Generate a patch out of a directory -export extern "yarn patch-commit" [ - --save(-s) # Add the patch to your resolution entries +export complete [yarn npm tag list] [ + --json # Format the output as an NDJSON stream + package: text ] -def "nu-complete yarn patch" [] { - let packagejson = (open ./package.json) - let deps = ($packagejson | get dependencies | columns) - let devDeps = ($packagejson | get devDependencies | columns) +export complete [yarn npm tag remove] [ + package: text + tag: text +] - $deps | append $devDeps -} +export complete [yarn npm whoami] [ + --scope(-s) # Print username for the registry configured for a given scope + --publish # Print username for the publish registry +] -# Prepare a package for patching -export extern "yarn patch" [ - --json # Format the output as an NDJSON stream - package: string@"nu-complete yarn patch" +export complete [yarn pack] [ + --install-if-needed # Run a priliminary yarn install if the package contains build scripts + --dry-run(-n) # Print the file paths without actually generating the package archive + --json # Format the output as an NDJSON stream + --out(-o): text # Create the archive at the specified path ] -export extern "yarn plugin" [] +export complete [yarn patch-commit] [ + --save(-s) # Add the patch to your resolution entries + path: path # Directory holding the patched package +] -# Build a plugin from sources -export extern "yarn plugin import from sources" [ - --path: string # The path where the repository should be cloned to - --repository: string # The repository that should be cloned - --branch: string # The branch of the repository that should be cloned - --no-minify # Build a plugin for development (debugging) - non-minified and non-mangled - --force(-f) # Always clone the repository instead of trying to fetch the latest commits - plugin: string +export complete [yarn patch] [ + --json # Format the output as an NDJSON stream + package: by "nu-complete yarn patch" ] -def "nu-complete yarn plugin import" [] { - let yarnPluginCacheFilePath = ($nu.config-path | path dirname | path join "yarnCache" | path join $"yarnPluginCache.csv") - open $yarnPluginCacheFilePath | get name -} +export complete [yarn plugin] [ -# Download a plugin -export extern "yarn plugin import" [ - plugin: string@"nu-complete yarn plugin import" ] -# List the available official plugins -export extern "yarn plugin list" [ - --json # Format the output as an NDJSON stream +export complete [yarn plugin import from sources] [ + --path: text # The path where the repository should be cloned to + --repository: text # The repository that should be cloned + --branch: text # The branch of the repository that should be cloned + --no-minify # Build a plugin for development (debugging) - non-minified and non-mangled + --force(-f) # Always clone the repository instead of trying to fetch the latest commits + plugin: text ] -def "nu-complete yarn plugin remove" [] { - open ./.yarnrc.yml | get plugins | get spec -} - -# Remove a plugin -export extern "yarn plugin remove" [ - plugin: string@"nu-complete yarn plugin remove" +export complete [yarn plugin import] [ + plugin: by "nu-complete yarn plugin import" ] -# List the active plugins -export extern "yarn plugin runtime" [ - --json # Format the output as an NDJSON stream +export complete [yarn plugin list] [ + --json # Format the output as an NDJSON stream ] -def "nu-complete yarn rebuild" [] { - let packagejson = (open ./package.json) - let deps = ($packagejson | get dependencies | columns) - let devDeps = ($packagejson | get devDependencies | columns) - - $deps | append $devDeps -} +export complete [yarn plugin remove] [ + plugin: by "nu-complete yarn plugin remove" +] -# Rebuild the project's native packages -export extern "yarn rebuild" [ - ...packages: string@"nu-complete yarn rebuild" +export complete [yarn plugin runtime] [ + --json # Format the output as an NDJSON stream ] -# Remove a dependency from the project -export extern "yarn remove" [ - --all(-A) # Apply the operation to all workspaces from the current project - --mode: string@"nu-complete yarn mode" # The mode to use when removing the dependency +export complete [yarn rebuild] [ + ...packages: by "nu-complete yarn rebuild" ] -# Run a script defined in the package.json -export extern "yarn run" [ - --inspect # forwarded to the underlying node process - --inspect-brk # forwarded to the underlying node process - --top-level(-T) # Check the root workspace for scripts and/or binaries instead of the current one - --binaries-only(-B) # Ignore any user defined scripts and only check for binaries - script: string@"nu-complete yarn run" +export complete [yarn remove] [ + --all(-A) # Apply the operation to all workspaces from the current project + --mode: words ["skip-build" "update-lockfile"] # The mode to use when removing the dependency + ...packages: by "nu-complete yarn rebuild" # Packages to remove ] -# Open the search interface. NOTE: requires the interactive-tools plugin to be installed. -export extern "yarn search" [] +export complete [yarn run] [ + --inspect # forwarded to the underlying node process + --inspect-brk # forwarded to the underlying node process + --top-level(-T) # Check the root workspace for scripts and/or binaries instead of the current one + --binaries-only(-B) # Ignore any user defined scripts and only check for binaries + script: by "nu-complete yarn run" +] -export extern "yarn set" [] +export complete [yarn search] [ -# Enforce a package resolution -export extern "yarn set resolution" [ - --save(-s) # Persist the resolution inside the top-level manifest - descriptor: string - resolution: string ] -# Build yarn from master -export extern "yarn set version from sources" [ - --path: string # The path where the repository should be cloned to - --repository: string # The repository that should be cloned - --branch: string # The branch of the repository that should be cloned - --no-minify # Build a plugin for development (debugging) - non-minified and non-mangled - --force(-f) # Always clone the repository instead of trying to fetch the latest commits - --skip-plugins # Skip updating the contrib plugins -] +export complete [yarn set] [ -# Lock the Yarn version used by the project -export extern "yarn set version" [ - --only-if-needed # Only lock the yarn version if it isn't already locked - version: string ] -# Add all yarn files to your vcs. NOTE: requires the stage plugin to be installed. -export extern "yarn stage" [ - --commit(-c) # Commit the staged files - --reset(-r) # Remove all files from the staging area - --dry-run(-n) # Print the commit message and the list of modified files without staging / committing +export complete [yarn set resolution] [ + --save(-s) # Persist the resolution inside the top-level manifest + descriptor: text + resolution: text ] -# Disconnect the local project from another one -export extern "yarn unlink" [ - --all(-A) # Unlink all workspaces belonging to the target project from the current one - ...packages: string +export complete [yarn set version from sources] [ + --path: text # The path where the repository should be cloned to + --repository: text # The repository that should be cloned + --branch: text # The branch of the repository that should be cloned + --no-minify # Build a plugin for development (debugging) - non-minified and non-mangled + --force(-f) # Always clone the repository instead of trying to fetch the latest commits + --skip-plugins # Skip updating the contrib plugins ] -# Force the unpacking of a list of packages -export extern "yarn unplug" [ - --all(-A) #Unplug direct dependencies from the entire project - --recursive(-R) #Unplug both direct and transitive dependencies - --json # Format the output as an NDJSON stream - ...packages: string +export complete [yarn set version] [ + --only-if-needed # Only lock the yarn version if it isn't already locked + version: text ] -# Upgrade dependencies across the project -export extern "yarn up" [ - --interactive(-i) # Offer various choices, depending on the detected upgrade paths - --exact(-E) # Don't use any semver modifier on the resolved range - --tilde(-T) # Use the ~ semver modifier on the resolved range - --caret(-C) # Use the ^ semver modifier on the resolved range - --recursive(-R) # Resolve again ALL resolutions for those packages - --mode: string@"nu-complete yarn mode" # Change what artifacts installs generate +export complete [yarn stage] [ + --commit(-c) # Commit the staged files + --reset(-r) # Remove all files from the staging area + --dry-run(-n) # Print the commit message and the list of modified files without staging / committing ] -# Open the upgrade interface. NOTE: requires the interactive-tools plugin to be installed. -export extern "yarn upgrade-interactive" [] +export complete [yarn unlink] [ + --all(-A) # Unlink all workspaces belonging to the target project from the current one + ...packages: text +] -def "nu-complete yarn version strategy" [] { - let originalStrats = ["patch", "minor", "major"] - let preStrats = ($originalStrats | each { |it| $"pre($it)" } | append "prerelease") - let otherStrats = ["decline"] +export complete [yarn unplug] [ + --all(-A) # Unplug direct dependencies from the entire project + --recursive(-R) # Unplug both direct and transitive dependencies + --json # Format the output as an NDJSON stream + ...packages: text +] - $originalStrats | append $preStrats | append $otherStrats +export complete [yarn up] [ + --interactive(-i) # Offer various choices, depending on the detected upgrade paths + --exact(-E) # Don't use any semver modifier on the resolved range + --tilde(-T) # Use the ~ semver modifier on the resolved range + --caret(-C) # Use the ^ semver modifier on the resolved range + --recursive(-R) # Resolve again ALL resolutions for those packages + --mode: words ["skip-build" "update-lockfile"] # Change what artifacts installs generate + ...package: by "nu-complete yarn why" # Packages to upgrade +] where { + at-most-one [--exact --tilde --caret] } +export complete [yarn upgrade-interactive] [ + +] +export complete [yarn version] [ + --deferred(-d) # Prepare the version to be bumped during the next release cycle + --immediate(-i) # Bump the version immediately + strategy: by "nu-complete yarn version strategy" +] -# Apply a new version to the current package. NOTE: requires the version plugin to be installed. -export extern "yarn version" [ - --deferred(-d) # Prepare the version to be bumped during the next release cycle - --immediate(-i) # Bump the version immediately - strategy: string@"nu-complete yarn version strategy" +export complete [yarn version apply] [ + --all # Apply the deferred version changes on all workspaces + --dry-run # Print the versions without actually generating the package archive + --prerelease # Add a prerelease identifier to new versions + --recursive(-R) # Release the transitive workspaces as well + --json # Format the output as an NDJSON stream ] -# Apply all the deferred version bumps at once. NOTE: requires the version plugin to be installed. -export extern "yarn version apply" [ - --all # Apply the deferred version changes on all workspaces - --dry-run # Print the versions without actually generating the package archive - --prerelease # Add a prerelease identifier to new versions - --recursive(-R) # Release the transitive workspaces as well - --json # Format the output as an NDJSON stream +export complete [yarn version check] [ + --interactive(-i) # Open an interactive interface used to set version bumps ] -# Check that all the relevant packages have been bumped. NOTE: requires the version plugin to be installed. WARNING: This command currently requires git. -export extern "yarn version check" [ - --interactive(-i) # Open an interactive interface used to set version bumps +export complete [yarn why] [ + --recursive(-R) # List, for each workspace, what are all the paths that lead to the dependency + --json # Format the output as an NDJSON stream + --peers # Also print the peer dependencies that match the specified name + package: by "nu-complete yarn why" ] -def "nu-complete yarn why" [] { - let packagejson = (open ./package.json) - let deps = ($packagejson | get dependencies | columns) - let devDeps = ($packagejson | get devDependencies | columns) +export complete [yarn workspace] [ + workspaceName: by "nu-complete yarn workspace" + ...commandName: text +] - $deps | append $devDeps -} +export complete [yarn workspaces] [ -# Display the reason why a package is needed -export extern "yarn why" [ - --recursive(-R) # List, for each workspace, what are all the paths that lead to the dependency - --json # Format the output as an NDJSON stream - --peers # Also print the peer dependencies that match the specified name - package: string@"nu-complete yarn why" ] -def "nu-complete yarn workspace" [] { - ^yarn workspaces list --json | lines | each {|it| from json} | get name +export complete [yarn workspaces focus] [ + --json # Format the output as an NDJSON stream + --production # Only install regular dependencies by omitting dev dependencies + --all(-A) # Install the entire project + ...packages: text +] where { + excludes --all --production +} + +export complete [yarn workspaces foreach] [ + --recursive(-R) # Find packages via dependencies/devDependencies instead of using the workspaces field + --from: text # An array of glob pattern idents from which to base any recursion + --all(-A) # Run the command on all workspaces of a project + --verbose(-v) # Prefix each output line with the name of the originating workspace + --parallel(-p) # Run the commands in parallel + --interlaced(-i) # Print the output of commands in real-time instead of buffering it + --jobs(-j): text # The maximum number of parallel tasks that the execution will be limited to; or unlimited + --topological(-t) # Run the command after all workspaces it depends on (regular) have finished + --topological-dev # Run the command after all workspaces it depends on (regular + dev) have finished + --include: text # An array of glob pattern idents; only matching workspaces will be traversed + --exclude: text # An array of glob pattern idents; matching workspaces won't be traversed + --no-private # Avoid running the command on private workspaces + --since # Only include workspaces that have been changed since the specified ref. + ...commandName: text +] where { + at-most-one [--topological --topological-dev] + at-most-one [--all --recursive --since] + requires --interlaced --parallel + requires --jobs --parallel } -# Run a command within the specified workspace. -export extern "yarn workspace" [ - workspaceName: string@"nu-complete yarn workspace" - ...commandName: string -] - -export extern "yarn workspaces" [ - command: string -] -# Install a single workspace and its dependencies. NOTE: requires the workspace-tools plugin to be installed. -export extern "yarn workspaces focus" [ - --json # Format the output as an NDJSON stream - --production # Only install regular dependencies by omitting dev dependencies - --all(-A) # Install the entire project - ...packages: string -] - -# Run a command on all workspaces. NOTE: requires the workspace-tools plugin to be installed. -export extern "yarn workspaces foreach" [ - --recursive(-R) # Find packages via dependencies/devDependencies instead of using the workspaces field - --from: string #An array of glob pattern idents from which to base any recursion - --all(-A) #Run the command on all workspaces of a project - --verbose(-v) # Prefix each output line with the name of the originating workspace - --parallel(-p) # Run the commands in parallel - --interlaced(-i) # Print the output of commands in real-time instead of buffering it - --jobs(-j): string # The maximum number of parallel tasks that the execution will be limited to; or unlimited - --topological(-t) # Run the command after all workspaces it depends on (regular) have finished - --topological-dev # Run the command after all workspaces it depends on (regular + dev) have finished - --include: string # An array of glob pattern idents; only matching workspaces will be traversed - --exclude: string # An array of glob pattern idents; matching workspaces won't be traversed - --no-private # Avoid running the command on private workspaces - --since # Only include workspaces that have been changed since the specified ref. - ...commandName: string -] - -# List all available workspaces -export extern "yarn workspaces list" [ - --since # Only include workspaces that have been changed since the specified ref. - --recursive(-R) # Find packages via dependencies/devDependencies instead of using the workspaces field - --verbose(-v) # Also return the cross-dependencies between workspaces - --json # Format the output as an NDJSON stream +export complete [yarn workspaces list] [ + --since # Only include workspaces that have been changed since the specified ref. + --recursive(-R) # Find packages via dependencies/devDependencies instead of using the workspaces field + --verbose(-v) # Also return the cross-dependencies between workspaces + --json # Format the output as an NDJSON stream ] diff --git a/custom-completions/zef/zef-completions.nu b/custom-completions/zef/zef-completions.nu index 4d0a03f86..3308f1533 100644 --- a/custom-completions/zef/zef-completions.nu +++ b/custom-completions/zef/zef-completions.nu @@ -1,201 +1,277 @@ -# Display help text -extern "zef" [ +# zef: manage Raku distributions. +# zef's `--/phase` negations (e.g. `--/test`) are not expressible as slots and are omitted. - ...args +# Manage Raku distributions +export complete [zef] [ + --help(-h) # Show help + --version # Show version ] -# Install specific distributions by name or path -extern "zef install" [ - # all the --/ commands break the parser - --fetch - --build - #--/build # Skip the building phase - --test - #--/test # Skip the testing phase - --depends - #--/depends # Do not fetch runtime dependencies - --build-depends - #--/build-depends # Do not fetch build dependencies - --test-depends - #--/test-depends # Do not fetch test dependencies - --force # Ignore errors - --force-resolve # Ignore errors - --force-fetch # Ignore errors - --force-extract # Ignore errors - --force-build # Ignore errors - --force-test # Ignore errors - --force-install # Ignore errors - --dry # Run all phases except the actual installations - --serial # Install each dependency after passing testing and before building/testing the next dependency - --update # Force a refresh for all module indexes or a specific ecosystem - #--/update # Skip refreshing all module indexes or a specific ecosystem - --exclude - --to # Short name or spec of CompUnit::Repository to install to - --install-to # Short name or spec of CompUnit::Repository to install to - --upgrade - --deps-only # Install only the dependency chains of the requested distributions - --contained # Install all transitive and direct dependencies regardless if they are already installed globally - --from - --uninstall-from - ...args -] +# Install distributions by name or path +export complete [zef install] profile posix-assign-v1 [ + --fetch # Run the fetching phase + --build # Run the building phase + --test # Run the testing phase + --depends # Fetch runtime dependencies + --build-depends # Fetch build dependencies + --test-depends # Fetch test dependencies + --force # Ignore errors in every phase + --force-resolve # Ignore resolve errors + --force-fetch # Ignore fetch errors + --force-extract # Ignore extract errors + --force-build # Ignore build errors + --force-test # Ignore test errors + --force-install # Ignore install errors + --dry # Run every phase except the installation + --serial # Install each dependency before building/testing the next + --update # Refresh all module indexes + --exclude: text # Exclude a dependency identity + --to: text # CompUnit::Repository short name or spec to install to + --install-to: text # CompUnit::Repository short name or spec to install to + --upgrade # Upgrade installed distributions + --deps-only # Install only the dependencies of the requested distributions + --contained # Install all dependencies even if installed globally + --from: text # Repository to install from + --uninstall-from: text # Repository to uninstall from + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...identities: path # Distribution names or paths +] where { + overrides [--to --install-to] +} -# Uninstall specific distributions -extern "zef uninstall" [ - --from - --uninstall-from - ...args -] +# Uninstall distributions +export complete [zef uninstall] profile posix-assign-v1 [ + --from: text # Repository to uninstall from + --uninstall-from: text # Repository to uninstall from + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...identities: text # Distributions to uninstall +] where { + overrides [--from --uninstall-from] +} -# Run tests on a given modules path -extern "zef test" [ - --force # Ignore errors - --force-test # Ignore errors - ...args +# Run the tests in module paths +export complete [zef test] profile posix-assign-v1 [ + --force # Ignore errors + --force-test # Ignore test errors + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...paths: dir # Module paths to test ] -# Fetch and extract modules source -extern "zef fetch" [ - --force # Ignore errors - --force-fetch # Ignore errors - --update # Force a refresh for all module indexes or a specific ecosystem - #--/update # Skip refreshing all module indexes or a specific ecosystem - ...args +# Fetch and extract module sources +export complete [zef fetch] profile posix-assign-v1 [ + --force # Ignore errors + --force-fetch # Ignore fetch errors + --update # Refresh all module indexes + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...identities: text # Distributions to fetch ] -# Run the Build.pm in a given modules path -extern "zef build" [ - --force # Ignore errors - --force-build # Ignore errors - ...args +# Run Build.pm in module paths +export complete [zef build] profile posix-assign-v1 [ + --force # Ignore errors + --force-build # Ignore build errors + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...paths: dir # Module paths to build ] -# Update package indexes for repositories -extern "zef update" [ - - ...args +# Update the package indexes +export complete [zef update] profile posix-assign-v1 [ + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...ecosystems: text # Ecosystems to refresh ] -# Upgrade specific distributions (or all if no arguments) -extern "zef upgrade" [ - --fetch - --build - #--/build # Skip the building phase - --test - #--/test # Skip the testing phase - --depends - #--/depends # Do not fetch runtime dependencies - --build-depends - #--/build-depends # Do not fetch build dependencies - --test-depends - #--/test-depends # Do not fetch test dependencies - --force # Ignore errors - --force-resolve # Ignore errors - --force-fetch # Ignore errors - --force-extract # Ignore errors - --force-build # Ignore errors - --force-test # Ignore errors - --force-install # Ignore errors - --dry # Run all phases except the actual installations - --serial # Install each dependency after passing testing and before building/testing the next dependency - --update # Force a refresh for all module indexes or a specific ecosystem - #--/update # Skip refreshing all module indexes or a specific ecosystem - --exclude - --to # Short name or spec of CompUnit::Repository to install to - --install-to # Short name or spec of CompUnit::Repository to install to - ...args -] +# Upgrade distributions (all if none given) +export complete [zef upgrade] profile posix-assign-v1 [ + --fetch # Run the fetching phase + --build # Run the building phase + --test # Run the testing phase + --depends # Fetch runtime dependencies + --build-depends # Fetch build dependencies + --test-depends # Fetch test dependencies + --force # Ignore errors in every phase + --force-resolve # Ignore resolve errors + --force-fetch # Ignore fetch errors + --force-extract # Ignore extract errors + --force-build # Ignore build errors + --force-test # Ignore test errors + --force-install # Ignore install errors + --dry # Run every phase except the installation + --serial # Install each dependency before building/testing the next + --update # Refresh all module indexes + --exclude: text # Exclude a dependency identity + --to: text # CompUnit::Repository short name or spec to install to + --install-to: text # CompUnit::Repository short name or spec to install to + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...identities: text # Distributions to upgrade +] where { + overrides [--to --install-to] +} -# Show a list of possible distribution candidates for the given terms -extern "zef search" [ - --update # Force a refresh for all module indexes or a specific ecosystem - #--/update # Skip refreshing all module indexes or a specific ecosystem - ...args +# Search distribution candidates for terms +export complete [zef search] profile posix-assign-v1 [ + --update # Refresh all module indexes + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...terms: text # Search terms ] # Show detailed distribution information -extern "zef info" [ - --update # Force a refresh for all module indexes or a specific ecosystem - #--/update # Skip refreshing all module indexes or a specific ecosystem - ...args -] - -# Browse support urls (bugtracker etc) -extern "zef browse" [ - --open - #--/open - ...args +export complete [zef info] profile posix-assign-v1 [ + --update # Refresh all module indexes + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...terms: text # Search terms ] # List available distributions -extern "zef list" [ - --update # Force a refresh for all module indexes or a specific ecosystem - #--/update # Skip refreshing all module indexes or a specific ecosystem - --installed(-i) - ...args +export complete [zef list] profile posix-assign-v1 [ + --update # Refresh all module indexes + --installed(-i) # Only list installed distributions + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...repositories: text # Repositories to list ] -# List full dependencies for a given identity -extern "zef depends" [ - --depends - #--/depends # Do not fetch runtime dependencies - --build-depends - #--/build-depends # Do not fetch build dependencies - --test-depends - #--/test-depends # Do not fetch test dependencies - ...args +# Browse support URLs (bugtracker etc) +export complete [zef browse] profile posix-assign-v1 [ + --open # Open the URL in a browser + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + identity: text # Distribution + type?: words [bugtracker homepage source] # Support URL to browse ] -# List all distributions directly depending on a given identity -extern "zef rdepends" [ - --depends - #--/depends # Do not fetch runtime dependencies - --build-depends - #--/build-depends # Do not fetch build dependencies - --test-depends - #--/test-depends # Do not fetch test dependencies - ...args +# List full dependencies of an identity +export complete [zef depends] profile posix-assign-v1 [ + --depends # Include runtime dependencies + --build-depends # Include build dependencies + --test-depends # Include test dependencies + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + identity: text # Distribution ] -# Lookup installed module information by short-name, name-path, sha1 -extern "zef locate" [ - --sha1 - --confirm - ...args +# List distributions directly depending on an identity +export complete [zef rdepends] profile posix-assign-v1 [ + --depends # Include runtime dependencies + --build-depends # Include build dependencies + --test-depends # Include test dependencies + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + identity: text # Distribution ] -# Run smoke testing on available modules -extern "zef smoke" [ - --fetch - --build - #--/build # Skip the building phase - --test - #--/test # Skip the testing phase - --depends - #--/depends # Do not fetch runtime dependencies - --build-depends - #--/build-depends # Do not fetch build dependencies - --test-depends - #--/test-depends # Do not fetch test dependencies - --force # Ignore errors - --force-resolve # Ignore errors - --force-fetch # Ignore errors - --force-extract # Ignore errors - --force-build # Ignore errors - --force-test # Ignore errors - --force-install # Ignore errors - --dry # Run all phases except the actual installations - --serial # Install each dependency after passing testing and before building/testing the next dependency - --update # Force a refresh for all module indexes or a specific ecosystem - #--/update # Skip refreshing all module indexes or a specific ecosystem - --exclude - --to # Short name or spec of CompUnit::Repository to install to - --install-to # Short name or spec of CompUnit::Repository to install to - ...args +# Look up installed modules by short-name, name-path or sha1 +export complete [zef locate] profile posix-assign-v1 [ + --sha1 # Treat the argument as a sha1 + --confirm # Confirm the result + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + identity: text # Module short-name, name-path or sha1 ] -# Delete directory/prefix containing matching configuration path or CURLI name -extern "zef nuke" [ +# Smoke-test available modules +export complete [zef smoke] profile posix-assign-v1 [ + --fetch # Run the fetching phase + --build # Run the building phase + --test # Run the testing phase + --depends # Fetch runtime dependencies + --build-depends # Fetch build dependencies + --test-depends # Fetch test dependencies + --force # Ignore errors in every phase + --force-resolve # Ignore resolve errors + --force-fetch # Ignore fetch errors + --force-extract # Ignore extract errors + --force-build # Ignore build errors + --force-test # Ignore test errors + --force-install # Ignore install errors + --dry # Run every phase except the installation + --serial # Install each dependency before building/testing the next + --update # Refresh all module indexes + --exclude: text # Exclude a dependency identity + --to: text # CompUnit::Repository short name or spec to install to + --install-to: text # CompUnit::Repository short name or spec to install to + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...identities: text # Distributions to smoke-test +] where { + overrides [--to --install-to] +} - ...args -] \ No newline at end of file +# Delete config paths or CURLI prefixes +export complete [zef nuke] profile posix-assign-v1 [ + --help(-h) # Show help + --verbose # Verbose output + --debug # Debug output + --quiet # Quiet output + --error # Only print errors + --config-path: path # Path to a zef config file + ...targets: words [TempDir StoreDir RootDir home site vendor] # Config path names or CURLI names +] diff --git a/custom-completions/zellij/zellij-completions.nu b/custom-completions/zellij/zellij-completions.nu index d85164347..6636b1cfe 100644 --- a/custom-completions/zellij/zellij-completions.nu +++ b/custom-completions/zellij/zellij-completions.nu @@ -1,305 +1,754 @@ -def "nu-complete subcommands" [] { - ^zellij --help | split column "SUBCOMMANDS:" | get column1.0 | str trim | lines | str trim | parse -r '(?P<command>^[ -a-z-]+)' | get command +# Declarative completions for zellij. +# +# `zellij-sessions` stays a user-facing command; the providers below reuse it. + +# The sessions, one row each: `name` and whether it has `exited` (and can only be resurrected). +# Reads only. +@non-destructive +@example "The sessions still running" { zellij-sessions | where not exited | get name } +@example "The exited sessions that can be resurrected" { zellij-sessions | where exited | select name details } +export def zellij-sessions []: nothing -> table<name: string, exited: bool, details: string> { + ^zellij list-sessions --no-formatting + | lines + | parse --regex '^(?<name>\S+)\s*(?<details>.*)$' + | each {|row| {name: $row.name, exited: ($row.details | str contains 'EXITED'), details: $row.details} } } -def "nu-complete zellij" [] { - [ - { value: "action", description: "Send actions to a specific session [aliases: ac]" }, - { value: "attach", description: "Attach to a session [aliases: a]" }, - { value: "convert-config", description: "" }, - { value: "convert-layout", description: "" }, - { value: "convert-theme", description: "" }, - { value: "delete-all-sessions", description: "Delete all sessions [aliases: da]" }, - { value: "delete-session", description: "Delete a specific session [aliases: d]" }, - { value: "edit", description: "Edit file with default $EDITOR / $VISUAL [aliases: e]" }, - { value: "help", description: "Print this message or the help of the given subcommand(s)" }, - { value: "kill-all-sessions", description: "Kill all sessions [aliases: ka]" }, - { value: "kill-session", description: "Kill the specific session [aliases: k]" }, - { value: "list-sessions", description: "List active sessions [aliases: ls]" }, - { value: "options", description: "Change behaviour of zellij" }, - { value: "pipe", description: "Send data to one or more plugins, launch them if they are not running" }, - { value: "plugin", description: "Load a plugin [aliases: p]" }, - { value: "run", description: "Run a command in a new pane [aliases: r]" }, - { value: "setup", description: "Setup zellij and check its configuration" }, - - # Aliases - { value: "ac", description: "Alias for `action`" }, - { value: "a", description: "Alias for `attach`" }, - { value: "e", description: "Alias for `edit`" }, - { value: "da", description: "Alias for `delete-all-sessions`" }, - { value: "d", description: "Alias for `delete-session`" }, - { value: "ka", description: "Alias for `kill-all-sessions`" }, - { value: "k", description: "Alias for `kill-session`" }, - { value: "ls", description: "Alias for `list-sessions`" }, - { value: "p", description: "Alias for `plugin`" }, - { value: "r", description: "Alias for `run`" }, - ] +# Every session, running or exited, described by its state. +@non-destructive +export def "nu-complete zellij sessions" [] { + try { + zellij-sessions | each {|s| {value: $s.name, description: $s.details} } + } catch { + [] + } } -def "nu-complete zellij action" [] { - [ - { value: "close-pane", description: "Close the focused pane" }, - { value: "close-tab", description: "Close the current tab" }, - { value: "dump-screen", description: "Dump the focused pane to a file" }, - { value: "edit", description: "Open the specified file in a new zellij pane with your default EDITOR" }, - { value: "edit-scrollback", description: "Open the pane scrollback in your default editor" }, - { value: "focus-next-pane", description: "Change focus to the next pane" }, - { value: "focus-previous-pane", description: "Change focus to the precvious pane" }, - { value: "go-to-next-tab", description: "Go to the next tab" }, - { value: "go-to-previous-tab", description: "Go to the previous tab" }, - { value: "go-to-tab", description: "Go to tab with index [index]" }, - { value: "half-page-scroll-down", description: "Scroll down half page in focus pane" }, - { value: "half-page-scroll-up", description: "Scroll up half page in focus pane" }, - { value: "help", description: "Print this message or the help of the given subcommand(s)" }, - { value: "move-focus", description: "Move the focused pane in the specified direction. [right|left|up|down]" }, - { value: "move-focus-or-tab", description: "Move focus to the pane or tab (if on screen edge) in the specified direction. [right|left|up|down]" }, - { value: "move-pane", description: "Change the location of the focused pane in the specified direction. [right|left|up|down]" }, - { value: "new-pane", description: "Open a new pane in the specified direction. [right|down] If no direction specified, will try to use the biggest available space" }, - { value: "new-tab", description: "Create a new tab, optionally with a specified tab layout and name" }, - { value: "page-scroll-down", description: "Scroll down one page in focus pane" }, - { value: "page-scroll-up", description: "Scroll up one page in focus pane" }, - { value: "rename-pane", description: "Renames the focused pane" }, - { value: "rename-tab", description: "Renames the focused tab" }, - { value: "resize", description: "Resize the focused pane in the specified direction. [right|left|up|down|+|-]" }, - { value: "scroll-down", description: "Scroll down to the bottom in focus pane" }, - { value: "scroll-up", description: "Scroll up in the focused pane" }, - { value: "switch-mode", description: "Switch input mode of all connected clients [locked|pane|tab|resize|move|search|session]" }, - { value: "toggle-active-sync-tab", description: "Toggle between sending text commands to all panes on the current tab and normal mode" }, - { value: "toggle-floating-panes", description: "Toggle visibility of all floating panes in the current tab, open one if none exist" }, - { value: "toggle-fullscreen", description: "Toggle between fullscreen focus pane and normal layout" }, - { value: "toggle-pane-embed-or-floating", description: "Embed focused pane if floating or float focused pane if embedded" }, - { value: "toggle-pane-frames", description: "Toggle frames around panes in the UI" }, - { value: "undo-rename-pane", description: "Remove a previously set pane name" }, - { value: "undo-rename-tab", description: "Remove a previously set tab name" }, - { value: "write", description: "Write bytes to the terminal" }, - { value: "write-chars", description: "Write characters to the terminal" }, - ] +# Running sessions only (the ones that can be killed or sent actions). +@non-destructive +export def "nu-complete zellij running-sessions" [] { + try { + zellij-sessions | where not exited | each {|s| {value: $s.name, description: $s.details} } + } catch { + [] + } } -def "nu-complete zellij attach" [] { - [ - { value: "help", description: "Print this message or the help of a given subcommand(s)" }, - { value: "options", description: "Change the behaviour of zellij" }, - ] +# Layouts in the layout directory, by name. +@non-destructive +export def "nu-complete zellij layouts" [] { + try { + let candidates = if 'ZELLIJ_CONFIG_DIR' in $env { + [($env.ZELLIJ_CONFIG_DIR | path join layouts)] + } else { + ['~/.config/zellij/layouts' '~/Library/Application Support/org.Zellij-Contributors.Zellij/layouts'] + } + $candidates + | each { path expand } + | where {|d| $d | path exists } + | each {|d| ls $d | where name =~ '\.kdl$' | get name } + | flatten + | each {|f| {value: ($f | path basename | str replace '.kdl' ''), description: $f} } + } catch { + [] + } } -def "nu-complete sessions" [] { - ^zellij ls -n | lines | parse "{value} {description}" +export complete [zellij] [ + command?: words [action: "Send actions to a session" attach: "Attach to a session" convert-config: "Convert an old config file" convert-layout: "Convert an old layout file" convert-theme: "Convert an old theme file" delete-all-sessions: "Delete all sessions" delete-session: "Delete a session" edit: "Edit a file in a new pane" help: "Print help" kill-all-sessions: "Kill all sessions" kill-session: "Kill a session" list-aliases: "List KDL aliases" list-sessions: "List sessions" options: "Change zellij behaviour" pipe: "Send data to plugins" plugin: "Load a plugin" run: "Run a command in a new pane" setup: "Set up zellij" web: "Web client"] # Subcommand + --config(-c): path # Configuration file + --config-dir: dir # Configuration directory + --data-dir: dir # Plugin directory + --debug(-d) # Emit additional debug information + --layout(-l): by "nu-complete zellij layouts" # Layout name or file + --new-session-with-layout(-n): by "nu-complete zellij layouts" # Start a new session with this layout + --max-panes: text # Maximum panes on screen + --session(-s): text # Name of a new session + --help(-h) # Print help + --version(-V) # Print version +] where { + at-most-one [--layout --new-session-with-layout] + terminal [--help --version] } -def "nu-complete zellij layouts" [] { - let layout_dir = if 'ZELLIJ_CONFIG_DIR' in $env { - [$env.ZELLIJ_CONFIG_DIR "layouts"] | path join - } else { - match $nu.os-info.name { - "linux" => "~/.config/zellij/layouts/" - "macos" => { - if ("~/.config/zellij/layouts/" | path exists) { - "~/.config/zellij/layouts/" - } else { - "~/Library/Application Support/org.Zellij-Contributors.Zellij/layouts" - } - } - _ => (error make { msg: "Unsupported OS for zellij" }) - } - } - - ls ( $layout_dir | path expand ) - | where name =~ "\\.kdl" - | get name - | each { |$it| { value: ($it | path basename | str replace ".kdl" ""), description: $it } } -} +export complete [zellij action] [ + ...args: text # The action and its arguments + --help(-h) # Print help +] + +export complete [zellij ac] [ + ...args: text # The action and its arguments + --help(-h) # Print help +] + +export complete [zellij action close-pane] [] + +export complete [zellij ac close-pane] [] + +export complete [zellij action close-tab] [] + +export complete [zellij ac close-tab] [] + +export complete [zellij action detach] [] + +export complete [zellij ac detach] [] + +export complete [zellij action focus-next-pane] [] + +export complete [zellij ac focus-next-pane] [] + +export complete [zellij action focus-previous-pane] [] + +export complete [zellij ac focus-previous-pane] [] + +export complete [zellij action go-to-next-tab] [] + +export complete [zellij ac go-to-next-tab] [] + +export complete [zellij action go-to-previous-tab] [] + +export complete [zellij ac go-to-previous-tab] [] + +export complete [zellij action half-page-scroll-down] [] + +export complete [zellij ac half-page-scroll-down] [] + +export complete [zellij action half-page-scroll-up] [] + +export complete [zellij ac half-page-scroll-up] [] + +export complete [zellij action page-scroll-down] [] + +export complete [zellij ac page-scroll-down] [] + +export complete [zellij action page-scroll-up] [] + +export complete [zellij ac page-scroll-up] [] + +export complete [zellij action scroll-down] [] + +export complete [zellij ac scroll-down] [] + +export complete [zellij action scroll-up] [] + +export complete [zellij ac scroll-up] [] + +export complete [zellij action scroll-to-bottom] [] + +export complete [zellij ac scroll-to-bottom] [] + +export complete [zellij action scroll-to-top] [] + +export complete [zellij ac scroll-to-top] [] + +export complete [zellij action toggle-active-sync-tab] [] + +export complete [zellij ac toggle-active-sync-tab] [] + +export complete [zellij action toggle-floating-panes] [] + +export complete [zellij ac toggle-floating-panes] [] + +export complete [zellij action toggle-fullscreen] [] + +export complete [zellij ac toggle-fullscreen] [] + +export complete [zellij action toggle-pane-embed-or-floating] [] + +export complete [zellij ac toggle-pane-embed-or-floating] [] + +export complete [zellij action toggle-pane-frames] [] + +export complete [zellij ac toggle-pane-frames] [] + +export complete [zellij action undo-rename-pane] [] + +export complete [zellij ac undo-rename-pane] [] + +export complete [zellij action undo-rename-tab] [] + +export complete [zellij ac undo-rename-tab] [] + +export complete [zellij action edit-scrollback] [] + +export complete [zellij ac edit-scrollback] [] + +export complete [zellij action clear] [] + +export complete [zellij ac clear] [] + +export complete [zellij action query-tab-names] [] + +export complete [zellij ac query-tab-names] [] + +export complete [zellij action previous-swap-layout] [] + +export complete [zellij ac previous-swap-layout] [] + +export complete [zellij action next-swap-layout] [] + +export complete [zellij ac next-swap-layout] [] + +export complete [zellij action list-clients] [] + +export complete [zellij ac list-clients] [] + +export complete [zellij action go-to-tab] [ + index: text # Tab index, starting at 1 +] + +export complete [zellij ac go-to-tab] [ + index: text # Tab index, starting at 1 +] + +export complete [zellij action go-to-tab-name] [ + name: text # Tab name + --create(-c) # Create the tab if it does not exist +] + +export complete [zellij ac go-to-tab-name] [ + name: text # Tab name + --create(-c) # Create the tab if it does not exist +] + +export complete [zellij action move-focus] [ + direction: words [right left up down] # Direction +] + +export complete [zellij ac move-focus] [ + direction: words [right left up down] # Direction +] + +export complete [zellij action move-focus-or-tab] [ + direction: words [right left up down] # Direction +] + +export complete [zellij ac move-focus-or-tab] [ + direction: words [right left up down] # Direction +] + +export complete [zellij action move-pane] [ + direction?: words [right left up down] # Direction +] + +export complete [zellij ac move-pane] [ + direction?: words [right left up down] # Direction +] + +export complete [zellij action move-pane-backwards] [] + +export complete [zellij ac move-pane-backwards] [] + +export complete [zellij action move-tab] [ + direction: words [left right] # Direction +] + +export complete [zellij ac move-tab] [ + direction: words [left right] # Direction +] + +export complete [zellij action rename-pane] [ + name: text # New pane name +] + +export complete [zellij ac rename-pane] [ + name: text # New pane name +] + +export complete [zellij action rename-tab] [ + name: text # New tab name +] + +export complete [zellij ac rename-tab] [ + name: text # New tab name +] -# Turned off since it messes with sub-commands -#export extern "zellij" [ -# command?: string@"nu-complete zellij" -# --config(-c) # <CONFIG> Change where zellij looks for the configuration file [env: ZELLIJ_CONFIG_FILE=] -# --config-dir # <CONFIG_DIR> Change where zellij looks for the configuration directory [env: ZELLIJ_CONFIG_DIR=] -# --debug(-d) # Specify emitting additional debug information -# --data-dir # <DATA_DIR> Change where zellij looks for plugins -# --help(-h) # Print help message -# --layout(-l) # <LAYOUT> Name of a predefined layout inside the layout directory or the path to a layout file -# --max-panes # <MAX_PANES> Maximum panes on screen, caution: opening more panes will close old ones -# --sessions(-s) # <SESSION> Specify name of a new session -# --version(-v) # Print version information -#] +export complete [zellij action rename-session] [ + name: text # New session name +] + +export complete [zellij ac rename-session] [ + name: text # New session name +] + +export complete [zellij action resize] [ + resize: words [increase decrease "+" "-"] # Grow or shrink + direction?: words [right left up down] # Direction +] -# Send actions to a specific session -export extern "zellij action" [ - command: string@"nu-complete zellij action" - --help(-h) # Print help information +export complete [zellij ac resize] [ + resize: words [increase decrease "+" "-"] # Grow or shrink + direction?: words [right left up down] # Direction ] -# Renames the focused tab -export extern "zellij action rename-tab" [ - name: string # Name for the tab +export complete [zellij action switch-mode] [ + mode: words [locked pane tab resize move search session normal scroll enter-search rename-tab rename-pane tmux prompt] # Input mode ] -# Create a new tab, optionally with a specified tab layout and name -export extern "zellij action new-tab" [ - --cwd(-c): path # Change the working directory of the new tab - --help(-h) # Print help information - --layout(-l): string@"nu-complete zellij layouts" # Layout to use for the new tab - --layout-dir: path # Default folder to look for layouts - --name(-n): string # Name for the tab +export complete [zellij ac switch-mode] [ + mode: words [locked pane tab resize move search session normal scroll enter-search rename-tab rename-pane tmux prompt] # Input mode ] -# Attach to a session -export extern "zellij attach" [ - session_name: string@"nu-complete sessions" # Name of the session to attach to - command?: string@"nu-complete zellij attach" - --create(-c) # Create a session if one does not exist - --help(-h) # Print help information - --index # <INDEX> Number of the session index in the active sessions ordered by creation date +export complete [zellij action write] [ + ...bytes: text # Bytes to write ] -# <OLD_CONFIG_FILE> -export extern "zellij convert-config" [ - file: path - --help(-h) # Print help information +export complete [zellij ac write] [ + ...bytes: text # Bytes to write ] -# <OLD_LAYOUT_FILE> -export extern "zellij convert-layout" [ - file: path - --help(-h) # Print help information +export complete [zellij action write-chars] [ + chars: text # Characters to write ] -# <OLD_THEME_FILE> -export extern "zellij convert-theme" [ - file: path - --help(-h) # Print help information +export complete [zellij ac write-chars] [ + chars: text # Characters to write ] -def "nu-complete directions" [] { - [ "right" "left" "down" "up" ] +export complete [zellij action dump-screen] [ + path: path # File to dump to + --full(-f) # Dump the scrollback as well +] + +export complete [zellij ac dump-screen] [ + path: path # File to dump to + --full(-f) # Dump the scrollback as well +] + +export complete [zellij action dump-layout] [] + +export complete [zellij ac dump-layout] [] + +export complete [zellij action edit] [ + file: path # File to edit + --direction(-d): words [right left up down] # Direction of the new pane + --line-number(-l): text # Open at this line + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --cwd: dir # Working directory +] where { + at-most-one [--floating --in-place] + excludes --floating --direction +} + +export complete [zellij ac edit] [ + file: path # File to edit + --direction(-d): words [right left up down] # Direction of the new pane + --line-number(-l): text # Open at this line + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --cwd: dir # Working directory +] where { + at-most-one [--floating --in-place] + excludes --floating --direction +} + +export complete [zellij action new-pane] [ + ...command: command # Command to run in the pane + --direction(-d): words [right left up down] # Direction of the new pane + --plugin(-p): text # Plugin URL to load + --cwd: dir # Working directory + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --name(-n): text # Pane name + --close-on-exit(-c) # Close the pane when its command exits + --start-suspended(-s) # Start the command suspended + --configuration: text # Plugin configuration + --skip-plugin-cache # Skip the plugin cache + --width: text # Floating width + --height: text # Floating height + --x(-x): text # Floating x coordinate + --y(-y): text # Floating y coordinate +] where { + at-most-one [--floating --in-place] + excludes --floating --direction + excludes --plugin --close-on-exit + excludes --plugin --start-suspended + requires --width --floating + requires --height --floating + requires -x --floating + requires -y --floating +} + +export complete [zellij ac new-pane] [ + ...command: command # Command to run in the pane + --direction(-d): words [right left up down] # Direction of the new pane + --plugin(-p): text # Plugin URL to load + --cwd: dir # Working directory + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --name(-n): text # Pane name + --close-on-exit(-c) # Close the pane when its command exits + --start-suspended(-s) # Start the command suspended + --configuration: text # Plugin configuration + --skip-plugin-cache # Skip the plugin cache + --width: text # Floating width + --height: text # Floating height + --x(-x): text # Floating x coordinate + --y(-y): text # Floating y coordinate +] where { + at-most-one [--floating --in-place] + excludes --floating --direction + excludes --plugin --close-on-exit + excludes --plugin --start-suspended + requires --width --floating + requires --height --floating + requires -x --floating + requires -y --floating +} + +export complete [zellij action new-tab] [ + --layout(-l): by "nu-complete zellij layouts" # Layout for the new tab + --layout-dir: dir # Layout directory + --name(-n): text # Tab name + --cwd(-c): dir # Working directory + --help(-h) # Print help +] where { terminal [--help] } + +export complete [zellij ac new-tab] [ + --layout(-l): by "nu-complete zellij layouts" # Layout for the new tab + --layout-dir: dir # Layout directory + --name(-n): text # Tab name + --cwd(-c): dir # Working directory + --help(-h) # Print help +] where { terminal [--help] } + +export complete [zellij action launch-or-focus-plugin] [ + url: text # Plugin URL + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --move-to-focused-tab(-m) # Move the plugin to the focused tab + --configuration(-c): text # Plugin configuration + --skip-plugin-cache(-s) # Skip the plugin cache +] where { + at-most-one [--floating --in-place] } -# Edit file with default $EDITOR / $VISUAL -export extern "zellij edit" [ - file: path - --cwd: path # <CWD> Change the working directory of the editor - --direction(-d): string@"nu-complete directions" # <DIRECTION> Direction to open the new pane in - --floating(-f) # Open the new pane in floating mode - --help(-h) # Print help information - --line-number(-l): number # <LINE_NUMBER> Open the file in the specified line number +export complete [zellij ac launch-or-focus-plugin] [ + url: text # Plugin URL + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --move-to-focused-tab(-m) # Move the plugin to the focused tab + --configuration(-c): text # Plugin configuration + --skip-plugin-cache(-s) # Skip the plugin cache +] where { + at-most-one [--floating --in-place] +} + +export complete [zellij action start-or-reload-plugin] [ + url: text # Plugin URL + --configuration(-c): text # Plugin configuration +] + +export complete [zellij ac start-or-reload-plugin] [ + url: text # Plugin URL + --configuration(-c): text # Plugin configuration +] + +export complete [zellij attach] [ + session_name?: by "nu-complete zellij sessions" # Session to attach to + --create(-c) # Create the session if it does not exist + --create-background(-b) # Create a detached session in the background + --index: text # Attach by index in creation order + --force-run-commands(-f) # Run resurrected commands immediately + --help(-h) # Print help +] where { + at-most-one [--create --create-background] + terminal [--help] +} + +export complete [zellij a] [ + session_name?: by "nu-complete zellij sessions" # Session to attach to + --create(-c) # Create the session if it does not exist + --create-background(-b) # Create a detached session in the background + --index: text # Attach by index in creation order + --force-run-commands(-f) # Run resurrected commands immediately + --help(-h) # Print help +] where { + at-most-one [--create --create-background] + terminal [--help] +} + +export complete [zellij convert-config] [ + file: path # The old file to convert + --help(-h) # Print help ] -# Print this message or the help of the given subcommand(s) -export extern "zellij help" [ - command?: string@"nu-complete subcommands" +export complete [zellij convert-layout] [ + file: path # The old file to convert + --help(-h) # Print help ] -# Delete all sessions -export extern "zellij delete-all-sessions" [ - --force(-f) # Kill the sessions if they're running before deleting them - --help(-h) # Print help information - --yes(-y) # Automatic yes to prompts +export complete [zellij convert-theme] [ + file: path # The old file to convert + --help(-h) # Print help ] -# Delete the specific session -export extern "zellij delete-session" [ - session_name: string@"nu-complete sessions" # <TARGET_SESSION> Name of target session - --force(-f) # Kill the sessions if they're running before deleting them - --help(-h) # Print help information +export complete [zellij delete-all-sessions] [ + --force(-f) # Kill running sessions before deleting + --yes(-y) # Answer yes to prompts + --help(-h) # Print help ] -# Kill all sessions -export extern "zellij kill-all-sessions" [ - --help(-h) # Print help information - --yes(-y) # Automatic yes to prompts +export complete [zellij da] [ + --force(-f) # Kill running sessions before deleting + --yes(-y) # Answer yes to prompts + --help(-h) # Print help ] -# Kill the specific session -export extern "zellij kill-session" [ - session_name: string@"nu-complete sessions" # <TARGET_SESSION> Name of target session - --help(-h) # Print help information # Print help information +export complete [zellij delete-session] [ + session_name: by "nu-complete zellij sessions" # Session to delete + --force(-f) # Kill the session if it is running + --help(-h) # Print help ] -# List active sessions -export extern "zellij list-sessions" [ - --help(-h) # Print help information +export complete [zellij d] [ + session_name: by "nu-complete zellij sessions" # Session to delete + --force(-f) # Kill the session if it is running + --help(-h) # Print help ] -def "nu-complete string bools" [] { - [ "'true'" "'false'" ] +export complete [zellij edit] [ + file: path # File to edit + --cwd: dir # Working directory of the editor + --direction(-d): words [right left up down] # Direction of the new pane + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --line-number(-l): text # Open at this line + --width: text # Floating width + --height: text # Floating height + --x(-x): text # Floating x coordinate + --y(-y): text # Floating y coordinate + --help(-h) # Print help +] where { + at-most-one [--floating --in-place] + excludes --floating --direction + requires --width --floating + requires --height --floating + requires -x --floating + requires -y --floating } -def "nu-complete option copy-clipboard" [] { - [ "system", "primary" ] +export complete [zellij e] [ + file: path # File to edit + --cwd: dir # Working directory of the editor + --direction(-d): words [right left up down] # Direction of the new pane + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --line-number(-l): text # Open at this line + --width: text # Floating width + --height: text # Floating height + --x(-x): text # Floating x coordinate + --y(-y): text # Floating y coordinate + --help(-h) # Print help +] where { + at-most-one [--floating --in-place] + excludes --floating --direction + requires --width --floating + requires --height --floating + requires -x --floating + requires -y --floating } -def "nu-complete option on-force-close" [] { - [ "quit" "detach" ] +export complete [zellij help] [ + command?: words [action: "Send actions to a session" attach: "Attach to a session" convert-config: "Convert an old config file" convert-layout: "Convert an old layout file" convert-theme: "Convert an old theme file" delete-all-sessions: "Delete all sessions" delete-session: "Delete a session" edit: "Edit a file in a new pane" help: "Print help" kill-all-sessions: "Kill all sessions" kill-session: "Kill a session" list-aliases: "List KDL aliases" list-sessions: "List sessions" options: "Change zellij behaviour" pipe: "Send data to plugins" plugin: "Load a plugin" run: "Run a command in a new pane" setup: "Set up zellij" web: "Web client"] # Subcommand to describe +] + +export complete [zellij kill-all-sessions] [ + --yes(-y) # Answer yes to prompts + --help(-h) # Print help +] + +export complete [zellij ka] [ + --yes(-y) # Answer yes to prompts + --help(-h) # Print help +] + +export complete [zellij kill-session] [ + session_name: by "nu-complete zellij running-sessions" # Session to kill + --help(-h) # Print help +] + +export complete [zellij k] [ + session_name: by "nu-complete zellij running-sessions" # Session to kill + --help(-h) # Print help +] + +export complete [zellij list-sessions] [ + --no-formatting(-n) # Do not format the output + --short(-s) # Print only session names + --reverse(-r) # List oldest first + --help(-h) # Print help +] where { + at-most-one [--short --no-formatting] +} + +export complete [zellij ls] [ + --no-formatting(-n) # Do not format the output + --short(-s) # Print only session names + --reverse(-r) # List oldest first + --help(-h) # Print help +] where { + at-most-one [--short --no-formatting] } -# Change the behaviour of zellij -export extern "zellij options" [ - --attach-to-session: string@"nu-complete string bools" # Whether to attach to a session specified in "session-name" if it exists [possible values: true, false] - --copy-clipboard: string@"nu-complete option copy-clipboard" # OSC52 destination clipboard [possible values: system, primary] - --copy-command: string # <COPY_COMMAND> Switch to using a user supplied command for clipboard instead of OSC52 - --copy-on-select: string@"nu-complete string bools" # Automatically copy when selecting text (tru or false) [possible values: true, false] - --default-layout # <DEFAULT_LAYOUT> Set the default layout - --default-mode # <DEFAULT_MODE> Set the default mode - --default-shell # <DEFAULT_SHELL> Set the default shell - --disable-mouse-mode # Disable handling of mouse events - --help(-h) # Print help information - --layout-dir: path # <LAYOUT_DIR> Set the layout_dir, defaults to subdirectory of config dir - --mirror-session: string@"nu-complete string bools" # Mirror session when multiple users are connected (true or false) [possible values: true, false] - --mouse-mode: string@"nu-complete string bools" # <MOUSE_MODE> Set the handling of mouse events (true or false) Can be temporarily bypassed by the [SHIFT] key [possible values: true, false] - --on-force-close: string@"nu-complete option on-force-close" # <ON_FORCE_CLOSE> Set behaviour on force close (quit or detach) - --pane-frames: string@"nu-complete string bools" # <PANE_FRAMES> Set display of pane frames (true or false) [possible values: true, false] - --scroll-buffer-size: any # <SCROLL_BUFFER_SIZE> - --scrollback-editor: path # <SCROLLBACK_EDITOR> Explicit full path to open the scrollback editor (default is $EDITOR or $VISUAL) - --session-name: string # <SESSION_NAME> The name of the session to create when starting Zellij - --simplified-ui: string@"nu-complete string bools" # <SIMPLIFIED_UI> Allow plugins to use a more simplified layout that is compatible with more fonts (true or false) [possible values: true, false] - --theme: string # <THEME> Set the default theme - --theme-dir: path # <THEME_DIR> Set the theme_dir, defaults to subdirectory of config dir -] - -# Send data to one or more plugins, launch them if they are not running -export extern "zellij pipe" [ - --name(-n): string # <NAME> The name of the pipe - --args(-a): string # <ARGS> The args of the pipe - --plugin(-p): string # <PLUGIN> The plugin url (eg. file:/tmp/my-plugin.wasm) to direct this pipe to, if not specified, will be sent to all plugins, if specified and is not running, the plugin will be launched - --plugin-configuration(-c): string # <PLUGIN_CONFIGURATION> The plugin configuration (note: the same plugin with different configuration is considered a different plugin for the purposes of determining the pipe destination) - --help(-h) # Print help information -] - -# Load a plugin -export extern "zellij plugin" [ - --configuration(-c): string # <CONFIGURATION> Plugin configuration - --floating(-f) # Open the new pane in floating mode - --help(-h) # Print help information - --height: any # <HEIGHT> The height if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) - --in-place(-i) # Open the new pane in place of the current pane, temporarily suspending it - --skip-plugin-cache(-s) # Skip the memory and HD cache and force recompile of the plugin (good for development) - --width: any # <WIDTH> The width if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) - --x(-x): any # <X> The x coordinates if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) - --y(-y): any # <Y> The y coordinates if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) -] - - -# Run a command in a new pane -export extern "zellij run" [ - command: string # Command to run - --close-on-exit(-c) # Close the pane immediately when its command exits - --cwd: path # <CWD> Change the working directory of th new pane - --direction(-d): string@"nu-complete directions" # <DIRECTION> Direction to open new pane in - --floating(-f) # Open the new pane in floating mode - --help(-h) # Print help information - --name(-n): string # <NAME> Name of the new pane - --start-suspended(-s) # Start the command suspended, only running after you first presses ENTER -] - -export extern "zellij setup" [ - --check # Checks the configuration of zellij and displays currently used directories - --clean # Disables loading of configuration file at default location, loads the defaults that zellij ships with - --dump-config # Dump the default configuration file to stdout - --dump-layout: string # <DUMP_LAYOUT> Dump the specified layout file to stdout - --generate-auto-start: string # Generates auto-start for the specified shell - --generate-completion: string # Generates completion for the specified shell - --help(-h) # Print help information +export complete [zellij list-aliases] [ + --help(-h) # Print help +] + +export complete [zellij la] [ + --help(-h) # Print help ] +export complete [zellij options] [ + --attach-to-session: words [true false] # Attach to the session named by session-name if it exists + --auto-layout: words [true false] # Use swap layouts automatically + --copy-clipboard: words [system primary] # OSC52 destination clipboard + --copy-command: text # Command to use for the clipboard instead of OSC52 + --copy-on-select: words [true false] # Copy when selecting text + --default-cwd: dir # Default working directory + --default-layout: by "nu-complete zellij layouts" # Default layout + --default-mode: words [normal locked] # Default input mode + --default-shell: path # Default shell + --disable-mouse-mode # Disable mouse events + --layout-dir: dir # Layout directory + --mirror-session: words [true false] # Mirror the session for multiple users + --mouse-mode: words [true false] # Handle mouse events + --on-force-close: words [quit detach] # Behaviour on force close + --pane-frames: words [true false] # Display pane frames + --scroll-buffer-size: text # Scrollback buffer size + --scrollback-editor: path # Editor for the scrollback + --session-name: text # Name of the session to create + --session-serialization: words [true false] # Serialize sessions for resurrection + --simplified-ui: words [true false] # Use a simplified UI + --styled-underlines: words [true false] # Use styled underlines + --theme: text # Default theme + --theme-dir: dir # Theme directory + --help(-h) # Print help +] where { + excludes --disable-mouse-mode --mouse-mode +} + +export complete [zellij pipe] [ + payload?: text # Data to send; stdin when absent + --name(-n): text # Pipe name + --args(-a): text # Pipe arguments + --plugin(-p): text # Plugin URL to direct the pipe to + --plugin-configuration(-c): text # Plugin configuration + --force-launch-plugin(-l) # Launch a new plugin even if one is running + --skip-plugin-cache(-s) # Skip the plugin cache + --floating-plugin(-f): words [true false] # Launch the plugin floating + --in-place-plugin(-i): words [true false] # Launch the plugin in place + --plugin-cwd(-w): dir # Plugin working directory + --plugin-title(-t): text # Plugin pane title + --help(-h) # Print help +] where { + requires --force-launch-plugin --plugin + requires --plugin-configuration --plugin +} + +export complete [zellij plugin] [ + url: text # Plugin URL, such as file:/path/plugin.wasm + --configuration(-c): text # Plugin configuration + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --skip-plugin-cache(-s) # Skip the plugin cache + --width: text # Floating width + --height: text # Floating height + --x(-x): text # Floating x coordinate + --y(-y): text # Floating y coordinate + --pinned: words [true false] # Pin the floating pane + --help(-h) # Print help +] where { + at-most-one [--floating --in-place] + requires --width --floating + requires --height --floating + requires -x --floating + requires -y --floating + requires --pinned --floating +} + +export complete [zellij p] [ + url: text # Plugin URL, such as file:/path/plugin.wasm + --configuration(-c): text # Plugin configuration + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --skip-plugin-cache(-s) # Skip the plugin cache + --width: text # Floating width + --height: text # Floating height + --x(-x): text # Floating x coordinate + --y(-y): text # Floating y coordinate + --pinned: words [true false] # Pin the floating pane + --help(-h) # Print help +] where { + at-most-one [--floating --in-place] + requires --width --floating + requires --height --floating + requires -x --floating + requires -y --floating + requires --pinned --floating +} + +export complete [zellij run] [ + ...command: command # Command to run + --close-on-exit(-c) # Close the pane when its command exits + --cwd: dir # Working directory of the new pane + --direction(-d): words [right left up down] # Direction of the new pane + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --name(-n): text # Pane name + --start-suspended(-s) # Run only after ENTER is pressed + --width: text # Floating width + --height: text # Floating height + --x(-x): text # Floating x coordinate + --y(-y): text # Floating y coordinate + --pinned: words [true false] # Pin the floating pane + --help(-h) # Print help +] where { + at-most-one [--floating --in-place] + excludes --floating --direction + requires --width --floating + requires --height --floating + requires -x --floating + requires -y --floating + requires --pinned --floating +} + +export complete [zellij r] [ + ...command: command # Command to run + --close-on-exit(-c) # Close the pane when its command exits + --cwd: dir # Working directory of the new pane + --direction(-d): words [right left up down] # Direction of the new pane + --floating(-f) # Open in a floating pane + --in-place(-i) # Open in place of the focused pane + --name(-n): text # Pane name + --start-suspended(-s) # Run only after ENTER is pressed + --width: text # Floating width + --height: text # Floating height + --x(-x): text # Floating x coordinate + --y(-y): text # Floating y coordinate + --pinned: words [true false] # Pin the floating pane + --help(-h) # Print help +] where { + at-most-one [--floating --in-place] + excludes --floating --direction + requires --width --floating + requires --height --floating + requires -x --floating + requires -y --floating + requires --pinned --floating +} + +export complete [zellij setup] [ + --check # Check the configuration and show the directories in use + --clean # Ignore the configuration file and use the defaults + --dump-config # Print the default configuration + --dump-layout: by "nu-complete zellij layouts" # Print a layout + --dump-swap-layout: by "nu-complete zellij layouts" # Print a swap layout + --dump-plugins: dir # Dump the built-in plugins to a directory + --generate-auto-start: words [bash elvish fish nushell powershell zsh] # Print auto-start code for a shell + --generate-completion: words [bash elvish fish nushell powershell zsh] # Print completions for a shell + --help(-h) # Print help +] where { + at-most-one [--check --dump-config --dump-layout --dump-swap-layout --dump-plugins --generate-auto-start --generate-completion] +} diff --git a/custom-completions/zig/zig-completions.nu b/custom-completions/zig/zig-completions.nu index b874f9193..c71cfef1d 100644 --- a/custom-completions/zig/zig-completions.nu +++ b/custom-completions/zig/zig-completions.nu @@ -1,104 +1,760 @@ -# zvm -def "nu-complete zvm versions" [] { - ^zvm list - | lines +# zvm, the Zig version manager. +@non-destructive +export def "nu-complete zvm versions" [] { + try { + ^zvm list + | lines + } catch { [] } +} + +def "nu-complete zvm commands" [] { + [use install run list uninstall clean upgrade mirrorlist vmu help] } -# switch between versions of Zig -export extern "zvm use" [ - --sync #sync your current version of Zig with the repository - --help(-h) - version: string@"nu-complete zvm versions" -] - - # download and install a version of Zig -export extern "zvm install" [] -# run a command with the given Zig version -export extern "zvm run" [] -# list installed Zig versions. Flag `--all` to see remote options -export extern "zvm list" [] -# remove an installed version of Zig -export extern "zvm uninstall" [] -# remove build artifacts (good if you're a scrub) -export extern "zvm clean" [] -# self-upgrade ZVM -export extern "zvm upgrade" [] -# set ZVM's mirror list URL for custom Zig distribution servers, or set to "disabled" to download directly from ziglang.org -export extern "zvm mirrorlist" [] -# set ZVM's version map URL for custom Zig distribution servers -export extern "zvm vmu" [] -# Shows a list of commands or help for one command -export extern "zvm help" [] # ======= # zig # ======= -def "nu-complete zig build" [] { - ^zig build -l - | lines - | parse --regex '^\s+(\S+)(?:\s+\(default\))?\s{2,}(.+)' - | rename value description - | update description { str trim } +@non-destructive +export def "nu-complete zig build" [] { + try { + ^zig build -l + | lines + | parse --regex '^\s+(\S+)(?:\s+\(default\))?\s{2,}(.+)' + | rename value description + | update description { str trim } + } catch { [] } } -# Build project from build.zig -export extern "zig build" [ - step?: string@"nu-complete zig build" +def "nu-complete zig commands" [] { + [build fetch init build-exe build-lib build-obj test test-obj run ast-check fmt reduce translate-c ar cc c++ dlltool lib ranlib objcopy objdump rc env help cache-cat std libc targets version zen] +} + + +# Zig target triples (`zig targets`), with a short list of common ones as fallback. +@non-destructive +export def "nu-complete zig targets" [] { + try { + # `zig targets` prints ZON: take the strings of its `.libc = .{ ... }` list. + ^zig targets | complete | get stdout | lines | skip until {|l| $l =~ '^\s*\.libc = ' } | skip 1 | take while {|l| $l !~ '^\s*\},?$' } | str trim | str trim --char ',' | str trim --char '"' | prepend native + } catch { + [x86_64-linux-gnu x86_64-linux-musl aarch64-linux-gnu aarch64-linux-musl x86_64-macos aarch64-macos x86_64-windows-gnu aarch64-windows-gnu wasm32-wasi wasm32-freestanding riscv64-linux-gnu native] + } +} + +export complete [zvm] [ + +] + +export complete [zvm use] [ + version: by "nu-complete zvm versions" + --sync # sync your current version of Zig with the repository + --help(-h) +] where { + terminal [--help] +} + +export complete [zvm install] [ + version: text + --help(-h) +] where { + terminal [--help] +} + +export complete [zvm run] [ + version: by "nu-complete zvm versions" + ...command: text + --help(-h) +] where { + terminal [--help] +} + +export complete [zvm list] [ + --all + --help(-h) +] where { + terminal [--help] +} + +export complete [zvm uninstall] [ + version: by "nu-complete zvm versions" + --help(-h) +] where { + terminal [--help] +} + +export complete [zvm clean] [ + +] + +export complete [zvm upgrade] [ + +] + +export complete [zvm mirrorlist] [ + url: text +] + +export complete [zvm vmu] [ + url: text +] + +export complete [zvm help] [ + command?: text +] + +export complete [zig] [ + --help(-h) +] where { + terminal [--help] +} + +export complete [zig ast-check] [ + file: path + ...args: text ] +export complete [zig reduce] [ + file: path + --rebuild # Rebuild after every reduction step + ...args: text +] + +export complete [zig ar] [ + archive: path + ...objects: path +] + +export complete [zig dlltool] [ + --input-def: path # The .def file to read + --output-lib: path # The import library to write + ...args: text +] + +export complete [zig lib] [ + ...args: text +] + +export complete [zig ranlib] [ + archive: path +] + +export complete [zig objcopy] [ + input: path + output: path + ...args: text +] + +export complete [zig objdump] [ + file: path + ...args: text +] + +export complete [zig rc] [ + ...args: text +] + +export complete [zig env] [ + +] + +export complete [zig help] [ + command?: text +] + +export complete [zig cache-cat] [ + manifest: path +] + +export complete [zig std] [ + +] + +export complete [zig libc] [ + file?: path +] + +export complete [zig targets] [ + +] + +export complete [zig version] [ + +] + +export complete [zig zen] [ + +] -# Copy a package into global cache and print its hash -export extern "zig fetch" [] -# Initialize a Zig package in the current directory -export extern "zig init" [] # Create executable from source or object files -export extern "zig build-exe" [] +export complete [zig build-exe] profile single-dash-v1 [ + ...files: path # Zig, C, C++, assembly or object files + -O: words [Debug: "safety on, fast compile" ReleaseSafe: "optimizations + safety" ReleaseFast: "optimizations, no safety" ReleaseSmall: "optimize for size"] # Choose what to optimize for + -target: by "nu-complete zig targets" # <arch><sub>-<os>-<abi>, see `zig targets` + -mcpu: text # Specify target CPU and feature set + -ofmt: words [elf c wasm coff macho spirv plan9 hex raw] # Override target object format + --name: text # Compilation unit name (not a file path) + -femit-bin?: path # (default) Output machine code + -fno-emit-bin # Do not output machine code + -femit-asm?: path # Output .s (assembly code) + -femit-llvm-ir?: path # Produce a .ll file with optimized LLVM IR + -femit-h?: path # Generate a C header file (.h) + -femit-docs?: dir # Create a docs/ dir with html documentation + --color: words [auto off on] # Enable or disable colored error messages + -fincremental # Enable incremental compilation + -fno-incremental # Disable incremental compilation + --cache-dir: dir # Override the local cache directory + --global-cache-dir: dir # Override the global cache directory + --zig-lib-dir: dir # Override path to Zig installation lib directory + -fllvm # Force using LLVM as the codegen backend + -fno-llvm # Prevent using LLVM as the codegen backend + -flto # Force-enable Link Time Optimization + -fno-lto # Force-disable Link Time Optimization + -fPIC # Force-enable Position Independent Code + -fno-PIC # Force-disable Position Independent Code + -fstrip # Omit debug symbols + -fno-strip # Keep debug symbols + -fsingle-threaded # Code assumes there is only one thread + -fno-single-threaded # Code may not assume there is only one thread + -fsanitize-thread # Enable Thread Sanitizer + -fno-sanitize-thread # Disable Thread Sanitizer + -fvalgrind # Include valgrind client requests in release builds + -fno-valgrind # Omit valgrind client requests in debug builds + -lc # Link against system libc + -lc++ # Link against libc++ + -isystem: dir # Add directory to SYSTEM include search path + -idirafter: dir # Add directory to AFTER include search path + -L: dir # Add a directory to the library search path + -rpath: dir # Add directory to the runtime library search path + --sysroot: dir # Set the system root directory + --libc: path # Provide a file which specifies libc paths + --dynamic-linker: path # Set the dynamic interpreter path + --script: path # Use a custom linker script + -x: words [zig c c++ assembler assembler-with-cpp] # Treat subsequent input files as having type <language> + --error-limit: text # Set the maximum amount of distinct error values + -j: text # Limit concurrent jobs + --verbose-link # Display linker invocations + --verbose-cc # Display C compiler invocations + --help(-h) # Print help and exit + -dynamic # Force output to be dynamically linked + -static # Force output to be statically linked +] where { + overrides [-fincremental -fno-incremental] + overrides [-fllvm -fno-llvm] + overrides [-flto -fno-lto] + overrides [-fPIC -fno-PIC] + overrides [-fstrip -fno-strip] + overrides [-fsingle-threaded -fno-single-threaded] + overrides [-fsanitize-thread -fno-sanitize-thread] + overrides [-fvalgrind -fno-valgrind] + overrides [-femit-bin -fno-emit-bin] + terminal [--help] + at-most-one [-dynamic -static] +} + # Create library from source or object files -export extern "zig build-lib" [] +export complete [zig build-lib] profile single-dash-v1 [ + ...files: path # Zig, C, C++, assembly or object files + -O: words [Debug: "safety on, fast compile" ReleaseSafe: "optimizations + safety" ReleaseFast: "optimizations, no safety" ReleaseSmall: "optimize for size"] # Choose what to optimize for + -target: by "nu-complete zig targets" # <arch><sub>-<os>-<abi>, see `zig targets` + -mcpu: text # Specify target CPU and feature set + -ofmt: words [elf c wasm coff macho spirv plan9 hex raw] # Override target object format + --name: text # Compilation unit name (not a file path) + -femit-bin?: path # (default) Output machine code + -fno-emit-bin # Do not output machine code + -femit-asm?: path # Output .s (assembly code) + -femit-llvm-ir?: path # Produce a .ll file with optimized LLVM IR + -femit-h?: path # Generate a C header file (.h) + -femit-docs?: dir # Create a docs/ dir with html documentation + --color: words [auto off on] # Enable or disable colored error messages + -fincremental # Enable incremental compilation + -fno-incremental # Disable incremental compilation + --cache-dir: dir # Override the local cache directory + --global-cache-dir: dir # Override the global cache directory + --zig-lib-dir: dir # Override path to Zig installation lib directory + -fllvm # Force using LLVM as the codegen backend + -fno-llvm # Prevent using LLVM as the codegen backend + -flto # Force-enable Link Time Optimization + -fno-lto # Force-disable Link Time Optimization + -fPIC # Force-enable Position Independent Code + -fno-PIC # Force-disable Position Independent Code + -fstrip # Omit debug symbols + -fno-strip # Keep debug symbols + -fsingle-threaded # Code assumes there is only one thread + -fno-single-threaded # Code may not assume there is only one thread + -fsanitize-thread # Enable Thread Sanitizer + -fno-sanitize-thread # Disable Thread Sanitizer + -fvalgrind # Include valgrind client requests in release builds + -fno-valgrind # Omit valgrind client requests in debug builds + -lc # Link against system libc + -lc++ # Link against libc++ + -isystem: dir # Add directory to SYSTEM include search path + -idirafter: dir # Add directory to AFTER include search path + -L: dir # Add a directory to the library search path + -rpath: dir # Add directory to the runtime library search path + --sysroot: dir # Set the system root directory + --libc: path # Provide a file which specifies libc paths + --dynamic-linker: path # Set the dynamic interpreter path + --script: path # Use a custom linker script + -x: words [zig c c++ assembler assembler-with-cpp] # Treat subsequent input files as having type <language> + --error-limit: text # Set the maximum amount of distinct error values + -j: text # Limit concurrent jobs + --verbose-link # Display linker invocations + --verbose-cc # Display C compiler invocations + --help(-h) # Print help and exit + -dynamic # Force output to be dynamically linked + -static # Force output to be statically linked +] where { + overrides [-fincremental -fno-incremental] + overrides [-fllvm -fno-llvm] + overrides [-flto -fno-lto] + overrides [-fPIC -fno-PIC] + overrides [-fstrip -fno-strip] + overrides [-fsingle-threaded -fno-single-threaded] + overrides [-fsanitize-thread -fno-sanitize-thread] + overrides [-fvalgrind -fno-valgrind] + overrides [-femit-bin -fno-emit-bin] + terminal [--help] + at-most-one [-dynamic -static] +} + # Create object from source or object files -export extern "zig build-obj" [] +export complete [zig build-obj] profile single-dash-v1 [ + ...files: path # Zig, C, C++, assembly or object files + -O: words [Debug: "safety on, fast compile" ReleaseSafe: "optimizations + safety" ReleaseFast: "optimizations, no safety" ReleaseSmall: "optimize for size"] # Choose what to optimize for + -target: by "nu-complete zig targets" # <arch><sub>-<os>-<abi>, see `zig targets` + -mcpu: text # Specify target CPU and feature set + -ofmt: words [elf c wasm coff macho spirv plan9 hex raw] # Override target object format + --name: text # Compilation unit name (not a file path) + -femit-bin?: path # (default) Output machine code + -fno-emit-bin # Do not output machine code + -femit-asm?: path # Output .s (assembly code) + -femit-llvm-ir?: path # Produce a .ll file with optimized LLVM IR + -femit-h?: path # Generate a C header file (.h) + -femit-docs?: dir # Create a docs/ dir with html documentation + --color: words [auto off on] # Enable or disable colored error messages + -fincremental # Enable incremental compilation + -fno-incremental # Disable incremental compilation + --cache-dir: dir # Override the local cache directory + --global-cache-dir: dir # Override the global cache directory + --zig-lib-dir: dir # Override path to Zig installation lib directory + -fllvm # Force using LLVM as the codegen backend + -fno-llvm # Prevent using LLVM as the codegen backend + -flto # Force-enable Link Time Optimization + -fno-lto # Force-disable Link Time Optimization + -fPIC # Force-enable Position Independent Code + -fno-PIC # Force-disable Position Independent Code + -fstrip # Omit debug symbols + -fno-strip # Keep debug symbols + -fsingle-threaded # Code assumes there is only one thread + -fno-single-threaded # Code may not assume there is only one thread + -fsanitize-thread # Enable Thread Sanitizer + -fno-sanitize-thread # Disable Thread Sanitizer + -fvalgrind # Include valgrind client requests in release builds + -fno-valgrind # Omit valgrind client requests in debug builds + -lc # Link against system libc + -lc++ # Link against libc++ + -isystem: dir # Add directory to SYSTEM include search path + -idirafter: dir # Add directory to AFTER include search path + -L: dir # Add a directory to the library search path + -rpath: dir # Add directory to the runtime library search path + --sysroot: dir # Set the system root directory + --libc: path # Provide a file which specifies libc paths + --dynamic-linker: path # Set the dynamic interpreter path + --script: path # Use a custom linker script + -x: words [zig c c++ assembler assembler-with-cpp] # Treat subsequent input files as having type <language> + --error-limit: text # Set the maximum amount of distinct error values + -j: text # Limit concurrent jobs + --verbose-link # Display linker invocations + --verbose-cc # Display C compiler invocations + --help(-h) # Print help and exit +] where { + overrides [-fincremental -fno-incremental] + overrides [-fllvm -fno-llvm] + overrides [-flto -fno-lto] + overrides [-fPIC -fno-PIC] + overrides [-fstrip -fno-strip] + overrides [-fsingle-threaded -fno-single-threaded] + overrides [-fsanitize-thread -fno-sanitize-thread] + overrides [-fvalgrind -fno-valgrind] + overrides [-femit-bin -fno-emit-bin] + terminal [--help] +} + # Perform unit testing -export extern "zig test" [] +export complete [zig test] profile single-dash-v1 [ + ...files: path # Files containing tests + -O: words [Debug: "safety on, fast compile" ReleaseSafe: "optimizations + safety" ReleaseFast: "optimizations, no safety" ReleaseSmall: "optimize for size"] # Choose what to optimize for + -target: by "nu-complete zig targets" # <arch><sub>-<os>-<abi>, see `zig targets` + -mcpu: text # Specify target CPU and feature set + -ofmt: words [elf c wasm coff macho spirv plan9 hex raw] # Override target object format + --name: text # Compilation unit name (not a file path) + -femit-bin?: path # (default) Output machine code + -fno-emit-bin # Do not output machine code + -femit-asm?: path # Output .s (assembly code) + -femit-llvm-ir?: path # Produce a .ll file with optimized LLVM IR + -femit-h?: path # Generate a C header file (.h) + -femit-docs?: dir # Create a docs/ dir with html documentation + --color: words [auto off on] # Enable or disable colored error messages + -fincremental # Enable incremental compilation + -fno-incremental # Disable incremental compilation + --cache-dir: dir # Override the local cache directory + --global-cache-dir: dir # Override the global cache directory + --zig-lib-dir: dir # Override path to Zig installation lib directory + -fllvm # Force using LLVM as the codegen backend + -fno-llvm # Prevent using LLVM as the codegen backend + -flto # Force-enable Link Time Optimization + -fno-lto # Force-disable Link Time Optimization + -fPIC # Force-enable Position Independent Code + -fno-PIC # Force-disable Position Independent Code + -fstrip # Omit debug symbols + -fno-strip # Keep debug symbols + -fsingle-threaded # Code assumes there is only one thread + -fno-single-threaded # Code may not assume there is only one thread + -fsanitize-thread # Enable Thread Sanitizer + -fno-sanitize-thread # Disable Thread Sanitizer + -fvalgrind # Include valgrind client requests in release builds + -fno-valgrind # Omit valgrind client requests in debug builds + -lc # Link against system libc + -lc++ # Link against libc++ + -isystem: dir # Add directory to SYSTEM include search path + -idirafter: dir # Add directory to AFTER include search path + -L: dir # Add a directory to the library search path + -rpath: dir # Add directory to the runtime library search path + --sysroot: dir # Set the system root directory + --libc: path # Provide a file which specifies libc paths + --dynamic-linker: path # Set the dynamic interpreter path + --script: path # Use a custom linker script + -x: words [zig c c++ assembler assembler-with-cpp] # Treat subsequent input files as having type <language> + --error-limit: text # Set the maximum amount of distinct error values + -j: text # Limit concurrent jobs + --verbose-link # Display linker invocations + --verbose-cc # Display C compiler invocations + --help(-h) # Print help and exit + --test-filter: text # Skip tests that do not match any filter + --test-name-prefix: text # Add prefix to all tests + --test-cmd: text # Specify test execution command one arg at a time + --test-no-exec # Compiles test binary without running it +] where { + overrides [-fincremental -fno-incremental] + overrides [-fllvm -fno-llvm] + overrides [-flto -fno-lto] + overrides [-fPIC -fno-PIC] + overrides [-fstrip -fno-strip] + overrides [-fsingle-threaded -fno-single-threaded] + overrides [-fsanitize-thread -fno-sanitize-thread] + overrides [-fvalgrind -fno-valgrind] + overrides [-femit-bin -fno-emit-bin] + terminal [--help] +} + # Create object for unit testing -export extern "zig test-obj" [] +export complete [zig test-obj] profile single-dash-v1 [ + ...files: path # Files containing tests + -O: words [Debug: "safety on, fast compile" ReleaseSafe: "optimizations + safety" ReleaseFast: "optimizations, no safety" ReleaseSmall: "optimize for size"] # Choose what to optimize for + -target: by "nu-complete zig targets" # <arch><sub>-<os>-<abi>, see `zig targets` + -mcpu: text # Specify target CPU and feature set + -ofmt: words [elf c wasm coff macho spirv plan9 hex raw] # Override target object format + --name: text # Compilation unit name (not a file path) + -femit-bin?: path # (default) Output machine code + -fno-emit-bin # Do not output machine code + -femit-asm?: path # Output .s (assembly code) + -femit-llvm-ir?: path # Produce a .ll file with optimized LLVM IR + -femit-h?: path # Generate a C header file (.h) + -femit-docs?: dir # Create a docs/ dir with html documentation + --color: words [auto off on] # Enable or disable colored error messages + -fincremental # Enable incremental compilation + -fno-incremental # Disable incremental compilation + --cache-dir: dir # Override the local cache directory + --global-cache-dir: dir # Override the global cache directory + --zig-lib-dir: dir # Override path to Zig installation lib directory + -fllvm # Force using LLVM as the codegen backend + -fno-llvm # Prevent using LLVM as the codegen backend + -flto # Force-enable Link Time Optimization + -fno-lto # Force-disable Link Time Optimization + -fPIC # Force-enable Position Independent Code + -fno-PIC # Force-disable Position Independent Code + -fstrip # Omit debug symbols + -fno-strip # Keep debug symbols + -fsingle-threaded # Code assumes there is only one thread + -fno-single-threaded # Code may not assume there is only one thread + -fsanitize-thread # Enable Thread Sanitizer + -fno-sanitize-thread # Disable Thread Sanitizer + -fvalgrind # Include valgrind client requests in release builds + -fno-valgrind # Omit valgrind client requests in debug builds + -lc # Link against system libc + -lc++ # Link against libc++ + -isystem: dir # Add directory to SYSTEM include search path + -idirafter: dir # Add directory to AFTER include search path + -L: dir # Add a directory to the library search path + -rpath: dir # Add directory to the runtime library search path + --sysroot: dir # Set the system root directory + --libc: path # Provide a file which specifies libc paths + --dynamic-linker: path # Set the dynamic interpreter path + --script: path # Use a custom linker script + -x: words [zig c c++ assembler assembler-with-cpp] # Treat subsequent input files as having type <language> + --error-limit: text # Set the maximum amount of distinct error values + -j: text # Limit concurrent jobs + --verbose-link # Display linker invocations + --verbose-cc # Display C compiler invocations + --help(-h) # Print help and exit + --test-filter: text # Skip tests that do not match any filter +] where { + overrides [-fincremental -fno-incremental] + overrides [-fllvm -fno-llvm] + overrides [-flto -fno-lto] + overrides [-fPIC -fno-PIC] + overrides [-fstrip -fno-strip] + overrides [-fsingle-threaded -fno-single-threaded] + overrides [-fsanitize-thread -fno-sanitize-thread] + overrides [-fvalgrind -fno-valgrind] + overrides [-femit-bin -fno-emit-bin] + terminal [--help] +} + # Create executable and run immediately -export extern "zig run" [] -# Look for simple compile errors in any set of files -export extern "zig ast-check" [] -# Reformat Zig source into canonical form -export extern "zig fmt" [] -# Minimize a bug report -export extern "zig reduce" [] +export complete [zig run] profile single-dash-v1 [ + ...files: path # Source files (arguments after `--` go to the program) + -O: words [Debug: "safety on, fast compile" ReleaseSafe: "optimizations + safety" ReleaseFast: "optimizations, no safety" ReleaseSmall: "optimize for size"] # Choose what to optimize for + -target: by "nu-complete zig targets" # <arch><sub>-<os>-<abi>, see `zig targets` + -mcpu: text # Specify target CPU and feature set + -ofmt: words [elf c wasm coff macho spirv plan9 hex raw] # Override target object format + --name: text # Compilation unit name (not a file path) + -femit-bin?: path # (default) Output machine code + -fno-emit-bin # Do not output machine code + -femit-asm?: path # Output .s (assembly code) + -femit-llvm-ir?: path # Produce a .ll file with optimized LLVM IR + -femit-h?: path # Generate a C header file (.h) + -femit-docs?: dir # Create a docs/ dir with html documentation + --color: words [auto off on] # Enable or disable colored error messages + -fincremental # Enable incremental compilation + -fno-incremental # Disable incremental compilation + --cache-dir: dir # Override the local cache directory + --global-cache-dir: dir # Override the global cache directory + --zig-lib-dir: dir # Override path to Zig installation lib directory + -fllvm # Force using LLVM as the codegen backend + -fno-llvm # Prevent using LLVM as the codegen backend + -flto # Force-enable Link Time Optimization + -fno-lto # Force-disable Link Time Optimization + -fPIC # Force-enable Position Independent Code + -fno-PIC # Force-disable Position Independent Code + -fstrip # Omit debug symbols + -fno-strip # Keep debug symbols + -fsingle-threaded # Code assumes there is only one thread + -fno-single-threaded # Code may not assume there is only one thread + -fsanitize-thread # Enable Thread Sanitizer + -fno-sanitize-thread # Disable Thread Sanitizer + -fvalgrind # Include valgrind client requests in release builds + -fno-valgrind # Omit valgrind client requests in debug builds + -lc # Link against system libc + -lc++ # Link against libc++ + -isystem: dir # Add directory to SYSTEM include search path + -idirafter: dir # Add directory to AFTER include search path + -L: dir # Add a directory to the library search path + -rpath: dir # Add directory to the runtime library search path + --sysroot: dir # Set the system root directory + --libc: path # Provide a file which specifies libc paths + --dynamic-linker: path # Set the dynamic interpreter path + --script: path # Use a custom linker script + -x: words [zig c c++ assembler assembler-with-cpp] # Treat subsequent input files as having type <language> + --error-limit: text # Set the maximum amount of distinct error values + -j: text # Limit concurrent jobs + --verbose-link # Display linker invocations + --verbose-cc # Display C compiler invocations + --help(-h) # Print help and exit +] where { + overrides [-fincremental -fno-incremental] + overrides [-fllvm -fno-llvm] + overrides [-flto -fno-lto] + overrides [-fPIC -fno-PIC] + overrides [-fstrip -fno-strip] + overrides [-fsingle-threaded -fno-single-threaded] + overrides [-fsanitize-thread -fno-sanitize-thread] + overrides [-fvalgrind -fno-valgrind] + overrides [-femit-bin -fno-emit-bin] + terminal [--help] +} + # Convert C code to Zig code -export extern "zig translate-c" [] -# Use Zig as a drop-in archiver -export extern "zig ar" [] +export complete [zig translate-c] profile single-dash-v1 [ + file: path # The C header or source file + -O: words [Debug: "safety on, fast compile" ReleaseSafe: "optimizations + safety" ReleaseFast: "optimizations, no safety" ReleaseSmall: "optimize for size"] # Choose what to optimize for + -target: by "nu-complete zig targets" # <arch><sub>-<os>-<abi>, see `zig targets` + -mcpu: text # Specify target CPU and feature set + -ofmt: words [elf c wasm coff macho spirv plan9 hex raw] # Override target object format + --name: text # Compilation unit name (not a file path) + -femit-bin?: path # (default) Output machine code + -fno-emit-bin # Do not output machine code + -femit-asm?: path # Output .s (assembly code) + -femit-llvm-ir?: path # Produce a .ll file with optimized LLVM IR + -femit-h?: path # Generate a C header file (.h) + -femit-docs?: dir # Create a docs/ dir with html documentation + --color: words [auto off on] # Enable or disable colored error messages + -fincremental # Enable incremental compilation + -fno-incremental # Disable incremental compilation + --cache-dir: dir # Override the local cache directory + --global-cache-dir: dir # Override the global cache directory + --zig-lib-dir: dir # Override path to Zig installation lib directory + -fllvm # Force using LLVM as the codegen backend + -fno-llvm # Prevent using LLVM as the codegen backend + -flto # Force-enable Link Time Optimization + -fno-lto # Force-disable Link Time Optimization + -fPIC # Force-enable Position Independent Code + -fno-PIC # Force-disable Position Independent Code + -fstrip # Omit debug symbols + -fno-strip # Keep debug symbols + -fsingle-threaded # Code assumes there is only one thread + -fno-single-threaded # Code may not assume there is only one thread + -fsanitize-thread # Enable Thread Sanitizer + -fno-sanitize-thread # Disable Thread Sanitizer + -fvalgrind # Include valgrind client requests in release builds + -fno-valgrind # Omit valgrind client requests in debug builds + -lc # Link against system libc + -lc++ # Link against libc++ + -isystem: dir # Add directory to SYSTEM include search path + -idirafter: dir # Add directory to AFTER include search path + -L: dir # Add a directory to the library search path + -rpath: dir # Add directory to the runtime library search path + --sysroot: dir # Set the system root directory + --libc: path # Provide a file which specifies libc paths + --dynamic-linker: path # Set the dynamic interpreter path + --script: path # Use a custom linker script + -x: words [zig c c++ assembler assembler-with-cpp] # Treat subsequent input files as having type <language> + --error-limit: text # Set the maximum amount of distinct error values + -j: text # Limit concurrent jobs + --verbose-link # Display linker invocations + --verbose-cc # Display C compiler invocations + --help(-h) # Print help and exit +] where { + overrides [-fincremental -fno-incremental] + overrides [-fllvm -fno-llvm] + overrides [-flto -fno-lto] + overrides [-fPIC -fno-PIC] + overrides [-fstrip -fno-strip] + overrides [-fsingle-threaded -fno-single-threaded] + overrides [-fsanitize-thread -fno-sanitize-thread] + overrides [-fvalgrind -fno-valgrind] + overrides [-femit-bin -fno-emit-bin] + terminal [--help] +} + +# Build project from build.zig +export complete [zig build] profile single-dash-v1 [ + ...steps: by "nu-complete zig build" # Build steps (and -D<option>=<value> options) + --prefix(-p): dir # Where to install files (default: zig-out) + --prefix-lib-dir: dir # Where to install libraries + --prefix-exe-dir: dir # Where to install executables + --prefix-include-dir: dir # Where to install C header files + --release?: words [fast safe small] # Request release mode, optionally specifying a preferred optimization mode + -fdarling # Integration with system-installed Darling + -fno-darling + -fqemu # Integration with system-installed QEMU + -fno-qemu + -fwine # Integration with system-installed Wine + -fno-wine + -fincremental # Enable incremental compilation + -fno-incremental # Disable incremental compilation + --build-file: path # Override path to build.zig + --cache-dir: dir # Override path to local Zig cache directory + --global-cache-dir: dir # Override path to global Zig cache directory + --zig-lib-dir: dir # Override path to Zig lib directory + --build-runner: path # Override path to build runner + --search-prefix: dir # Add a path to look for binaries, libraries, headers + --sysroot: dir # Set the system root directory + --libc: path # Provide a file which specifies libc paths + --system: dir # Disable package fetching; use packages from this directory + --summary: words [all new failures line none] # Control the printing of the build summary + --color: words [auto off on] # Enable or disable colored error messages + --watch # Continuously rebuild when source files are modified + --fuzz # Continuously search for unit test failures + --debounce: text # Delay before rebuilding after changed file detected + --verbose # Print commands before executing them + --prominent-compile-errors # Buffer compile errors and display at end + --fetch?: words [needed all] # Fetch dependency tree and exit + --list-steps(-l) # Print available steps + --maxrss: text # Limit memory usage + -j: text # Limit concurrent jobs + --help(-h) # Print this help and exit +] where { + overrides [-fincremental -fno-incremental] + overrides [-fdarling -fno-darling] + overrides [-fqemu -fno-qemu] + overrides [-fwine -fno-wine] + at-most-one [--watch --fuzz] + requires --debounce --watch + terminal [--help --list-steps --fetch] +} + # Use Zig as a drop-in C compiler -export extern "zig cc" [] +export complete [zig cc] profile single-dash-v1 [ + ...files: path # C sources and objects (clang-compatible flags) + -target: by "nu-complete zig targets" # Target triple + -o: path # Output file + -c # Only run preprocess, compile, and assemble steps + -S # Only run preprocess and compilation steps + -E # Only run the preprocessor + -I: dir # Add directory to include search path + -L: dir # Add directory to library search path + -D: text # Define a macro + -O: words ["0" "1" "2" "3" s z] # Optimization level + -g # Generate debug information + -std: text # Language standard + -shared # Build a shared library + -static # Link statically +] where { + at-most-one [-c -S -E] + at-most-one [-shared -static] +} + # Use Zig as a drop-in C++ compiler -export extern "zig c++" [] -# Use Zig as a drop-in dlltool.exe -export extern "zig dlltool" [] -# Use Zig as a drop-in lib.exe -export extern "zig lib" [] -# Use Zig as a drop-in ranlib -export extern "zig ranlib" [] -# Use Zig as a drop-in objcopy -export extern "zig objcopy" [] -# Use Zig as a drop-in rc.exe -export extern "zig rc" [] -# Print lib path, std path, cache directory, and version -export extern "zig env" [] -# Print this help and exit -export extern "zig help" [] -# View standard library documentation in a browser -export extern "zig std" [] -# Display native libc paths file or validate one -export extern "zig libc" [] -# List available compilation targets -export extern "zig targets" [] -# Print version number and exit -export extern "zig version" [] -# Print Zen of Zig and exit -export extern "zig zen" [] +export complete [zig "c++"] profile single-dash-v1 [ + ...files: path # C++ sources and objects (clang-compatible flags) + -target: by "nu-complete zig targets" # Target triple + -o: path # Output file + -c # Only run preprocess, compile, and assemble steps + -S # Only run preprocess and compilation steps + -E # Only run the preprocessor + -I: dir # Add directory to include search path + -L: dir # Add directory to library search path + -D: text # Define a macro + -O: words ["0" "1" "2" "3" s z] # Optimization level + -g # Generate debug information + -std: text # Language standard + -shared # Build a shared library + -static # Link statically +] where { + at-most-one [-c -S -E] + at-most-one [-shared -static] +} + +export complete [zig fmt] [ + ...paths: path # Files or directories to format + --stdin # Format code from stdin; output to stdout + --check # List non-conforming files and exit with an error if the list is non-empty + --ast-check # Run zig ast-check on every file + --exclude: path # Exclude file or directory from formatting + --zon # Treat all input files as ZON, regardless of file extension + --color: words [auto off on] # Enable or disable colored error messages + --help(-h) # Print this help and exit +] where { + excludes --stdin --check + terminal [--help] +} + +export complete [zig init] [ + --minimal(-m) # Use minimal init template + --help(-h) # Print this help and exit +] where { terminal [--help] } + +export complete [zig fetch] [ + url: text # Package URL or path + --save?: text # Add the fetched package to build.zig.zon (optionally as <name>) + --save-exact?: text # Add the fetched package to build.zig.zon, storing the URL verbatim + --global-cache-dir: dir # Override path to global Zig cache directory + --debug-hash # Print verbose hash information to stdout + --help(-h) # Print this help and exit +] where { + at-most-one [--save --save-exact] + terminal [--help] +} diff --git a/custom-completions/zmx/zmx-completions.nu b/custom-completions/zmx/zmx-completions.nu index b2892e55d..c0fdc23c2 100644 --- a/custom-completions/zmx/zmx-completions.nu +++ b/custom-completions/zmx/zmx-completions.nu @@ -1,190 +1,148 @@ -# zmx - session persistence for terminal processes +# Declarative completions for zmx - session persistence for terminal processes # https://github.com/neurosnap/zmx -def "nu-complete zmx sessions" [] { - zmx list --short | lines +# Live sessions, from `zmx list --short`. +@non-destructive +export def "nu-complete zmx sessions" [] { + try { + ^zmx list --short | lines | where {|l| $l != '' } + } catch { + [] + } } -def "nu-complete zmx shells" [] { - ["bash", "zsh", "fish", "nu"] +export complete [zmx] [ + command?: words [attach: "Attach to session, creating if needed" run: "Send command without attaching" send: "Send raw input to session PTY" print: "Inject text into session display" write: "Write stdin to a file through the session" detach: "Detach all clients" list: "List active sessions" kill: "Kill session and all attached clients" history: "Output session scrollback" wait: "Wait for session tasks to complete" tail: "Follow session output" completions: "Shell completions" version: "Show version" help: "Show help message"] # The zmx subcommand + --version(-v) # Show version + --help(-h) # Show help message +] where { + terminal [--version --help] } -# Attach to session, creating if needed -export extern "zmx attach" [ - name: string@"nu-complete zmx sessions" # Session name - ...command: string # Command to run instead of a login shell +export complete [zmx attach] [ + name: by "nu-complete zmx sessions" # Session name, created if needed + ...command: command # Command to run instead of a login shell ] -# Attach to session, creating if needed -export extern "zmx a" [ - name: string@"nu-complete zmx sessions" # Session name - ...command: string # Command to run instead of a login shell +export complete [zmx a] [ + name: by "nu-complete zmx sessions" # Session name, created if needed + ...command: command # Command to run instead of a login shell ] -# Send command without attaching -export extern "zmx run" [ - name: string@"nu-complete zmx sessions" # Session name - -d # Detach from the calling terminal; use `wait` to track its status - --fish # Required when the session runs fish shell - ...command: string # Command to run +export complete [zmx run] [ + name: by "nu-complete zmx sessions" # Session name + ...command: command # Command to run + -d # Detach from the calling terminal; track it with `zmx wait` + --fish # Required when the session runs fish ] -# Send command without attaching -export extern "zmx r" [ - name: string@"nu-complete zmx sessions" # Session name - -d # Detach from the calling terminal; use `wait` to track its status - --fish # Required when the session runs fish shell - ...command: string # Command to run +export complete [zmx r] [ + name: by "nu-complete zmx sessions" # Session name + ...command: command # Command to run + -d # Detach from the calling terminal; track it with `zmx wait` + --fish # Required when the session runs fish ] -# Send raw input to session PTY -export extern "zmx send" [ - name: string@"nu-complete zmx sessions" # Session name - ...text: string # Raw text to send (no automatic carriage return) +export complete [zmx send] [ + name: by "nu-complete zmx sessions" # Session name + ...text: text # Raw text to send, without a carriage return ] -# Send raw input to session PTY -export extern "zmx s" [ - name: string@"nu-complete zmx sessions" # Session name - ...text: string # Raw text to send (no automatic carriage return) +export complete [zmx s] [ + name: by "nu-complete zmx sessions" # Session name + ...text: text # Raw text to send, without a carriage return ] -# Inject text into session display -export extern "zmx print" [ - name: string@"nu-complete zmx sessions" # Session name - ...text: string # Text to inject into the display and scrollback +export complete [zmx print] [ + name: by "nu-complete zmx sessions" # Session name + ...text: text # Text to inject into the display and scrollback ] -# Inject text into session display -export extern "zmx p" [ - name: string@"nu-complete zmx sessions" # Session name - ...text: string # Text to inject into the display and scrollback +export complete [zmx p] [ + name: by "nu-complete zmx sessions" # Session name + ...text: text # Text to inject into the display and scrollback ] -# Write stdin to file_path through the session -export extern "zmx write" [ - name: string@"nu-complete zmx sessions" # Session name - file_path: path # Destination path (absolute or relative to the session cwd) +export complete [zmx write] [ + name: by "nu-complete zmx sessions" # Session name + file_path: path # Destination, absolute or relative to the session cwd ] -# Write stdin to file_path through the session -export extern "zmx wr" [ - name: string@"nu-complete zmx sessions" # Session name - file_path: path # Destination path (absolute or relative to the session cwd) +export complete [zmx wr] [ + name: by "nu-complete zmx sessions" # Session name + file_path: path # Destination, absolute or relative to the session cwd ] -# Detach all clients (ctrl+\ for current client) -export extern "zmx detach" [] +export complete [zmx detach] [] -# Detach all clients (ctrl+\ for current client) -export extern "zmx d" [] +export complete [zmx d] [] -# List active sessions -export extern "zmx list" [ - --short # Print only session names, one per line +export complete [zmx list] [ + --short # Print only session names, one per line ] -# List active sessions -export extern "zmx l" [ - --short # Print only session names, one per line +export complete [zmx l] [ + --short # Print only session names, one per line ] -# List active sessions -export extern "zmx ls" [ - --short # Print only session names, one per line +export complete [zmx ls] [ + --short # Print only session names, one per line ] -# Kill session and all attached clients -export extern "zmx kill" [ - ...name: string@"nu-complete zmx sessions" # Session name(s) to kill - --force # Force kill +export complete [zmx kill] [ + ...name: by "nu-complete zmx sessions" # Sessions to kill + --force # Force kill ] -# Kill session and all attached clients -export extern "zmx k" [ - ...name: string@"nu-complete zmx sessions" # Session name(s) to kill - --force # Force kill +export complete [zmx k] [ + ...name: by "nu-complete zmx sessions" # Sessions to kill + --force # Force kill ] -# Output session scrollback -export extern "zmx history" [ - name: string@"nu-complete zmx sessions" # Session name - --vt # Output history with escape sequences (terminal format) - --html # Output history as HTML -] +export complete [zmx history] [ + name: by "nu-complete zmx sessions" # Session name + --vt # Output with escape sequences + --html # Output as HTML +] where { + at-most-one [--vt --html] +} -# Output session scrollback -export extern "zmx hi" [ - name: string@"nu-complete zmx sessions" # Session name - --vt # Output history with escape sequences (terminal format) - --html # Output history as HTML -] +export complete [zmx hi] [ + name: by "nu-complete zmx sessions" # Session name + --vt # Output with escape sequences + --html # Output as HTML +] where { + at-most-one [--vt --html] +} -# Wait for session tasks to complete -export extern "zmx wait" [ - ...sessions: string@"nu-complete zmx sessions" # Session name(s) to wait on +export complete [zmx wait] [ + ...sessions: by "nu-complete zmx sessions" # Sessions to wait on ] -# Wait for session tasks to complete -export extern "zmx w" [ - ...sessions: string@"nu-complete zmx sessions" # Session name(s) to wait on +export complete [zmx w] [ + ...sessions: by "nu-complete zmx sessions" # Sessions to wait on ] -# Follow session output -export extern "zmx tail" [ - ...sessions: string@"nu-complete zmx sessions" # Session name(s) to follow +export complete [zmx tail] [ + ...sessions: by "nu-complete zmx sessions" # Sessions to follow ] -# Follow session output -export extern "zmx t" [ - ...sessions: string@"nu-complete zmx sessions" # Session name(s) to follow +export complete [zmx t] [ + ...sessions: by "nu-complete zmx sessions" # Sessions to follow ] -# Shell completions (bash, zsh, fish, nu) -export extern "zmx completions" [ - shell: string@"nu-complete zmx shells" # Shell to generate completions for +export complete [zmx completions] [ + shell: words [bash zsh fish nu] # Shell to generate completions for ] -# Shell completions (bash, zsh, fish, nu) -export extern "zmx c" [ - shell: string@"nu-complete zmx shells" # Shell to generate completions for +export complete [zmx c] [ + shell: words [bash zsh fish nu] # Shell to generate completions for ] -# Show version -export extern "zmx version" [] +export complete [zmx version] [] -# Show version -export extern "zmx v" [] +export complete [zmx v] [] -# Show help message -export extern "zmx help" [] +export complete [zmx help] [] -# Show help message -export extern "zmx h" [] - -def "nu-complete zmx commands" [] { - [ - [value description]; - [attach "Attach to session, creating if needed"] - [run "Send command without attaching"] - [send "Send raw input to session PTY"] - [print "Inject text into session display"] - [write "Write stdin to file_path through the session"] - [detach "Detach all clients (ctrl+\\ for current client)"] - [list "List active sessions"] - [kill "Kill session and all attached clients"] - [history "Output session scrollback"] - [wait "Wait for session tasks to complete"] - [tail "Follow session output"] - [completions "Shell completions (bash, zsh, fish, nu)"] - [version "Show version"] - [help "Show help message"] - ] -} - -# session persistence for terminal processes -export extern "zmx" [ - command?: string@"nu-complete zmx commands" # The zmx subcommand to run - --version(-v) # Show version - --help(-h) # Show help message -] +export complete [zmx h] [] diff --git a/custom-completions/zoxide/zoxide-completions.nu b/custom-completions/zoxide/zoxide-completions.nu index 44af59140..2cbe8a6c2 100644 --- a/custom-completions/zoxide/zoxide-completions.nu +++ b/custom-completions/zoxide/zoxide-completions.nu @@ -1,53 +1,102 @@ -def "nu-complete zoxide import" [] { - ["autojump", "z"] +# Declarative completions for zoxide (0.10). +# +# `zoxide-dirs` stays a user-facing command; the providers below reuse it. + +# The directories zoxide knows, best first: `path` and its frecency `score`. Reads only. +@non-destructive +@example "The five highest-ranked directories" { zoxide-dirs | first 5 | get path } +@example "Directories with a score above 100" { zoxide-dirs | where score > 100 } +export def zoxide-dirs []: nothing -> table<score: float, path: string> { + ^zoxide query --list --score + | lines + | parse --regex '^\s*(?<score>[\d.]+)\s+(?<path>.+)$' + | update score { into float } +} + +# Directories in the database, described by their frecency score. +@non-destructive +export def "nu-complete zoxide dirs" [] { + try { + zoxide-dirs | each {|d| {value: $d.path, description: $"score ($d.score)"} } + } catch { + [] + } } -def "nu-complete zoxide shells" [] { - ["bash", "elvish", "fish", "nushell", "posix", "powershell", "xonsh", "zsh"] +export complete [zoxide] [ + --help(-h) # Print help + --version(-V) # Print version +] where { + terminal [--help --version] } -def "nu-complete zoxide hooks" [] { - ["none", "prompt", "pwd"] +export complete [zoxide add] [ + ...paths: dir # Directories to add or bump + --score(-s): text # Rank to increment by, or to start with + --help(-h) # Print help +] where { + terminal [--help] } -# Add a new directory or increment its rank -export extern "zoxide add" [ - ...paths: path +export complete [zoxide edit] [ + --help(-h) # Print help +] + +export complete [zoxide import] [ + --merge # Merge into the existing database + --help(-h) # Print help +] + +export complete [zoxide import atuin] [ + --merge # Merge into the existing database ] -# Edit the database -export extern "zoxide edit" [ ] +export complete [zoxide import autojump] [ + --merge # Merge into the existing database +] -# Import entries from another application -export extern "zoxide import" [ - --from: string@"nu-complete zoxide import" # Application to import from - --merge # Merge into existing database +export complete [zoxide import fasd] [ + --merge # Merge into the existing database ] -# Generate shell configuration -export extern "zoxide init" [ - shell: string@"nu-complete zoxide shells" - --no-cmd # Prevents zoxide from defining the `z` and `zi` commands - --cmd: string # Changes the prefix of the `z` and `zi` commands [default: z] - --hook: string@"nu-complete zoxide hooks" # Changes how often zoxide increments a directory's score [default: pwd] +export complete [zoxide import z] [ + --merge # Merge into the existing database ] -# Search for a directory in the database -export extern "zoxide query" [ - ...keywords: string - --all(-a) # Show unavailable directories - --interactive(-i) # Use interactive selection - --list(-l) # List all matching directories - --score(-s) # Print score with results - --exclude: path # Exclude the current directory +export complete [zoxide import z.lua] [ + --merge # Merge into the existing database ] -# Remove a directory from the database -export extern "zoxide remove" [ - ...paths: path +export complete [zoxide import zsh-z] [ + --merge # Merge into the existing database ] -export extern zoxide [ - --help(-h) # Print help - --version(-V) # Print version +export complete [zoxide init] [ + shell: words [bash elvish fish nushell posix powershell tcsh xonsh zsh] # Shell to configure + --no-cmd # Do not define the `z` and `zi` commands + --cmd: text # Prefix of the `z` and `zi` commands (default z) + --hook: words [none: "Never bump scores" prompt: "Bump on every prompt" pwd: "Bump on directory change (default)"] # When to increment a directory's score + --help(-h) # Print help +] where { + excludes --no-cmd --cmd + terminal [--help] +} + +export complete [zoxide query] [ + ...keywords: by "nu-complete zoxide dirs" # Keywords to match + --all(-a) # Show unavailable directories + --interactive(-i) # Use interactive selection + --list(-l) # List all matching directories + --score(-s) # Print the score with results + --exclude: dir # Exclude this directory + --base-dir: dir # Only search within this directory + --help(-h) # Print help +] where { + at-most-one [--interactive --list] + terminal [--help] +} + +export complete [zoxide remove] [ + ...paths: by "nu-complete zoxide dirs" # Directories to remove + --help(-h) # Print help ]