Commit Graph

867 Commits

Author SHA1 Message Date
Auca Coyan
6309a9f29b
🐛 fix optional args when doing gh repo create and gh repo fork (#763)
Hi!
I found another bug, if you write
```bash
$ gh repo create
```
it leads you to a series of prompts, but the current nu script throws an
error.
I fixed that and `gh repo fork` too, in which you don't necessarily need
an argument.
2024-02-22 13:19:55 -06:00
fj0r
144f3fefde
new cmd: container-log-trunc (#761)
clean container-log-namespace

Co-authored-by: nash <nash@iffy.me>
2024-02-20 06:33:12 -06:00
fj0r
e8f4d7462a
ksi: kubectl set image (#760)
Co-authored-by: nash <nash@iffy.me>
2024-02-20 06:32:46 -06:00
Antoine Stevan
f04cb445e4
rename package files (#701)
related to
- https://github.com/nushell/nupm/pull/51

depends on
- https://github.com/nushell/nu_scripts/pull/700

> **Important**
> this PR will be rebased once #700 lands and only
a5a6b6f950
is relevant here

## description
this is a simple rename of `package.nuon` files to `nupm.nuon` as per
https://github.com/nushell/nupm/pull/51.
2024-02-18 16:23:47 +01:00
Antoine Stevan
4180ce853c
split the package into nu-themes and nu-hooks (#700)
related to 
- https://github.com/nushell/nupm/pull/50

## description
`nu-scripts` was not really a package but rather a set of two module
packages.
this feature has been removed from Nupm in
https://github.com/nushell/nupm/pull/50 and this PR fixes the
`nu-scripts` packages.

> **Note**
> the files in `nu-hooks/` have been moved to `nu-hooks/nu-hooks/` to
fit into the current model of Nupm

this PR does not change anything from the user point of view, apart from
the install that goes from
```nushell
nupm install --path --force .
```
to
```nushell
for pkg in (ls **/package.nuon | get name | path dirname) {
    nupm install --force --path $pkg
}
```
2024-02-18 16:21:35 +01:00
fj0r
7025edf6d6
fix container-create (#759)
Co-authored-by: nash <nash@iffy.me>
2024-02-17 09:02:24 -06:00
John Olheiser
36dcb7ccf2
fix: update deprecated spread operator in just (#758) 2024-02-10 16:23:30 -06:00
Martin Wurm
dbf4586594
Extend pass completion (#756)
This PR extends the existing completion for the pass command to include
all existing subcommands (as of pass v1.7.4). It also adds completions
for the pass-otp and pass-update extensions.
2024-02-07 10:46:41 -06:00
Róbert Kalmár
c8c29728d8
Add refs to git log output (#757)
This PR adds the list of references on a commit for the `gl` command
2024-02-07 09:11:55 -06:00
Mel Massadian
3f824d3f30
feat: add pixi completions (#755)
Completions for [pixi](https://github.com/prefix-dev/pixi) generated
from the [last commit
(e330e4b831959452b859079f45fdc77e45d741a9)](e330e4b831)
to date using the clap auto generation.
2024-02-07 07:21:36 -06:00
Jakub Žádník
a17186f25f
Add script to generate lists of PRs (#753)
This wraps existing code from @amtoine to auto-generate the PRs for Full
Changelog and Breaking Changes sections.
2024-02-06 22:59:46 +02:00
RGBCube
14e77c7ec8
background_task: Fix quoted commands and fix deprecation of implicit spreading and clarify docs (#752) 2024-02-05 06:28:48 -06:00
fj0r
302fd84fed
image-push supports renaming via -t (#750)
fix nu-complete of `docker registry show`

Co-authored-by: nash <nash@iffy.me>
2024-01-26 06:48:51 -06:00
Auca Coyan
73955cd4cf
🐛 fix winget-completions (#749)
Parser did a good job here, explaining
```
Error:   × Deprecated: --flag: bool
    ╭─[C:\...\nu_scripts\custom-completions\winget\winget-completions.nu:27:1]
 27 │
 28 │ def "nu-complete winget flagify" [name: string, value: any, --short(-s): bool] {
    ·                                                                          ──┬─
    ·                                                                            ╰── `--flag: bool` is deprecated and will be removed in 0.90. Please use `--flag` instead, more info: https://www.nushell.sh/book/custom_commands.html
 29 │   let flag_start = if $short { '-' } else { '--' }
    ╰────
```
is not possible anymore, so I removed all the `: bool`s and sourced the
script correctly!
2024-01-25 11:50:26 -06:00
Darren Schroeder
90b4229cc5
update jalon-git.nu to latest nushell syntax (#748)
This PR updates jalon-git.nu to the latest nushell syntax.
2024-01-25 11:47:11 -06:00
Darren Schroeder
2e3534d73d
remove comma.nu from repo (#747)
remove a personal project from our public repo.
2024-01-25 06:04:26 -06:00
fj0r
d9ba934d77
krd for kubectl redistribution deployment (#745)
Co-authored-by: nash <nash@iffy.me>
2024-01-25 05:56:20 -06:00
fj0r
f0dac68236
git-v2: fix ga (#744)
Co-authored-by: nash <nash@iffy.me>
2024-01-24 08:37:23 -06:00
fj0r
f75db6dc5f
docker.nu : fix container-log and container-attach, add registry (#742)
- fix container-log 
- container-attach allow passing flag
- add `registry delete`

---------

Co-authored-by: nash <nash@iffy.me>
2024-01-23 09:17:22 -06:00
fj0r
e5176370f6
fix docker.nu and kubernetes.nu (#739)
updates using the spread operator

Co-authored-by: nash <nash@iffy.me>
2024-01-17 09:09:21 -06:00
fj0r
32d074eb04
use fill -c instead of str repeat (#740)
Sorry, I forgot to use `fill -c` and implemented `str repeat` with
similar function. Now change it back
Added a `log` helper function to avoid the frequent need to adjust the
output format
The original `lg` with a similar name was changed to `show`, but it is
basically only used for internal debugging.
I'm not sure if these should be merged, feel free to do whatever you
want

Co-authored-by: nash <nash@iffy.me>
2024-01-17 09:08:34 -06:00
fj0r
551b1816db
git-v2: imporve message of gp (#738)
Co-authored-by: nash <nash@iffy.me>
2024-01-17 08:37:13 -06:00
Darren Schroeder
490cee7997
change the string interpolation in git aliases (#735)
Change the git log string interpolation for git aliases.
2024-01-14 18:05:35 -06:00
Darren Schroeder
42c6efb0a3
tweak some git aliases so they work (#734)
There were some aliases that weren't working correctly, so I tried to
fix them.
2024-01-13 21:58:23 -06:00
TWSiO
66aa80064e
Adding some examples of how to treat a list like other data structures. (#733)
A nu_101 script to give some examples of how to treat lists like other
data structures that nushell doesn't have natively. Namely queues,
stacks, and sets (and multisets sort of).

I'm also considering making some examples for trees and graphs, probably
using tables, although I might put them in another script so it doesn't
get too long.
2024-01-11 13:33:48 -06:00
Darren Schroeder
a690fcbaa9
do not require stash in git stash drop (#732)
This fixes a small bug so that `git stash drop` doesn't _require_ a
stash
2024-01-11 07:45:11 -06:00
Simon Jarbrant
b44091aea1
Fix gh status completion (#730)
This is a (probably crude) attempt to address an issue where using the
`gh status` command with gh completions installed would yield the
following error:

```
> gh status
Error: nu::parser::missing_positional

  × Missing required positional argument.
   ╭─[entry #1:1:1]
 1 │ gh status
   ╰────
  help: Usage: gh status {flags} <command> . Use `--help` for more information.
```
2024-01-10 16:13:16 -06:00
TWSiO
2d9e279ad8
Adding http oneliner and changing reference to renamed Discord channel. (#731)
The [cookbook intro page](https://www.nushell.sh/cookbook/) gives an
example of a oneliner that I recently changed to imply is one of the
oneliners from this repo (nushell/nushell.github.io#1205), however that
oneliner isn't actually in this repo. This adds that oneliner to the
repo.

I also replaced the mention of the \#cool-oneliners channel that was
renamed to \#cool-scripts to just mention the general Nushell community.
2024-01-10 22:11:44 +02:00
fj0r
30d386e363
upgrade to 0.89 (#729)
Co-authored-by: nash <nash@iffy.me>
2024-01-10 06:40:24 -06:00
fj0r
0632778754
comma: upgrade template (#725)
- README.md: delete the content of template and replace it with a link
- comma_test: T/F execute a closure and return a true or false
- comma_tmpl: add example of building image

---------

Co-authored-by: nash <nash@iffy.me>
2024-01-05 06:05:07 -06:00
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