1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-30 13:47:46 +00:00
Commit graph

1194 commits

Author SHA1 Message Date
Schweber
7211896e27
nix: add nufetch.nu (#963)
Adds nufetch, a simple neofetch/hyfetch alternative
2024-09-30 07:45:33 -05:00
Marc Schreiber
e10ffbaaa7
Fix git diff completions (#962)
Fixes #961
2024-09-26 11:18:04 -05:00
shelton louis
5ffdfca7e7
feat: add yadm completions to the repo (#960)
This is a request to add yadm completions to the repo.
These resemble the ones that are written for. The git one in your repo.
Yadm is a dotfiles manager that leverages `git` but uses your home
directory by default.

To see the tool go to <https://yadm.io/docs/overview>
2024-09-25 14:58:33 -05:00
Auca Coyan
33ae4c55c2
completions for bmc client (#932)
Hi! Some completions for a unknown CLI tool I use everyday 😇.

It's been a while since I don't make a PR here, hehe
2024-09-22 15:29:34 -05:00
Auca Coyan
da307d0864
🩹 fix git init --initial-branch string instead of bool (#959)
Just using the completions I realized that:

```nu
# Create a new git repository
export extern "git init" [
  --initial-branch(-b)                                # initial branch name
  #should be
  --initial-branch(-b): string                        # initial branch name
]
```

because initial branch takes a string, it not a boolean
2024-09-22 15:15:37 -05:00
Harrisonn
189bf3a706
fix: adequates to new rustup help page style (#958)
Rustup page style changed, this commits adequates all `nu-complete
rustup` commands to this new syntax
2024-09-20 06:39:30 -05:00
fj0r
874918fdd3
Upgrade range syntax (#953)
Co-authored-by: nash <nash@iffy.me>
2024-09-17 10:51:37 -05:00
Ian Manske
71d2eaf516
Edit release notes template (#957)
Renames the `Changes to commands` section to just `Changes`. As such,
the breaking changes section is redundant since `Changes to commands`
already has a breaking changes subsection.
2024-09-17 04:23:45 +00:00
Harrisonn
d04eea634a
fix: cargo clippy linting flags need to accept strings (#947)
The linting flags `--warn`, `--deny`, `--allow` and `--forbid` have
`string` type rather than `bool`

Signed-off-by: OJarrisonn <j.h.m.t.v.10@gmail.com>
2024-09-11 17:51:33 -05:00
lywu
fb8901e1e8
fix(aws): Fix select-aws-profile script functionality and style (#946)
### What
- Rename main function to 'main' and add --env flag for environment
modification
- Fix region handling to properly check for null values

### Why

The aws/select-aws-profile script syntax is outdated

```shell
➜ nu
Error: nu::parser::named_as_module

  × Can't export command named same as the module.
    ╭─[~/.config/nushell/nu_scripts/modules/aws/select-aws-profile.nu:12:12]
 11 │ #     select-aws-profile
 12 │ export def select-aws-profile [] {
    ·            ─────────┬────────
    ·                     ╰── can't export from module select-aws-profile
 13 │     hide AWS_REGION;
    ╰────
  help: Module select-aws-profile can't export command named the same as the module. Either change the module name, or export `main` command.
```
2024-09-11 06:12:16 -05:00
Schweber
f74b2aa777
nix activation-script: add handling of empty input (#945)
Fixed the check for empty input. Should be working correctly now.
2024-09-05 09:07:00 -05:00
Reilly Wood
614b073310
Fix TWiN script (#944)
At some point this broke, just committing a fix I've had on my personal
computer for a while.

```
# This week in Nushell #261


## Nushell

Error: nu:🐚:name_not_found

  × Name not found
    ╭─[/home/reilly/github/nu_scripts/make_release/this_week_in_nu_weekly.nu:36:48]
 35 │
 36 │             for user in ($site_json | group-by user_login | transpose user prs) {
    ·                                                ─────┬────
    ·                                                     ╰── did you mean 'user.login'?
 37 │                 let user_name = $user.user
    ╰────
```
2024-08-30 05:47:45 -05:00
chtenb
430951c3b1
Use --no-color for git completions (#943)
Resolves https://github.com/nushell/nu_scripts/issues/942
2024-08-29 09:10:50 -05:00
Loïc Riegel
0f3d6e6edc
Add custom completions for pytest (#941)
Hi, small PR to add completions for the pytest framework, widely used in
the Python community
2024-08-28 17:14:44 -05:00
Jakub Grabarczuk
102c7d884b
Completions for dotnet (#938)
Just forwarding the work to "dotnet complete" command,
which has a disadvantage of not including any comments
2024-08-28 08:15:37 -05:00
Loïc Riegel
6abc543722
Add custom completions for pre-commit (#940)
# Added

Completions for pre-commit, plus README

# Fixed

Removed duplciate flag it git completionts
2024-08-25 18:27:18 -05:00
Ruan Comelli
7188d9ac03
Remove completions for pixi (#939)
Remove custom completions for pixi.

Closes #937.

---

> [!NOTE]
> This is my first contribution to this project. I saw #937 and thought
it was a good first issue to help with 🙂
2024-08-24 16:27:10 -05:00
Alexandre CONTASSOT
7bf4491cbf
Add catppuccin macchiato theme (#935) 2024-08-19 14:08:37 +02:00
Sylvain Desbureaux
149d9584c4
make op completion to work with latest nushell (#936)
with newest version of nushell, this completion is not accepted.
2024-08-19 12:32:02 +02:00
Alexandre Nédélec
f0c293bdf9
Update direnv config (#934)
Path has changed from hooks to nu-hooks
2024-08-18 17:02:46 -05:00
Auca Coyan
0cba7933f2
add worktree completions (#933)
you can now `git worktree remove <tab>` for autocompletions

![image](https://github.com/user-attachments/assets/2eac159c-fd86-42c4-9ecc-469b333dea52)

and show the branches _after_ the path in `git worktree add ./my-path
<tab>`

![image](https://github.com/user-attachments/assets/d5fadce3-8153-4d51-82e3-0a911ecdefb6)
2024-08-14 15:40:59 -05:00
Kira
7b2ec35cf2
Update scoop completions (#930)
made scoop completions a bit more reliable by converting the PsObject
from powershell to json instead of parsing lines from the `scoop help`
output

doesn't take any longer since scoop run in powershell either way

Co-authored-by: unknown <67888720+kira-nyx@users.noreply.github.com>
2024-08-14 06:16:37 -05:00
Christoph Blessing
1b5584a71d
Fix network option missing type (#929) 2024-08-12 12:00:26 -05:00
David
e0ccb8fecc
Add ttyper completions (#928)
Added ttyper completions. Ttyper is a little tool for speed typists
(readme included).
2024-08-10 15:31:02 -05:00
David
135373dc28
Add croc completions (#927)
Adds croc completions. Readme about tool included.
2024-08-10 15:30:38 -05:00
Jonas
e4d721e08b
Top commands one-liner (#926)
This pull request adds a script containing a one-liner that can be used
to get a table containing the top 5 used commands by using the history
file
2024-08-09 08:05:41 -05:00
Devyn Cairns
5eb484f986
Add warning to release checklist for nu-ansi-term (#912)
@fdncred said that it's quite tricky to release `nu-ansi-term`, so we
probably shouldn't generally do it during a nushell release
2024-08-06 14:16:48 +02:00
NotTheDr01ds
9a12d8df39
Additional Theme Features (#925)
Changes to `make.nu`:

* Adds in missing shapes and types noted further down in this PR by
@fdncred
* Adds colors for types - Mostly matching the corresponding shape, but
with any attribute (e.g., bold) removed
* Changed `int` and `float` values to be distinct. In most themes, the
colors should be complementary.
* Changes `bool: false` and `hints` colors - They were hardcoded to
`dark_grey` and wouldn't show up on some themes. Now uses a theme color
that should correspond to a theme-appropriate grey in most cases.
* Alphabetizes shapes and types so that Previews are also sorted
properly
* Eliminated spurious newline when sourcing theme (from printing OSC
codes for terminal colors)
* Renamed `3024` theme to `3024r` since module names can't be an `int`

Changes to `theme preview small`:

* Remove extra vertical spacing that was caused by different-sized row
column content
* Logically group elements - Types, Conditionally computed (closures)
types, Shapes, and other Structure (e.g., header, row_index, foreground,
etc.)
* Displays foreground/background on one line for clarity

Result is a much more compact, but also more readable, table.

Comparison:

<details><summary>Before</summary>
<p>
<img
src="https://github.com/user-attachments/assets/2673855d-d20d-4e14-8029-255138f2ecc9"
/>
</p>
</details> 

<details><summary>After</summary>
<p>
<img
src="https://github.com/user-attachments/assets/c8824b7a-440d-4567-bd69-b2e1df358340"
/>
</p>
</details> 

* Also refactored a lot of the code to be more maintainable - Moves the
rendering off to separate functions.

Changes to `preview_generate_screenshots.nu`:

* Accepts the method for generating screenshots as an argument
* Additional generation method using asciinema, agg (asciinema to
animated gif), and ffmpeg (to convert the animated gif to a single-image
PNG)

Additional Notes:

- Some Lemnos themes use color values that are the same (or nearly the
same) as the background in places. These are "broken" themes and always
have been as some elements will simply not be visible.

- There's a longstanding (I believe) bug that special-cased `record` for
the *key* rather than the *value*. I've fixed it so that the *key* is
now handled properly (same as other types), but I haven't implemented
any changes for color values that use a record (e.g., `{ fg: "#80a1a1",
attr: "b" }`) as this would make the table less compact. I'll look at
doing this for the longer form `preview theme` later.

- Closures other than for `string`, `bool`, `date`, and `filesize` are
currently only displayed as a summary. There aren't any themes currently
that this impacts, but if you create one manually, the display results
were pretty bad. This is primarily due to bad indentation from
`config.nu` (and/or defaults). A proper `nu-indent` would help fix this,
or maybe we could just remove all whitespace and display any closure as
a one-liner.

I probably won't regenerate screenshots until we figure out what to do
about the "monotone" type colors.
2024-07-29 17:08:13 -05:00
Devyn Cairns
6d6a157600
Add recursive fibonacci benchmark (#924)
This is pretty much the least efficient reasonably simple way to
implement fibonacci in Nushell, and it's a good benchmark to profile our
custom command call performance, as this is the majority of the work
being done.

I think it may actually be good to add this and the other one to `cargo
bench` so we can track it over time, but it's also useful as a script so
it can easily be profiled.
2024-07-28 07:15:55 -05:00
OJarrisonn_
54546c8bf2
Refactor of docker completions (#922)
Refactor docker custom completions to reorder `export extern`
declarations and make use of `export alias` to avoid repetition

Also fixes `docker run` needing a mandatory `network` argument which
doesn't exist
2024-07-27 15:55:40 -05:00
OJarrisonn_
0b487e8380
fix: use proper path type for path argument for bat (#921)
Use of `string` disable `~` expansion

Signed-off-by: OJarrisonn <j.h.m.t.v.10@gmail.com>
2024-07-27 14:05:48 -05:00
OJarrisonn_
6bbd75120d
fix: use proper path type for path argument for eza (#920)
Using `string` may disable `~` expansion in modern nushell (>= 0.95)

Signed-off-by: OJarrisonn <j.h.m.t.v.10@gmail.com>
2024-07-27 14:05:22 -05:00
NotTheDr01ds
60b1444742
Update themes preview to use chunks in place of deprecated group (#918)
Also `print`s the theme rather than just returns it from `preview theme
small` - Otherwise we can't "script" the theme preview as part of
screenshotting (found while recording with Asciinema).
2024-07-25 10:42:06 -05:00
Christoph Blessing
2321b5b29a
Fix incorrect docker commands (#917)
Fix "docker run" and "docker container run" custom commands incorrectly
expecting a "network" positional argument.
2024-07-25 10:40:50 -05:00
Darren Schroeder
891854f25f
Create image-actions.yml 2024-07-25 08:20:20 -05:00
Jack Wright
6b962c8f46
Fixing ordering / added nu-drive-value for nu_release.nu (#915) 2024-07-24 10:07:58 -05:00
Elizabeth
eedcd10dbb
Fixed sys usage (#916)
Just as a heads up, I haven't really tested this since a lot of it is
stuff I don't use or know how to set up without some reading up. I have
tested the nu_conda_2 change since I have a python project that I use
that for, and I could look into testing more of it if needed.

I've tried finding (naively using `/sys\W/`) all the usage of the old
plain `sys` calls and replacing them with alternates as appropriate,
which mostly has been to swap a `(sys).host.name` call into a
`$nu.os-info.name` one, since it'll be tad faster and more consistent
across platforms with naming (especially as the value comes from the
[rust stdlib](https://doc.rust-lang.org/std/env/consts/constant.OS.html)
and is very predictable).

Fixes #897
2024-07-24 09:09:31 -05:00
Devyn Cairns
3b39ef75c9
Add more notes about transferring ownership during release (#914)
Try to avoid delayed releases by mentioning it several times, haha
2024-07-24 02:49:39 +00:00
Devyn Cairns
6eb1398f4e
Move notes for plugin developers to top level in release notes (#913)
The changes noted here aren't always breaking changes, so it makes sense
to just have them at top level. I also fixed the missing TOC link.
2024-07-24 02:26:12 +00:00
NotTheDr01ds
90bab5a139
Fix cell-path in themes (#911)
Four minor changes:

* As previously mentioned, updates `make.nu` to use `cell-path` rather
than `cellpath`
* Slight improvements on #905 (cc @amtoine) - The last theme converted
was the only one printed via `info`, but it didn't get removed from the
screen. Things moved so fast on my system that it looked like only one
theme was being converted, since that's the only message that was left
on the screen ;-). Now prints a "Done" message showing how many themes
were converted and how many failed.
* There was a previous update to `catppuccin-latte.nu` that was
apparently made directly to the theme, rather than the custom src.
Synced these up.
* Bumped `nupm.nuon`
2024-07-22 15:52:01 -05:00
Antoine Stevan
ecfbad67b9
work on the nu-themes make script (#905)
i was mostly having fun there 😋

cc/ @NotTheDr01ds 

## changes
- using some colors for the logging
- slight refactor of the main, i.e. i build a `table<name: string,
source: string>` of themes and then iterate over it and call `make-theme
$t.name $t.source`, thus getting rid of the twin pipelines
- i also build a `table<name: string, source: string>` of failing
themes, to show them at the end

## reviewing
i think the best to review this is
- go to `themes/`
- remove any copy of the `lemnos/` directory
- run `./src/make.nu` twice and see the output 😉
2024-07-22 14:55:32 -05:00
NotTheDr01ds
995c1ea21c
Update theme preview scripts and screenshots (#909)
Lots of changes - Pretty every change needed to be made before updating
the preview screenshots, so they all end up in the same PR here:

* `preview-generate-screenshots.nu` now generates the previews and
screenshots all in one pass rather than requiring a separate file.

* Adds a new method for generating screenshots using PowerShell with no
third-party application required. Created new function for choosing the
method that is used to generate screenshots.

* Fixes background color on `nushell-dark` and `nushell-light` themes.

* Fixes bug where `cursor` setting (and perhaps one other) was getting
dropped from the preview table (`math ceil` was needed rather than `math
floor`)

* Fixes `cellpath` setting - Was changed to `cell-path` a while back but
never updated in the themes. All themes and their previews were
regenerated. Custom themes were manually adjusted.

* **Important:** I did not update `make.nu` to fix this (yet) since
@amtoine has a open PR against it that has not been merged yet. Easier
to either put that change in that PR or do it after that one has been
merged.

* Adds `mod.nu` in the root of the `themes` module. Moves some of the
previous script commands such as `preview_terminal`,
`preview_theme_small`, etc. over to the module. Makes for cleaner usage.

* Note: The completion functions in the scripts have been broken for
several months. I did not fix this at this point.

* `preview_theme_small` (and others) renamed to use spaces in command
name, so it is now `preview theme small`.

* Fixes bug of my own making that prevented several custom themes from
working.

* Refactors the "list to columns" code to use `group` (will need to be
updated to `chunks` in 0.96)
* Suppresses the indices column in the preview table
* Removes the column headers entirely since they don't serve any purpose
in this type of "columnar table"
2024-07-22 14:21:28 -05:00
sadguitarius
770dfe6d4e
add silent option to nu_msvs (#910)
I like to activate nu_msvs in my config by default and don't need a
message that tells me the command has been run when doing this. This
commit adds a --silent option so there's no message displayed when
running the command.
2024-07-22 14:08:46 -05:00
Auca Coyan
d64004f710
Fixes scope commands call and columns (#908)
Hi! Just to more fixes in the queue 😄
2024-07-21 07:40:22 -05:00
Auca Coyan
ba46538785
🐛 parser fixes (#801)
- replace `str collect` for `str join`
- replace `str lpad` for `fill`
- `str lpad -c` for `fill --width`
- `str rpad -l` for `fill --alignment r --width`
- updated `before_v0.60/README.md`
- `$nu.scope.commands` for `scope commands`
- add a couple of `if (true) {} else {}` (else keyword)
- `$true` for `true`
- `$false` for `false`
2024-07-21 07:21:21 -05:00
OJarrisonn_
be32cdaefc
fix: catppuccin themes declared a const inside a record (#907) 2024-07-21 07:00:51 -05:00
Antoine Stevan
59171b0fd9
bump the nu-hooks package to 0.2.0 (#901)
as per title

## changelog
- "did you mean" improved in #811
- "nuenv" added in #889
- "startup times" added in #888
- "tookit" added in #888
2024-07-21 07:00:02 -05:00
Okdro
0906f7a15c
Feature/add git grep completions (#898)
Added completions for most of the flags for `git grep`. 

A few flags have been omitted for this PR due to Git expecting arguments
for those be passed without whitespaces. The arguments are optional, but
the flags would not work when passed arguments (see `--open-with-pager`
and `--color` flags in [this
commit](ffa9ceab73)
for how I tried to do it).

Ex. 

`--open-with-pager(-O)` expects the optional argument to be passed as
either `--open-with-pager=<pager>` or `-O<pager>`. Including it in the
completions list as I had implemented it breaks the flag when using the
optional parameter.

Feedback appreciated for how to handle that. I'm still new to the Nu
language, so I might have missed something obvious that could fix that.
2024-07-21 06:59:39 -05:00
Antoine Stevan
71f5736d93
RFC: add a command to help parsing arguments in scripts (#875)
the other day, i was writing a script and wanted to pass a `list<int>`
to it which is not possible because there is no such things as _types_
for externals 🤔

i ended up writing an "arg parsing" command to help in that task and
thought it could be useful to people 😇

in this MR, i add `std-rfc parse-arg` in the `script-parsing.nu` module
and add associated tests which all pass.

i invite the reader to have a look at the docstring of `parse-arg` which
should contain a full example explaining the usage of this new command
😉

---------

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2024-07-21 06:58:34 -05:00
Antoine Stevan
6aa2700730
add ways-to-add-up-to to "math" module (#874)
at my job, i studied very quickly something that involved computing all
the ways one can build a positive integer from the addition of other
positive integers.

enters the `ways-to-add-up-to` command i've written and added to the
`math` module in this PR.

## example
`ways-to-add-up-to 4` will be `[[1, 1, 1, 1], [1, 1, 2], [1, 3], [2, 2],
[4]]]` because $4$
can be obtained as follows:

$$ 1 + 1 + 1 + 1 $$

$$ 1 + 1 + 2 = 1 + 2 + 1 = 2 + 1 + 1 $$

$$ 1 + 3 = 3 + 1 $$

$$ 2 + 2 $$

$$ 4 $$

> **Note**  
> $1 + 1 + 2$ and $1 + 2 + 1$ are considered the same because addition
is _commutative_ and thus only `[1, 1, 2]` will be returned
2024-07-21 06:55:45 -05:00