Skip to content

aakaru/goshell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoShell: A Terminal-First Automation Hub

GoShell is an interactive shell written in Go, extended into a powerful automation hub. 🚀

It connects a lightweight terminal interface directly to the n8n.io workflow automation engine, allowing you to trigger complex, multi-step automations across platforms like GitHub, Discord, and AI services with simple, memorable commands.

This version is configured to work with the aakaru/goshell repository and sends notifications to a pre-configured Discord server.

<img src="goshell-screenshot.png" alt="GoShell Screenshot" width="500" >


✨ Features

  • Fast Go-based Shell: A lightweight and responsive interactive prompt.
  • Smart Tab Completion: Quickly find commands and files.
  • Core Shell Built-ins: Includes cd, pwd, echo, type, and exit.
  • Automation Engine: A powerful flow command that acts as a remote control for your n8n workflows.

🤖 The Automation Hub

The core of this project is the flow command, which turns your terminal into a command center for all your developer tasks.

How It Works

  1. You type a command like flow create-issue "Fix new bug" in GoShell.
  2. GoShell sends this command to a local n8n instance via a secure webhook.
  3. n8n receives the command, uses a Switch Node to identify the task, and executes a pre-built workflow.
  4. The workflow interacts with external APIs (like GitHub and Hugging Face) and sends status notifications to a pre-configured Discord channel.

🚀 Getting Started

Prerequisites

  • Go (1.16+)
  • Docker and Docker Compose
  • A free Hugging Face account and API key.

1. Set Up the n8n Engine

This project includes a docker-compose.yml file to run a local n8n instance. From the project root, run:

sudo docker-compose up -d

Access n8n in your browser at http://localhost:5678 to set up your account. You will need to build the workflows as described in the project documentation and add your personal Discord Webhook URL and Hugging Face API Key to the respective nodes.

2. Configure GoShell

Navigate to the go/ directory. You will need to add your n8n production webhook URL to the flowCommand function in builtins.go.

cd go
go build

3. Run GoShell

./goshell

📝 Built-in Commands

Command Description Usage
cd Change directory cd [directory]
pwd Print working directory pwd
echo Echo text to standard output echo [text]
type Display command type type [command]
whoami Display user whoami
exit Exit the shell exit [code]
flow Utilize the n8n automations flow deploy [version]

🛠️ Available flow Commands

Once running, you can use the following commands to trigger automations for the aakaru/goshell repository.

flow deploy <version>

Triggers a "deployment" by creating an official release tag on the aakaru/goshell GitHub repository and posts a success message to Discord.

> flow deploy v1.2.0
--> Triggering n8n workflow...
<-- {"message":"Workflow was started"}

flow create-issue <title>

Creates a new issue directly in the aakaru/goshell repository and posts a confirmation with a link to Discord.

> flow create-issue "Add a new color scheme"
--> Triggering n8n workflow...
<-- {"message":"Workflow was started"}

flow summarize

Uses a Hugging Face AI model to read the latest pull requests in the aakaru/goshell repository and posts an AI-generated summary to Discord.

> flow summarize
--> Triggering n8n workflow...
<-- {"message":"Workflow was started"}

📁 Project Structure

.
├── go/                 # All Go source code
│   ├── main.go         # Entry point and initialization
│   ├── executor.go     # Command execution engine
│   ├── completion.go   # Tab completion implementation
│   ├── builtins.go     # Built-in command implementations
│   └── utils.go        # Utility functions
├── docker-compose.yml  # Configuration to run the n8n engine
└── n8n-data/           # Persistent data for your n8n workflows

Dependencies

🤝 Contributing

Contributions are welcome! 🎉 Please feel free to submit a Pull Request.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Thanks to the Go community for their amazing tools and libraries
  • Special thanks to the creators of go-prompt for making this shell possible

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages