Skip to content

Commit 48338f3

Browse files
committed
add -m flag for wsh secret ui and document -m and -r flags for wsh web open
1 parent 5148511 commit 48338f3

3 files changed

Lines changed: 37 additions & 10 deletions

File tree

cmd/wsh/cmd/wshcmd-secret.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import (
1717
// secretNameRegex must match the validation in pkg/wconfig/secretstore.go
1818
var secretNameRegex = regexp.MustCompile(`^[A-Za-z][A-Za-z0-9_]*$`)
1919

20+
var secretUiMagnified bool
21+
2022
var secretCmd = &cobra.Command{
2123
Use: "secret",
2224
Short: "manage secrets",
@@ -64,6 +66,7 @@ var secretUiCmd = &cobra.Command{
6466
}
6567

6668
func init() {
69+
secretUiCmd.Flags().BoolVarP(&secretUiMagnified, "magnified", "m", false, "open secrets UI in magnified mode")
6770
rootCmd.AddCommand(secretCmd)
6871
secretCmd.AddCommand(secretGetCmd)
6972
secretCmd.AddCommand(secretSetCmd)
@@ -179,7 +182,7 @@ func secretUiRun(cmd *cobra.Command, args []string) (rtnErr error) {
179182
waveobj.MetaKey_View: "secretstore",
180183
},
181184
},
182-
Magnified: false,
185+
Magnified: secretUiMagnified,
183186
Focused: true,
184187
}
185188

docs/docs/wsh-reference.mdx

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -342,19 +342,36 @@ This will connect to a WSL distribution on the local machine. It will use the de
342342
343343
## web
344344
345-
You can search for a given url using:
345+
The `web` command opens URLs in a web block within Wave Terminal.
346346
347347
```sh
348-
wsh web open [url]
348+
wsh web open [url] [-m] [-r blockid]
349349
```
350350
351-
Alternatively, you can search with the configured search engine using:
351+
You can open a specific URL or perform a search using the configured search engine.
352+
353+
Flags:
354+
355+
- `-m, --magnified` - open the web block in magnified mode
356+
- `-r, --replace <blockid>` - replace an existing block instead of creating a new one
357+
358+
Examples:
352359
353360
```sh
354-
wsh web open [search-query]
361+
# Open a URL
362+
wsh web open https://waveterm.dev
363+
364+
# Search with the configured search engine
365+
wsh web open "wave terminal documentation"
366+
367+
# Open in magnified mode
368+
wsh web open -m https://github.com
369+
370+
# Replace an existing block
371+
wsh web open -r 2 https://example.com
355372
```
356373
357-
Both of these commands will open a new web block with the desired page.
374+
The command will open a new web block with the desired page, or replace an existing block if the `-r` flag is used. Note that `--replace` and `--magnified` cannot be used together.
358375
359376
---
360377
@@ -981,16 +998,23 @@ wsh secret delete temp_token
981998
### ui
982999
9831000
```sh
984-
wsh secret ui
1001+
wsh secret ui [-m]
9851002
```
9861003
9871004
Open the secrets management interface in a new block. This provides a graphical interface for viewing and managing all your secrets.
9881005
989-
Example:
1006+
Flags:
1007+
1008+
- `-m, --magnified` - open the secrets UI in magnified mode
1009+
1010+
Examples:
9901011
9911012
```sh
9921013
# Open the secrets UI
9931014
wsh secret ui
1015+
1016+
# Open the secrets UI in magnified mode
1017+
wsh secret ui -m
9941018
```
9951019
9961020
The secrets UI provides a convenient visual way to browse, add, edit, and delete secrets without needing to use the command-line interface.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)