nu_scripts/modules
Schweber 61a805eb06
nix/activation-script: update for nushell 0.95 (#890)
- remove `str trim -l -c '+' |` as it's no longer needed with nushell
0.95
- Change display of total size difference
2024-06-29 15:59:53 -05:00
..
after more precise parsing of cmd through the information in nu.scope.commands (#522) 2023-06-04 21:17:28 -05:00
argx kube refine for backup (#793) 2024-03-30 07:14:45 -05:00
aws Fix: remaining aliases (#495) 2023-05-16 08:56:31 -05:00
background_task use typos for corrections (#833) 2024-05-08 06:47:54 -05:00
base16 🐛 fix more parser errors (#783) 2024-03-15 21:10:27 -05:00
clone-all use typos for corrections (#833) 2024-05-08 06:47:54 -05:00
coloring Port before_v0.60/coloring folder (issue #221) (#836) 2024-05-13 09:53:53 -04:00
completion-generator generate completions from tree-shaped data (#683) 2023-12-01 19:44:40 -06:00
cwdhist kube refine for backup (#793) 2024-03-30 07:14:45 -05:00
data_extraction ultimate_extractor: various fixes (#482) 2023-05-10 06:17:46 -05:00
docker kube refine for backup (#793) 2024-03-30 07:14:45 -05:00
duplicates Port before_v0.60/data_extraction before_v0.60/examples before_v0.60/duplicates (#847) 2024-05-26 12:37:29 -05:00
filesystem use typos for corrections (#833) 2024-05-08 06:47:54 -05:00
fnm Use Existing Path Env Var for FNM (#632) 2023-10-07 16:25:15 +02:00
formats Add from env (#808) 2024-04-03 06:49:41 -05:00
fun Port before_v0.60/fun folder (issue #221) (#835) 2024-05-13 07:55:11 -05:00
fuzzy Port before_v0.60/fuzzy, before_v0.60/ls-mods and before_v0.60/nu_101 (#845) 2024-05-26 12:35:59 -05:00
git Port before_v0.60/math, before_v0.60/parsing and before_v0.60/git (#844) 2024-05-25 10:18:21 -05:00
gitv2 kube refine for backup (#793) 2024-03-30 07:14:45 -05:00
history-utils utils of history with sqlite (#779) 2024-04-03 06:29:45 -05:00
jc Add jc wrapper (#883) 2024-06-22 12:41:11 -05:00
kubernetes fix ka command in kubernetes module (#884) 2024-06-24 07:00:35 -05:00
language Port before_v0.60/config_management before_v0.60/language before_v0.60/prompt before_v0.60/tests (#851) 2024-05-26 12:37:01 -05:00
lg kube refine for backup (#793) 2024-03-30 07:14:45 -05:00
log 🐛 fix a couple of parser errors (#782) 2024-03-10 14:05:01 -05:00
ls_mods Port before_v0.60/fuzzy, before_v0.60/ls-mods and before_v0.60/nu_101 (#845) 2024-05-26 12:35:59 -05:00
maths use typos for corrections (#833) 2024-05-08 06:47:54 -05:00
network kube refine for backup (#793) 2024-03-30 07:14:45 -05:00
nix nix/activation-script: update for nushell 0.95 (#890) 2024-06-29 15:59:53 -05:00
nvim kube refine for backup (#793) 2024-03-30 07:14:45 -05:00
parsing Port before_v0.60/math, before_v0.60/parsing and before_v0.60/git (#844) 2024-05-25 10:18:21 -05:00
prompt Rmove usage of deprecated str contains --not (#880) 2024-06-16 17:30:53 -05:00
random-list fix removed commands (#645) 2023-10-19 19:35:23 +02:00
rbenv Using def --env instead of def-env (#673) 2023-11-20 06:55:35 -06:00
recursion use typos for corrections (#833) 2024-05-08 06:47:54 -05:00
system add clip from standard library (#674) 2023-11-22 18:25:23 +01:00
to-json-schema 🐛 fix more parser errors (#783) 2024-03-15 21:10:27 -05:00
virtual_environments update vswhere location for nu_msvs (#882) 2024-06-18 09:19:02 -05:00
wc Add gnu wc wrapper (#625) 2023-09-30 17:14:19 -05:00
weather use typos for corrections (#833) 2024-05-08 06:47:54 -05:00
with_externals Port before_v0.60/with_externals and cleanup (#852) 2024-05-26 16:34:36 -05:00
lint_directories.nu Port root before_v0.60/*.nu scripts (issue #221) (#837) 2024-05-13 09:54:10 -04:00
maintainer_time.nu Port root before_v0.60/*.nu scripts (issue #221) (#837) 2024-05-13 09:54:10 -04:00
make_readme_table.nu Port root before_v0.60/*.nu scripts (issue #221) (#837) 2024-05-13 09:54:10 -04:00
README.md Add jc wrapper (#883) 2024-06-22 12:41:11 -05:00

Modules

after

Run a function after the given program (by PID)

api_wrappers

Demo of various API wrappers:

background_task

make nushell "support" background task feature. see README

base16

Base16 theme generator (for Linux, might work for other OS) see README

coloring

These scripts are used to demonstrate the ansi command using ansi coloring. This is mainly a demo area where we have taken typical bash scripts and ported them to nushell scripts. It would be nice if all scripts here showed the "other" version of script and the ported nushell version. We can show "other" flavors of scripts by including them as comments in the nushell scripts or by naming the nushell script and the other script the same basename.

data_extraction

  • Ultimate Extractor - Extract any compressed archive, UE will call the proper program under the hood 😎

docker

An extensive example of a wrapper for docker operations, with nushell completions.

filesystem

  • bm - A Simple bookmarking module. It uses XGD_DATA_HOME to save bookmarks.
  • expand - expansion module that implements bashes brace expansion. The expansion uses a list inside of braces separated by , to expand into a list of multiple string variations like:
 expand a/{b,c}/d{e,f,g}.nu{,on}

parses into:

╭────┬─────────────╮
│  0 │ a/b/de.nu   │
│  1 │ a/c/de.nu   │
│  2 │ a/b/df.nu   │
│  3 │ a/c/df.nu   │
│  4 │ a/b/dg.nu   │
│  5 │ a/c/dg.nu   │
│  6 │ a/b/de.nuon │
│  7 │ a/c/de.nuon │
│  8 │ a/b/df.nuon │
│  9 │ a/c/df.nuon │
│ 10 │ a/b/dg.nuon │
│ 11 │ a/c/dg.nuon │
╰────┴─────────────╯

formats

Examples of input/output formatters:

fun

  • spark - send an array into spark and get a sparkline out:
    > let v = [2, 250, 670, 890, 2, 430, 11, 908, 123, 57]
    > spark $v
    ▁▂▆▇▁▄▁█▁▁
    
  • website-builder - converts markdown into their equivalent html pages
  • wordle - A Terminal Wordle game. The code is based on this gist, but slightly personalized.

github

  • branch-protections - Do you have hundreds or thousands of GitHub repositories in your organization? Are you tired of manually managing their branch protection rules? Don't! Let nushell do it for you! see README
  • merged-branches - Do your developers often forget to delete their branches after merging PRs? Are you tired of manually going into every repository and deleting them? Don't! Let nushell do it for you! see README

gitlab

Search files on your GitLab server

jc

Converts the output of many common external commands into nushell data structures.

Example:

: jc ping -4 -c 2 google.com
╭──────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────╮
│ destination_ip       │ 216.58.209.46                                                                            │
│ data_bytes           │ 56                                                                                       │
│ pattern              │                                                                                          │
│ destination          │ google.com                                                                               │
│ duplicates           │ 0                                                                                        │
│ packets_transmitted  │ 2                                                                                        │
│ packets_received     │ 2                                                                                        │
│ packet_loss_percent  │ 0.00                                                                                     │
│ time_ms              │ 1001.00                                                                                  │
│ round_trip_ms_min    │ 3.87                                                                                     │
│ round_trip_ms_avg    │ 4.04                                                                                     │
│ round_trip_ms_max    │ 4.21                                                                                     │
│ round_trip_ms_stddev │ 0.17                                                                                     │
│                      │ ╭───┬───────┬───────────┬───────┬───────────────┬──────────┬─────┬─────────┬───────────╮ │
│ responses            │ │ # │ type  │ timestamp │ bytes │  response_ip  │ icmp_seq │ ttl │ time_ms │ duplicate │ │
│                      │ ├───┼───────┼───────────┼───────┼───────────────┼──────────┼─────┼─────────┼───────────┤ │
│                      │ │ 0 │ reply │           │    64 │ 216.58.209.46 │        1 │ 120 │    4.21 │ false     │ │
│                      │ │ 1 │ reply │           │    64 │ 216.58.209.46 │        2 │ 120 │    3.87 │ false     │ │
│                      │ ╰───┴───────┴───────────┴───────┴───────────────┴──────────┴─────┴─────────┴───────────╯ │
╰──────────────────────┴──────────────────────────────────────────────────────────────────────────────────────────╯
: (jc ping -4 -c 2 google.com).round_trip_ms_avg
6.054

For supported commands see JC parsers documentation

Installation:

  1. Install the jc command line: https://kellyjonbrazil.github.io/jc/#installation
  2. Import this module in your config.nu: import ~/.local/share/nu_scripts/modules/jc/

kubernetes

???

make_release

???

maths

  • [math_functions] - module with the following commands:
    • root - root with a custom denominator
    • croot - cube root
    • aroot - root with a custom scaler and denominator
    • delta - calculate the delta of the quadratic function
    • fact - factorial of the given number
    • q_roots - calculare roots of the quadratic function: ax^2+bx+x
    • isprime - check if integer is prime
    • primelist - list primes until given number
    • mtable - multiplication table of n till max
    • isleap - check if year is leap
    • gcd - greatest common divisor between 2 integers
    • lcm - least commoin multiple between 2 integers
    • dec2base - decimal number to custom base representation
    • scale-minmax - scale list to [a,b] interval
    • scale-minmax-table - Scale every column of a table (separately) to [a,b] interval
    • math exp - exp function

network

  • remoting - This module provide convenient way to manage multiple remote clients. see README

  • sockets - The sockets command returns a table containing information on network sockets and the processes they belong to. It is basically a join of the tables produced by the lsof command, and the nushell ps command.

    image
  • ssh wrapper that provides the following commands:

    • ssh
    • scp
    • ssh-list
    • parse-ssh-file
    • str max-length
    • ensure-index

nvim

??? (not sure how universal this is) Mix of hooks, defs and alias wrapper around neovim.

progress_bar

??? (make a module out of these scripts?) - Collection of progress bars

rbenv

??? (not sure how universal this is) This script provides minimal working rbenv setup.

record

A module to manipulate nu's record

system

Currently holds the clip command which was previously incorrectly in the standard library of Nushell.

use modules/system *  # will bring `clip` into scope

virtual_environments

The scripts in this directory activate virtual environments for Conda environments.

weather

These scripts should be used to demonstrate how get your local weather and/or weather forecasts.

webscraping

Simple scripts to demonstrate how to scrape websites in nushell. Requires query web plugin