nu_scripts/modules
fj0r f39976902a
kube refine for backup (#793)
- new function `kube refine`
- define the required information in `$env.KUBERNETES_REFINE`, `kube
refine` will collect information according to its definition
- definitions in `status` and `cluster_status` are runtime information
and will not be collected. They are used in the `kg` command to display
status
- normalize the output of the `kg`, `kgp`, `kgs` command using `krefine`

- rename `kcconf` to `kccc` (kubectl change context clone)

- a new module, `refine.nu`, declaratively extracts data from complex
structures.

- `container-list` additionally displays the cmd field of the image

---------

Co-authored-by: nash <nash@iffy.me>
2024-03-30 07:14:45 -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 background_task: Fix quoted commands and fix deprecation of implicit spreading and clarify docs (#752) 2024-02-05 06:28:48 -06:00
base16 🐛 fix more parser errors (#783) 2024-03-15 21:10:27 -05:00
clone-all clone all script (#781) 2024-03-10 07:11:37 -05:00
coloring fix: fix default fg and bg coloring for hl.nu (#537) 2023-06-25 06:39:53 -05: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
filesystem Using def --env instead of def-env (#673) 2023-11-20 06:55:35 -06:00
fnm Use Existing Path Env Var for FNM (#632) 2023-10-07 16:25:15 +02:00
formats 🐛 fix more parser errors (#783) 2024-03-15 21:10:27 -05:00
fun fix removed commands (#645) 2023-10-19 19:35:23 +02:00
git kube refine for backup (#793) 2024-03-30 07:14:45 -05:00
gitv2 kube refine for backup (#793) 2024-03-30 07:14:45 -05:00
kubernetes kube refine for backup (#793) 2024-03-30 07:14:45 -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
maths Add cartesian product to math module (#624) 2023-09-30 09:46:04 -05:00
network kube refine for backup (#793) 2024-03-30 07:14:45 -05:00
nix init nix scripts (#584) 2023-08-23 14:01:50 -05:00
nvim kube refine for backup (#793) 2024-03-30 07:14:45 -05:00
prompt update jalon-git.nu to latest nushell syntax (#748) 2024-01-25 11:47:11 -06: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 Adds Modules/recursion : Examples of Fun with Recursive functions in Nu (#717) 2023-12-27 13:04:52 -06: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 Add Micromamba support (#800) 2024-03-26 13:47:45 -05:00
wc Add gnu wc wrapper (#625) 2023-09-30 17:14:19 -05:00
weather 🐛 fix a couple of parser errors (#782) 2024-03-10 14:05:01 -05:00
README.md fix broken links in modules readme (#718) 2023-12-25 08:08:15 -06: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 seperated 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

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