Skip to content

Commit

Permalink
update README and n-cli run command help
Browse files Browse the repository at this point in the history
  • Loading branch information
verzac committed Feb 1, 2024
1 parent f557108 commit 0f4777f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,23 @@ n-cli --help
n-cli send My message here
n-cli s My message here

# where is your config?
n-cli where config

# example - make build takes 20 minutes to complete
make build; n-cli s "Build is done, stop making coffee"

# alternatively, run your shell command through n-cli
n-cli run make build

# make sure to use `--` if you'd like to pass in flags
n-cli r -- make build --whatever-args-i-have-here

# pro tip: you can set an alias to make the whole command shorter
alias n="n-cli s"
make build; n Build is done;

# optional: initializes & configures n-cli without running anything
n-cli init

# get version
n-cli version
# useful commands
n-cli init # optional: initializes & configures n-cli without running anything
n-cli where config # where is your config?
n-cli version # get version
```

# 📝 Configuration
Expand Down
11 changes: 9 additions & 2 deletions cmd/cmd_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ func NewRunCmd() *cobra.Command {
Use: "run",
Aliases: []string{"r"},
Args: cobra.MinimumNArgs(1),
Short: "Runs arbitrary shell commands through n-cli.",
Long: "Runs arbitrary shell commands. For example, `n-cli run echo Hello, world!` If you'd like to pass in flags to your shell command, use `n-cli run mycommand -- --flag1=true --flag2`.",
Short: "Run shell commands and get notified once it's done.",
Long: `Runs arbitrary shell commands. Once it finishes, n-cli will send a notification to you. It will also capture useful metrics such as the time it took for your command to complete.
Example: n-cli run echo Hello, world!
If you'd like to pass in flags to your shell command, use n-cli run mycommand -- --flag1=true --flag2.
Do note that some metrics may be missing on Windows (open a PR if you are interested in implementing them).
`,
Run: func(cobraCmd *cobra.Command, args []string) {
command := args[0]
commandArgs := args[1:]
Expand Down

0 comments on commit 0f4777f

Please sign in to comment.