Commit Graph

987 Commits

Author SHA1 Message Date
fj0r
0d55be71ea
kubernetes to docker-compose (#726)
- kubernetes to docker-compose
- rearrange helm related commands

Co-authored-by: nash <nash@iffy.me>
2024-01-04 08:14:53 -06:00
Bob Hyman
cc4e573a24
Show activated python VE at beginning of prompt. (#722)
By default, the script that activates a python virtual environment for
nushell blindly prepends the virtual environment name to the existing
prompt, which causes the full-line prompt to wrap.
This change shows the virtual environment name properly positioned in
the prompt line.

To activate a python virtual environment with a pretty prompt:
```nu
---------------------------------------------------------- ~ ------------------------------------------------------- |V|
> $env.VIRTUAL_ENV_DISABLE_PROMPT = true; overlay use ve/mp2/bin/activate.nu
(mp2) ------------------------------------ ~/src/rust/nushell_worktrees/main ------------------------- [main ≡] --- |.V|
> 
```
(the unobvious environment prefix is the subject of
nushell/nushell#11469)
2024-01-02 10:53:37 -06:00
fj0r
9b7c1772e2
comma test runner (#715)
- Stabilized the format
- Test suit runner
- Support batch mode
- Watch supports postpone
- `settings.theme`
- docker.nu Simplify process-list logic

---------

Co-authored-by: nash <nash@iffy.me>
2023-12-29 09:49:28 -06:00
Auca Coyan
b9cfa0d204
🐛 fix (default) and (installed) on rustup completions (#721)
Updating rust by
```
rustup update <tab>
```
gives you:


![image](https://github.com/nushell/nu_scripts/assets/30557287/fe65bebc-c593-46b2-b696-bc1d093ee0b6)

and when you press enter on stable:

![image](https://github.com/nushell/nu_scripts/assets/30557287/59b98da7-f174-4518-b30b-88e6a9462603)

the ` (default)` part is piped into the cmdline. This is unintended.
I fixed components, toolchains & targets 💪🏼
2023-12-29 08:35:15 -06:00
Auca Coyan
8386cdc628
🐛 rename yarn for yarn-v4 and add run cmpl (#720)
Heya!

This `yarn` file is aimed at the latest yarn v4, which has different
commands than yarn classic (v1)

I renamed the file to make that difference

```
custom-completions/yarn/yarn-completion.nu
#to
custom-completions/yarn/yarn-v4-completions.nu
```

and also added an improvement on `yarn run` which I have on `pnpm`,
changing this


![image](https://github.com/nushell/nu_scripts/assets/30557287/d7a6a040-95f3-4ab5-8ab8-b59ea4a53433)

into this

![image](https://github.com/nushell/nu_scripts/assets/30557287/95bd2edd-f633-4f37-8f4f-d511f037c270)

(note that the new yarn adds the binaries in addition to the
package.json scripts values)
2023-12-28 10:05:09 -06:00
Ed Howland
b2fb2b441b
Adds Modules/recursion : Examples of Fun with Recursive functions in Nu (#717)
This directory contains some examples of running recursive algorithms in
Nu. It also has the module : tramp which implements the Trampoline
pattern to overcome the lack of Tail Call Optimization (TCO) avoiding
unlimited stack growth.

---------

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2023-12-27 13:04:52 -06:00
Auca Coyan
258670c957
code completions (#719)
Hi!
Another command I use frequently. I expected more completions to do, but
turns out `code` is kinda short on flags (compared to `gh` at least)

Some base groundwork is done, it's only missing the `tunnel` and
`serve-web` commands
2023-12-27 08:28:43 -06:00
Mikko Viitamäki
606c33274b
fix broken links in modules readme (#718)
Checked the internal links with
[lychee](https://github.com/lycheeverse/lychee):
`
lychee.exe --offline modules\README.md
`
and I tried to fix links to new locations.

Co-authored-by: Mikko Viitamäki <mikko.viitamaki@logisnext.eu>
2023-12-25 08:08:15 -06:00
Mikko Viitamäki
a95c57f52e
fix broken link on README.md (#716)
hooks link was broken
2023-12-23 10:37:24 +01:00
Auca Coyan
703b551495
add completion to gh pr checkout <tab> (#714)
Hi! I added completion to `gh pr checkout <tab>`
It grabs the first 30 open prs 


![image](https://github.com/nushell/nu_scripts/assets/30557287/755fe63b-dc22-49ef-89c3-27e1ba115d68)

### I tried some things
`gh pr checkout` can accept
- a pr number
- a url
- or a branch

before I tried
- Incrementing the limit of PRs from 30 (default) to 50, but I takes
considerably longer to query, and _gotta go fast_
- using the `extra` field in autocomplete
[`Suggestion`](a4bfaa512b/src/completion/base.rs (L58)).
But I couldn't make it
- tried to use the `title` in the `value`, like this below, but when you
select a row, it pastes the title into the cli, so `gh pr checkout
<title>` doesn't make sense

![image](https://github.com/nushell/nu_scripts/assets/30557287/1c5caf7c-4653-49ba-afc2-ec8ba155b00f)



So, selecting the pr number is the closest I can get to
2023-12-23 00:01:12 -06:00
Auca Coyan
54b5a87f53
add more gh completions (#713)
I added completions for
- [x] `gh repo clone`
    - [x] <tab> gives you a list of your repositories on github
- [x] `gh repo create`
    - [x] `--ignore <tab>` gives you a list of gitignores
- [x] `--license <tab>` gives you a list of licenses with their
description
    
- [x] `gh repo fork` flags

Compared to previous PRs on `gh` completion, it's not much, but these
features are those I use most of the time.
If you want to have completions of some particular subcommand, feel free
to ask!

## Samples

![image](https://github.com/nushell/nu_scripts/assets/30557287/96ddb487-f65b-4f6d-9aed-4ef3be140db7)


![image](https://github.com/nushell/nu_scripts/assets/30557287/3f3ccd5d-1b24-4b05-94e3-c980a0badbf5)
2023-12-22 11:12:10 -06:00
Robbie Nohra
c4db8e6dee
fix: missing regex flag (#712)
- `str replace` for git main branch alias is missing regex flag
- also missing removal of leading white space
2023-12-22 08:53:54 -06:00
fj0r
ab5f40b59c
merge container-inspect into container-process-list (#711)
The behavior of container-process-list and image-list when argument is
passed in is to `inspect`

Co-authored-by: nash <nash@iffy.me>
2023-12-22 07:04:26 -06:00
adrian5
b23755c895
Add tokyo-moon theme variant (#710)
Closes #702. I was wrong in thinking the "night" and "storm" variants
should be much different — they're not. It's the divergent "moon"
variant between them that was missing. Added.

I have slight doubts about the darker gray `#828bb8` being used for e.g.
`ls` columns, but I think that basically correct. The high-contrast
foreground color `#c8d3f5` is the bright variant of that and should show
up in most other contexts I reckon.
2023-12-21 18:08:34 -06:00
Auca Coyan
3db16cb45f
Add the first layer of depth to the cmds (#708)
Hi! I added a second depth to the commands, (I'm going in
breadth-first).

Also, I added the autocomplete of _your_ repos and orgs when you press

```
gh repo clone <tab>
```

Here is a sample

![image](https://github.com/nushell/nu_scripts/assets/30557287/d7859169-cdb2-4c1b-9681-757698e0641d)
2023-12-21 07:38:02 -06:00
fj0r
779d2f8639
comma: support filter, watch, poll (#707)
- Supports `computed`, the definition method refers to
`$env.comma_scope.computed`, accepts two parameters, runtime parameters
and `$env.comma_scope`
- Supports `filter`, similar to `computed`, but only runs when declared,
specified through `$env.comm.flt`
- Supports `watch`, specified through `$env.comm.wth`. Support polling
like 'poll:2sec'

---------

Co-authored-by: nash <nash@iffy.me>
2023-12-21 07:27:36 -06:00
Auca Coyan
d88e68531d
First gh completions (#706)
Hi!
I could squeze some time to do the first `gh` completions.

On the future I will add the subcommands 👍🏼 

docs on 
https://cli.github.com/manual/
2023-12-20 14:56:41 -06:00
Kuo-tung Kao
860a52a55d
fix git-v2 and kubernetes (#703)
- use `-i` instead of `-n` for table command.
- wrapped is needed for args
2023-12-20 06:03:55 -06:00
fj0r
fce44fbbfd
new module comma and some updates (#704)
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>
2023-12-20 06:03:20 -06:00
Darren Schroeder
6f1c0dfef2
fix weather script 2023-12-14 07:02:30 -06:00
张亚飞
2503468725
Fix: nushell at 0.88.0 start and end are deprecated (#698)
This resolves: #697
2023-12-14 06:40:44 -06:00
Auca Coyan
af92dca520
🐛 Fix rustup use completions and modify README (#696)
Hey, it's me, I finally fixed this `use` vs `source` script.nu 😄 

Also, I added a few lines of the `custom-completions/README.md` to
explain what happened in my case
2023-12-13 16:43:19 -06:00
RGBCube
9700391563
Rewrite and expand background task module (#691)
Also renamed the module to task instead of job,
https://www.nushell.sh/book/background_task.html will need updating.

Other than that, this should work.

---------

Co-authored-by: RGBCube <RGBCube@users.noreply.github.com>
2023-12-12 13:06:14 -06:00
Stijn van Houwelingen
9fc4eb0ac5
Added updated and improved version of the conda scripts (#694)
I have been using the script myself for a while, so I am fairly
confident that it works. I would prefer if I could make mamba activate
work out of the box but putting aliases in the file doesn't seem to
work, so If anyone knows how to make that work, that would be great.
2023-12-12 12:56:38 -06:00
Antoine Stevan
1e28cc1560
add a "bulk rename" command to the stdlib candidates (#643)
i received an archive with files with integer ids in their names (1, 2,
...) but because these ids had no padding, the files were completely out
of order when sorting... e.g. 9 comes after 10 because 1 comes before 9
as a character 🤔

i wrote a command to rename a bulk of files in a directory with a
closure 😋

i was not really sure where to put it, so i created
`stdlib-candidate/fs.nu` 👍
2023-12-11 09:00:10 +01:00
Eric Hodel
db9606af6c
Improve git branch cleanup script (#685)
This implementation prunes local branches that have been merged and
optionally prunes remote branches that have been merged.

The script may be configured to keep branches through local git
configuration.

The remote name can be autocompleted.
2023-12-10 09:05:57 -06:00
Auca Coyan
a4cceb8a0b
Add pnpm completions (#692)
Hi!
I added `pnpm` completions. There are a lot of commands, but I added the
most used ones (at least from me)

see you around!
2023-12-09 10:55:52 -06:00
Auca Coyan
cd92a0f405
Add rustup completions (#690)
I did some more work and deleted the old auto-generated `rustup`
2023-12-08 12:28:42 -06:00
Auca Coyan
b30d434ca6
Add rustup completions (#689)
Hi!
It's been a long time using nushell completions, It's about time I can
open a PR 😄
I couldn't finish it in one sitting, but I got the know-how, so I won't
be late to complete it. Left a bunch of `TODO`s

More completions coming!

Keep being awesome 🚀
2023-12-08 11:06:47 -06:00
Max Brown
060903128d
Adding the A case (#688)
I'm handling the add 'A' case here, otherwise we get a null and the
pipeline breaks.
2023-12-07 11:09:56 -06:00
Antoine Stevan
725b92b254
add missing tasks to the release note PR (#665)
see https://github.com/nushell/nushell.github.io/pull/1114 for an
example.
2023-12-06 18:52:06 +01:00
Stefan Holderbach
3836e70d68
Change uses of size to str stats (#647)
Deprecation will be released with `0.87`
- ~~https://github.com/nushell/nushell/pull/10772~~
- https://github.com/nushell/nushell/pull/10798

Final removal in `0.88`


Land before: 
- https://github.com/nushell/nushell/pull/10784
2023-12-06 18:27:41 +01:00
Max Brown
bc309ff07d
Create basic-git.nu (#687)
It's a really simple and naive git status implementation for the prompt
in nushell. Tested on the latest version of nushell.
2023-12-06 11:23:27 -06:00
fj0r
f82c1b03e6
container-create -w: mount $env.PWD as workdir (#686)
container-create -w: mount $env.PWD as workdir

Co-authored-by: nash <nash@iffy.me>
2023-12-06 06:27:59 -06:00
RGBCube
735831e125
Fix typo in bat aliases (#684) 2023-12-02 15:40:40 -06:00
fj0r
55ef44ad3e
generate completions from tree-shaped data (#683)
it might be too trivial to manually create a completion. in many
scenarios, completion is a tree-shaped structure - the current candidate
is influenced by the previous candidate.

`completion-generator` generate completion through tree-like structures
````
{a: {b: {c: {d: 1 e: 2}
````
it uses existing positional arguments as a breadcrumbs to select
candidates in tree structures

as an example, `completion-generator flare` to create completion from
online json data

`completion-generator` supports different structural expressions
````
{value: desc}
{value: { next : ...}
[a b c ...]
[{value: a, description: b, next: [...]]
{|path| ...}
````

these different structures allow any kind of nesting

Co-authored-by: nash <nash@iffy.me>
2023-12-01 19:44:40 -06:00
fj0r
82abb8944c
nu-complete kube deploys and pods (#682)
- 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>
2023-12-01 19:00:07 -06:00
Kuo-tung Kao
c65ae517d0
get deploy complete for ka/kl in kubernetes module (#680)
`kubectl exec` and `kubectl log` support a deployment as argrument.
Get deployment for completion
2023-11-29 09:12:59 -06:00
Gabin Lefranc
0a5c82274f
Add record module (#679)
Add a module to manipulate records.

It can be a potential candidate to nu's standard library ?
Take a look at the name of the functions to see if they respect naming
convention (or if you have better ideas of course 😉 )
2023-11-29 09:12:23 -06:00
fnuttens
2f8dee98ae
Add bat aliases (#678)
See https://github.com/sharkdp/bat
2023-11-29 09:11:31 -06:00
Antoine Stevan
91b6a2b228
add clip from standard library (#674)
related to
- https://github.com/nushell/nushell/pull/11097

## description
this PR is a companion to https://github.com/nushell/nushell/pull/11097
and moves the `std clip` command from the standard library to the new
`modules/system` directory module.

a [new
section](https://github.com/amtoine/nu_scripts/tree/move-clip-from-std/modules#system)
has been added to the README of `modules/`.
2023-11-22 18:25:23 +01:00
WindSoilder
06d3095ab1
Using def --env instead of def-env (#673) 2023-11-20 06:55:35 -06:00
fj0r
9d02fb1ef8
rename cmd parse to argx to improve importing (#671)
- 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>
2023-11-17 20:47:01 -06:00
WindSoilder
09d6c7e437
remove null-stream (#670)
It's a follow up to https://github.com/nushell/nushell/pull/11070
2023-11-17 09:16:21 -06:00
fj0r
6a40ceb3db
cwdhist: can place the path anywhere in the buffer (#669)
- git, kubernetes: upgrade cmd parse

---------

Co-authored-by: nash <nash@iffy.me>
2023-11-17 07:49:58 -06:00
Stefan Holderbach
99fe279311
Change nu-deps script to not care about waves (#667)
The script was running endlessly for me and the notion of crate waves
may be out of date, after removing them and manually aligning the output
with the relevant crate waves things went smooth.
2023-11-14 18:19:19 +01:00
Stefan Holderbach
1fd3a3fa6a
Update nu_release.nu for 0.87 release (#668)
New crate `nu-lsp`

Only treat `nu-cmd-lang` with the `build.rs` for `version` with the
`--no-verify` treatment in the separate wave

Reorder `nu-command` crates as there are dev-dependencies that may be a
problem
2023-11-14 17:33:24 +01:00
Faïz Hernawan
8635a78991
completions/git: fix support for path relative to current directory (#666)
Continuing effort on https://github.com/nushell/nu_scripts/pull/617
which only auto-completes path relative to git root.

Before,

```
$ cd src/

$ git add <tab>
src/main.rs    Modified
README.md      Untracked

$ git diff <tab>
src/main.rs
```

Now it displays,
```
$ cd src/

$ git add <tab>
main.rs           Modified
../README.md      Untracked

$ git diff <tab>
main.rs
```
2023-11-14 06:25:00 -06:00
fj0r
27ffa41815
cwdhist: remove sqlite3 dependency (#661)
- empty-sqlite: dump pre-created empty sqlite database
    - rebind open_command_editor
    - typo: system-pune-all

Co-authored-by: nash <nash@iffy.me>
2023-11-11 10:25:50 -06:00
Antoine Stevan
77f7b40828
fix the TOC of the release note template (#664)
should be the last one... 😇 

this PR adds `-toc` to the links in the TOC of the release note
template, they need that for the back reference to the TOC itself in the
section titles
2023-11-11 16:30:04 +01:00