abiosoft / abiosoft/ishell

Run command automatically on startup

未關閉
#134 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Go
星號
1.8k
分支
213
PR 合併指標
30 天內沒有已合併 PR

描述

I am trying to make a CLI app that works similarly to npm. I am using cobra to register the individual commands, and on certain commands, I want to launch an interactive shell with ishell and run a specific command on startup of the shell.

**EDIT:** If not a startup command, is there a way to programatically run commands?

Example:
Say `npm` is my CLI app and `init` is the command that fires up an ishell instance.

The above is implemented with cobra but my understanding is cobra cannot use standard input, hence the use of ishell.

But upon typing `npm init`, I don't want to run another command in the shell, but automatically prompt for standard input. This can be done by having ishell run a command as soon as `shell.Run()` is called. Is this possible?

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。