- 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>
update:
- cwdhist: openeditor changed from alt+e to alt+o
- docker: pull, push add nerdctl insecure-registry support
- docker: registry show use curl instead http get (may cause dns
resolution problems)
- git: status `table -n` changed to `table -i`
new module: comma
Similar to `pwd-module`, but supports completion and description through
custom data formats
- `,` or `*` need to be exported in order to use `,` directly
- Directly execute `,` to create a new template file or edit an existing
file
- Custom tasks are written in `$env.comma` and can be nested
- Generate completions based on the structure of `$env.comma`
- You can use closure to customize completion
- In `$env.commax.act` of default closure, you can receive parameters
after the current position
- In `$env.commax.cmp` , you can receive the parameter before the
current position
---------
Co-authored-by: nash <nash@iffy.me>
- update `kadm check` and `kadm renew`
- refactor `nu-complete kube pods or deploys` to `nu-complete kube
deploys and pods`
in #680, `nu-complete kube pods` changed to `pods or deploys`, This has
caused some problems:
- double the number of candidates, and candidates with prefix `pods/`
and `deployment.apps/`, looks a little confused
- two requests in one completion, slower
i wrote `nu-complete kube deploys and pods`, it's completed in two
stages
- first it will complete the `deployment` and add a suffix `-` when
token not ends-with `-`
- when `ka` or `kl` accepts an argument with suffix `-`, it'll be
rewritten as `$"deployment/($pod | str substring ..-1)"`
- if token ends-with `-`, it's considered unfinished `pod` and continues
---------
Co-authored-by: nash <nash@iffy.me>
- imports `*` are unnecessary
- shorter names for easier reference in task scripts
- `cmd` is too common and may cause potential conflicts
Co-authored-by: nash <nash@iffy.me>
* 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>
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>
* 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>
* 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>
* 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>
* 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>
* refactor: ✨ move in one commit
Eveything in modules should probably be changed to `exported` defs.
The idea is to move everything first to keep proper history.
* refactor: 📝 add modules readme (wip)
* refactor: ✨ small move
* refactor: 📝 changed nestring, updated modules readme
* refactor: 📝 to document or not to document
* fix: 🐛 themes
replaced the template to use `main` and regenerated them
from lemnos themes.
* Revert "fix: 🐛 themes"
This reverts commit 4918d3633c8d2d81950a0ed0cfd9eb84241bc886.
* refactor: ✨ introduce sourced
- Created a source `root` in which sourcable demos are stored.
Some might get converted to modules later on.
- Moved some files to bin too.
* fix: 🐛 fehbg.nu
* fix: 🐛 modules/after.nu
* moved some other stuff around
---------
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>