commander-cli / Cmd
Licence: mit
A simple package to execute shell commands on linux, windows and osx
Stars: ✭ 56
Programming Languages
Projects that are alternatives of or similar to Cmd
Commander
Test your command line interfaces on windows, linux and osx and nodes viá ssh and docker
Stars: ✭ 183 (+226.79%)
Mutual labels: cmd, terminal, osx
Yaspin
A lightweight terminal spinner for Python with safe pipes and redirects 🎁
Stars: ✭ 413 (+637.5%)
Mutual labels: terminal, unix
Libterm
iOS sandboxed terminal with Python, Lua and Clang
Stars: ✭ 348 (+521.43%)
Mutual labels: terminal, unix
Whipper
Python CD-DA ripper preferring accuracy over speed
Stars: ✭ 517 (+823.21%)
Mutual labels: terminal, unix
Ltfinderbuttons
My Finder buttons collection for macOS.
Stars: ✭ 269 (+380.36%)
Mutual labels: terminal, osx
Sloth
Mac app that shows all open files, directories, sockets, pipes and devices in use by all running processes. Nice GUI for lsof.
Stars: ✭ 4,549 (+8023.21%)
Mutual labels: osx, unix
Sqlite Global Tool
SQLite .NET Core CLI tool that allows the user to manually enter and execute SQL statements with or without showing query result.
Stars: ✭ 37 (-33.93%)
Mutual labels: cmd, terminal
Yori
Yori is a CMD replacement shell that supports backquotes, job control, and improves tab completion, file matching, aliases, command history, and more.
Stars: ✭ 948 (+1592.86%)
Mutual labels: cmd, terminal
Initior
A command line application that let's you initialize your new projects the right way, replaces npm and yarn's init 🎆
Stars: ✭ 17 (-69.64%)
Mutual labels: cmd, terminal
Terminal
The new Windows Terminal and the original Windows console host, all in the same place!
Stars: ✭ 79,371 (+141633.93%)
Mutual labels: cmd, terminal
Cmd Command Cheat Sheet
CMD - Command Cheat Sheat ✅
Stars: ✭ 50 (-10.71%)
Mutual labels: cmd, terminal
Covid19 Tracker Cli
A curl-based command line tracker for Novel Coronavirus or COVID-19 pandemic. It Supports terminal for linux and macos, command prompt for windows, and termux for android with real-time updates.
Stars: ✭ 244 (+335.71%)
Mutual labels: cmd, terminal
Terminus
Terminus, a terminal for Atom! - Looking for collaborators hop in, at your next bus stop :-)
Stars: ✭ 49 (-12.5%)
Mutual labels: cmd, terminal
Themer
themer is inspired by trevordmiller/nova and chriskempson/base16.
Stars: ✭ 4,483 (+7905.36%)
Mutual labels: cmd, terminal
Sampler
Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.
Stars: ✭ 9,203 (+16333.93%)
Mutual labels: cmd, terminal
Vue Command
A fully working, most feature-rich Vue.js terminal emulator
Stars: ✭ 147 (+162.5%)
Mutual labels: cmd, terminal
Nord Iterm2
An arctic, north-bluish clean and elegant iTerm2 color scheme.
Stars: ✭ 651 (+1062.5%)
Mutual labels: terminal, osx
cmd package
A simple package to execute shell commands on linux, darwin and windows.
Installation
$ go get -u github.com/commander-cli/[email protected]
Usage
c := cmd.NewCommand("echo hello")
err := c.Execute()
if err != nil {
panic(err.Error())
}
fmt.Println(c.Stdout())
fmt.Println(c.Stderr())
Configure the command
To configure the command a option function will be passed which receives the command object as an argument passed by reference.
Default option functions:
cmd.WithStandardStreams
cmd.WithCustomStdout(...io.Writers)
cmd.WithCustomStderr(...io.Writers)
cmd.WithTimeout(time.Duration)
cmd.WithoutTimeout
cmd.WithWorkingDir(string)
cmd.WithEnvironmentVariables(cmd.EnvVars)
cmd.WithInheritedEnvironment(cmd.EnvVars)
Example
c := cmd.NewCommand("echo hello", cmd.WithStandardStreams)
c.Execute()
Set custom options
setWorkingDir := func (c *Command) {
c.WorkingDir = "/tmp/test"
}
c := cmd.NewCommand("pwd", setWorkingDir)
c.Execute()
Testing
You can catch output streams to stdout
and stderr
with cmd.CaptureStandardOut
.
// caputred is the captured output from all executed source code
// fnResult contains the result of the executed function
captured, fnResult := cmd.CaptureStandardOut(func() interface{} {
c := NewCommand("echo hello", cmd.WithStandardStream)
err := c.Execute()
return err
})
// prints "hello"
fmt.Println(captured)
Development
Running tests
make test
ToDo
- os.Stdout and os.Stderr output access after execution via
c.Stdout()
andc.Stderr()
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].