1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-31 14:17:45 +00:00
Commit graph

204 commits

Author SHA1 Message Date
Antoine Sébert
45c051dad0
Add dfr before into df and into nu (#585)
It seems that the file is slightly out-of-date.
2023-08-24 06:11:39 -05:00
Chris Dawkins
745896c85a
init nix scripts (#584)
Commands for working with nix package manager.
2023-08-23 14:01:50 -05:00
fj0r
e5cf9b15ae
Upgraded to 0.84 (#583)
`gig` for editing .gitignore
export aliases of `docker.nu`
implement `kdh` without helm-diff installed

Co-authored-by: agent <agent@nuc>
2023-08-23 06:23:14 -05:00
Darren Schroeder
459b8c9d4f
fix the other place (#581) 2023-08-18 12:45:18 -05:00
Darren Schroeder
ce2b66b2d0
fix weather duration after latest nushell changes (#580) 2023-08-18 12:40:18 -05:00
Darren Schroeder
8e086d8771
update prompts scripts with new str replace syntax (#579) 2023-08-17 18:10:20 -05:00
WindSoilder
dd499c916f
Update python-venv.nu so we can enter subdirectory without an error (#574) 2023-08-14 14:00:52 -05:00
Neur1n
e60d20733e
minor changes to nu_conda.nu and nu_msvs.nu (#576)
1. feat(nu_conda): add `nu_conda list` to list available envs
2. fix: use `print` instead of `echo` to print warnings
3. doc: change minimum support version to 0.83.0
2023-08-12 07:24:55 -05:00
Emily Grace Seville
90a8b0d96b
Simple json schema generator (#577)
* feat(script): add json schema generator

* feat(readme): add

* fix(script): use right merge operator
2023-08-12 07:17:33 -05:00
Antoine Stevan
be47e43db6
rename date format to format date (#571) 2023-08-04 09:08:10 -05:00
Darren Schroeder
1d8457fa9d
update date format to format date in oh-my.nu (#570) 2023-08-03 14:16:13 -05:00
Kuo-tung Kao
3ee56c6ec3
Add descriptions for the docker module. (#549)
* Add descriptions for the docker module.

* Update
2023-07-29 07:57:14 -05:00
fj0r
c1b68089ab
upgrade 0.83 (#563)
fix `<duration> | into string`
`gn` allows init git repo in current directory, and use `main` as
default branch

Co-authored-by: agent <agent@nuc>
2023-07-26 06:46:23 -05:00
Jalon Wong
1a03f02dfd
Add a git prompt (#555)
* Add a git prompt

* Amend README
2023-07-19 06:24:54 -05:00
fj0r
b06dfb664e
ssh complete cache use whitelist (ignore known_hosts and keys) (#553)
docker run add -p(privileged) option
    nvc nvdc for neovim remote-ui

Co-authored-by: agent <agent@nuc>
2023-07-15 06:57:23 -05:00
Darren Schroeder
3fa732f1e2
fix error background (#551) 2023-07-14 07:52:36 -05:00
Maxim Uvarov
e271caf044
conda fix (#547) 2023-07-10 07:18:22 +02:00
Antoine Stevan
a61256da0e
use $env. instead of let-env (#543)
related to nushell/nushell#9574

Commands used
```nushell
sd --string-mode "let-env " '$env.' **/*
git rst before_v0.60/
```
2023-07-01 10:40:16 +02:00
Bob Hyman
6816f491eb
full line v2; with git status! (#542) 2023-06-30 06:26:20 -05:00
fj0r
ab0d3aaad0
upgrade to 0.82 (#539)
Co-authored-by: agent <agent@nuc>
2023-06-27 21:11:03 -05:00
Neur1n
a2f82bd987
fix: fix default fg and bg coloring for hl.nu (#537) 2023-06-25 06:39:53 -05:00
Tilen Gimpelj
9e62390ec1
added Brace exspansion module (#535)
* updated readme

* added the expand module

* change from --help to -h due to a bug

* changed expand to main, to self reference

* updated wrong output
2023-06-23 15:06:25 -05:00
Hörmet Yiltiz
1c19087afd
Convenience wrapper for venv creation (#514)
* auto-venv python passes syntax checks

* update readme.md

* everything works!

* convenience wrapper for venv creation

* respond to feedback and (try to) be cross-platform compatible

* use external command
2023-06-17 09:25:30 +02:00
fj0r
039930b4e4
parse name of positional args in parse cmd (#527)
* parse name of positional args in `parse cmd`

* Fix the problem that git stashes cannot be parsed correctly

* Fix parsing failure not in git directory

---------

Co-authored-by: agent <agent@nuc>
2023-06-09 07:58:24 -05:00
fj0r
09f6d2a473
kubernetes: fix -n in completion context (#523)
Co-authored-by: agent <agent@nuc>
2023-06-05 06:58:57 -05:00
fj0r
140f556049
more precise parsing of cmd through the information in nu.scope.commands (#522)
- refactor `after` to `after`, `before`
- `gp` support `back-to-prev` for merging scenes
- `ka`, `ke`, `kep`, `ked`, `kes` supports labels selector

Co-authored-by: agent <agent@nuc>
2023-06-04 21:17:28 -05:00
fj0r
ab881a61d5
kubernetes: normalize-column-names (#518)
The column names are uppercase and spaces by default, which is inconvenient for subsequent operations and converted to lowercase and underscores

Co-authored-by: agent <agent@nuc>
2023-05-31 06:28:25 -05:00
fj0r
4a1b4c73c2
update docker, git-v2, kubernetes (#517)
- fix `dr -v`
- `gs` split into `gs` and `gst` (stash)
- `gb` add `remote` parameter
- `gn` for clone, init
- tweak `gp`, more complete condition of branches
- `gc` message as positional parameters
- `gm` split into `gm` and `gr` (rebase)
- `gm` default squash with commit
- `gr`(reset) rename to `grs`
- `gr -c` remove `-x`
- `grmt` rename to `grm`
- `gsq` rename to `ggc`
- `kah` allow `--set-json`
- `kh` using conventions instead of arguments
- `kconf import` update existing key
- `ka` (attach) support selector and interactive

Co-authored-by: agent <agent@nuc>
2023-05-30 20:55:03 -05:00
Tilen Gimpelj
80e9d07d80
bm fix to add Windows support (#516)
* fix to add Windows support

* added ()
2023-05-26 16:31:56 -05:00
Hörmet Yiltiz
272b7e2b93
auto-venv for python: update to be compatible with nu 0.80 (#513)
* auto-venv python passes syntax checks

* update readme.md

* everything works!
2023-05-26 13:31:10 -05:00
Tilen Gimpelj
4b82839c90
Added missing ? (#511) 2023-05-26 08:25:15 -05:00
Tilen Gimpelj
7df415984f
Added bookmark module (#509)
* initial commit

* updated (module) README to include `bm` and removed missing `cdpath` and `up`

* added comments to commands

* removed missing function

* updated to use `XDG_DATA_HOME`

* added remove command

* updated def and def-env commands

* updated change_prev to use list

* updated README to have some info on use

* updated `get_path` to search `BM_PATH` > `XDG_DATA_HOME` > `~/.local/share`

* Updated to use relative paths, added `save_path` function

* added `main` with general information.

* Updated help text to give more information.

* Added Win support

* Added if dir doesn't exist, it creates it
2023-05-26 07:52:43 -05:00
fj0r
ebc16108fb
refactor: introduce spr and sprb for spread (#504)
* refactor: introduce `spr` and `sprb` for spread

- eliminate `if ($n|is-empty) { [] } else { [-n $n] }` pattern

- `gp -u` can omit branch
- delete `grb`
- improve the premise in the description

* commands for helm as `kxh`

- add `(kustomize)` to description of kxk
- add commands for helm
    - kgh
    - kdh
    - kah
    - kdelh
    - kh
- add `nu-complete kube port` of `kpf`
- add `--local` flag for `kpf`

---------

Co-authored-by: agent <agent@nuc>
2023-05-18 06:42:27 -05:00
fj0r
524f633531
merge ktpa into ktp(-a), rename ktn to ktno (#497)
* merge ktpa into ktp(-a), rename ktn to ktno

* Add a short description to `kgpw`

* kgp support `-a`

---------

Co-authored-by: agent <agent@nuc>
2023-05-17 06:12:48 -05:00
fj0r
08b7ccf84e
refactor git-v2#agree with input list (#496)
Co-authored-by: agent <agent@nuc>
2023-05-16 21:05:57 -05:00
fj0r
b6ecfe3680
Experimental multi-taskrunner support for jx (npm for example) (#492)
* Experimental multi-task runner support for `jx` (npm for example)

- Remove `nu-complete` export for debugging.
- Formatting `nu-complete just recipes`

* Use `jx` to override `j`.

Only for `just`, it only adds a prefix when completing, and does not break the original workflow

* `nu-complete just recipes` append empty string

When all the completions are `just xxx`, there is only `just` in the menu, press `C-w` to delete backwards to work.

* kgp takes `-o default` by default

move just to just/just.nu

* `gp` uses `git pull` instead of `git fetch` by default, and there is only one request when `push` is not needed

* add kgpw for `kubectl get pods --watch`

adjust `gm` to make it clearer

* remove just.nu

---------

Co-authored-by: agent <agent@nuc>
2023-05-16 20:07:08 -05:00
Emily Grace Seville
f86a060c10
Fix: remaining aliases (#495)
* fix(alias): exa

- reformat

* feat(alias): aws

- fix errors

* fix(aliases): clean-up

- create universal README
- remove redundant files
- rename modules

* fix(aliases): aws

- move to modules/
2023-05-16 08:56:31 -05:00
Emily Grace Seville
d2f424e605
feat(module): add random-list (#488)
* feat(module): add random-list

* feat(module): use options more often

* feat(module): prettify errors
2023-05-14 08:01:22 -05:00
fj0r
194eb30dc7
gp: run git fetch before git push or git pull (#490)
* gp: run `git fetch` before `git push` or `git pull`

* remove useless else

---------

Co-authored-by: nash <nash@iffy.me>
2023-05-14 07:58:02 -05:00
fj0r
632a62f035
kubernetes completion of jsonpath (#487)
* nu-complete kube jsonpath

The behavior is correct, but the completion menu cannot be displayed

* jsonpath completion for list

* New nushell-style git.nu

Original renamed to git-classic.nu

See `git.md` for details

* rename git.md to README.md

* Move the helper function to the back

* revert power_kube ensure-cache

* A more precise description of `gp`

* description of behavior that both ahead and behind exist

* clean up redundant alias

git show can use gl <hash> instead (hash can be completed)

* add description of `gl`

* add description of gp, ga, gd's parameter

* typo: gpc to gcp

* description of `gp --override`

* rename git.nu to git-v2.nu and git_classic.nu to git.nu

* `git fetch` as fallback of `gp` and temporarily disable `gstat`

temporarily disable `gstat` in `power_git` because:

- `gstat` is not much faster than nushell's implementation of `git_status`
- Sometimes the information displayed is inaccurate, but `git_status` parses the output of `git`, which is more reliable
- No need to load additional plugins

---------

Co-authored-by: agent <agent@nuc>
Co-authored-by: nash <nash@iffy.me>
2023-05-13 10:59:30 -05:00
fj0r
58a05e91da
clean up kubernetes.nu (#486)
* add the original kubectl command as description of abbreviation

* replace nu-complete kube pods, services, deployments with `res via name`

* kg support --jsonpath

* kgp, kgs, kgd support --jsonpath

* refactor kep, kdp, kgd, kdels

* kg support --selector

* kg support --wide

- remove kgpl
- kgp, kgd support --selector

* kg support --watch and rename wide to verbose

- remove kgpa (kg pod -A)
- remove kgpw (kg pod -w)

* add kind in output of `kg -v`

used with multiple types such as `kg pod,svc -v`

---------

Co-authored-by: agent <agent@nuc>
2023-05-12 06:16:07 -05:00
fj0r
2d6f32657a
improve kconf import (#481)
* improve kconf import

The order of fields loaded via `from yaml` is unstable, so use yq to
read it as json, and then load it by `from json`.

Aims to be `diff` friendly.

Remove the square brackets from the week field and use color to
distinguish it, taking up less space.

* kube_stat shows $ctx.NAME instead of complex combination of $ctx.AUTHINFO and $ctx.CLUSTER

- Improve the default theme of kube_stat.
- Clean up duplicate comments in `kubernetes.nu`.

* when power's DECORATOR mode is `power`, allows to dynamically change the background color

- components now needs to return two values in an array, the first value is the background color, and the second value is the original value.
- as an example, `atuin_stat` reveal its status with two different colors instead of showing or hiding

* allowing pass `config` when register or inject a component

The main difference between `config` and `theme` is: theme assumes you pass a color and will apply with `ansi -e {fg : $arg}`

And in most cases, you don't need to pass `config`

* added new function `power set`

time_segment allows format control via option `short`

* rename `nu-complete kube def` to `nu-complete kube kind`

- get all resources via `kubectl api-resources`
- enable cache

* use `from yaml` instead of `yq -o=json | from json` (for next version)

* nu-complete kube kind: add SHORTNAMES as description

* Fix the caching mechanism of `kube ctx` and `kube kind`

based on the number of file lines instead of modification time.

Because switching the context will change the content of the file, the time will be updated every time

* Added new command `kcache flush` to rebuild the cache.

Sometimes, such as manually editing the cluster address in the
configuration file, the number of lines has not changed, and the cache
does need to be refreshed

* use `path dirname` instead of `dirname`

* applying `ensure-cache-by-lines` in `kube_stat`

---------

Co-authored-by: agent <agent@nuc>
2023-05-11 06:37:39 -05:00
Dominik Schrempf
a3778622cd
ultimate_extractor: various fixes (#482)
- fix regex matching
  - . -> \.
  - use $ ot match end of file name
- fix naming of variables (exte -> handlers; command -> maybe_handler)
- combine suffixes with common extractors
- in case of no match, use a proper error
2023-05-10 06:17:46 -05:00
fj0r
3645bae992
rename registry list to registry show (#480)
* rename registry list to registry show

Extend its functionality, not just list tags, but also show catalog
and manifest, Depending on the number of parameters.

* date format by $theme.format

show day of the week
shortly time_segment

---------

Co-authored-by: agent <agent@nuc>
2023-05-08 06:32:14 -05:00
fj0r
5b6d20d0bd
Fix the problem that the KUBECONFIG file does not exist (#476)
Co-authored-by: agent <agent@nuc>
2023-05-03 06:57:42 -05:00
Antoine Stevan
1099c9461e
REFACTOR: unify git modules and aliases (#472)
* add aliases from `modules/git/`

* remove `git` aliases from `modules/git/`

* move the `git_` tool commands to the alias file

This is the only place these commands are used.
2023-04-30 07:23:07 -05:00
fj0r
4e07d66d06
refactor powerline script (#471)
* refactor

- new decorator type `|>` for head of left
- more convenient analysis

* try to add anlysis on component level

- get_component
- when there is only one component in left, '>>' takes precedence
- use `reduce` instead of `each & filter` (improved performance significantly)

* fix component level benchmark

* optimize git_stat

---------

Co-authored-by: nash <nash@iffy.me>
2023-04-29 08:20:29 -05:00
fj0r
c1e798aad4
optimize kube_stat with ensure-cache (#470)
refactor ensure-index to ensure-cache in:
- kubernetes.nu
- ssh.nu

Co-authored-by: nash <nash@iffy.me>
2023-04-28 12:34:35 -05:00
fj0r
cfdc7b725c
refactor left_prompt decorator logic (#469)
- added instructions for measurements
    - change NU_POWER_MODE default to `power` (in fast mode, there is still a problem with hid
eable components on the left)
    - tweaked atuin_stat theme

Co-authored-by: nash <nash@iffy.me>
2023-04-28 12:05:06 -05:00
fj0r
17103049f5
atuin (#468)
- rename `default` to `power`($env.NU_POWER_MODE, avoid misleading)
- apply `ansi -e {fg: $arg}` to theme configuration of `register` and `inject`(consistent with how it is configured in NU_POWER_SCHEMA)
- added atuin_stat

Co-authored-by: agent <agent@nuc>
2023-04-28 06:54:40 -05:00