GoPilot is the AI tool for Devops and Engineering teams. Seamlessly integerate with your codebases, release pipelines and team workflows to automate your typical workflows using the power of AI. GoPilot is like a DevOps engineer always on hand, being able to generate code, write documentation, configure environments, and even deploy your code. Comprised of a comprehensive suite of agentic "actions" that can be composed, extended, and triggered from anywhere, you can think of GoPilot as providing a suite of workflows like Github Actions, except with AI!
GoPilot supports a wide range of AI providers, allowing for seamless integration and quick results across different models, all with minimal configuration. Its simplicity and flexibility make it a perfect choice for developers seeking efficient AI integration without all the bells and whistles.
The idea of GoPilot was formed at my time in large engineering teams like at HashiCorp, where myself and teamates would continually look to automate away toil be desiging and refining highly-determinsitic prompts to solve day-to-day tasks on engineering teams. Managing and using those prompts was tedius, even though the results of years tweaking them produced great results. We would've easily adopted a product to do this, but the market consits of mostly large frameworks and tools that are either: not specific to DevOps automations, not minimal enough to fit nicely in a pipeline or deployed to the edge, and not optimized in a way that produces highly deterministic and traceable results as it required for most DevOps tasks. Some light inspiration was drawn from Aider which can be thought of as the human and application-development focused version of GoPilot. GoPilot was carefully designed to work outside of a human-in-the-loop, and it's speciality is infrastructure, engineering standards, and solving toil.
To install the CLI, run the following command in your terminal:
curl -sSL https://github.com/zacharyiles/gopilot/raw/main/install.sh | bashThis script will:
- Detect your OS and architecture
- Download the appropriate binary from the latest release
- Verify the SHA256 checksum
- Install it to your system's appropriate location
For Windows users, the install script requires one of the following:
- Git Bash (recommended)
- WSL (Windows Subsystem for Linux)
- Cygwin
- MSYS2
To install using Git Bash (recommended):
- Open Git Bash
- Run the installation command:
curl -sSL https://github.com/zacharyiles/gopilot/raw/main/install.sh | bash - If the installation directory is not in your PATH, you may need to add it manually:
- The default installation location is
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps - You can add this to your PATH through System Properties > Advanced > Environment Variables
- The default installation location is
Alternatively, Windows users can perform a manual installation by downloading the appropriate .exe file from the releases page.
Interact with AI models via the CLI using a prompt. Chat history is maintained by default and stored on disk. Structured prompts or text-based files are automatically detected and handled accordingly.
To run a basic prompt:
gopilot "Write a short poem about AI."For structured prompts:
gopilot '{"message": "Write a short poem about AI"}'Using file input:
gopilot /path/to/prompt.mdFlags must be passed after the prompt. For example, you cannot use the command like gopilot -n "What's the weather today?". Instead, it should be:
gopilot "What's the weather today?" -nHere are the available flags:
--streamor-s: Stream the response compatible with Unix pipelines.--newor-n: Erases previous chat history and starts a new one for this message.--one-shotor-o: Disables chat history for this message. History is not passed as context to the LLM and is not saved.--with-contextor-w: Pass a string or one or more paths to text-based files (comma-separated). The contents will be extracted and used as additional context for the model. This is useful for tasks like analyzing or making changes to code files.--configor-c: Specify a configuration file path. This overrides other configuration methods.--versionor-v: Show version information--actionor-a: Specify an action plugin to process inputs and outputs (e.g., --action=edit-code)
The tool will return the response from the model.
Example:
$ gopilot "What's the weather today?"Response:
The weather today is sunny with a high of 25 degrees.
For structured response:
$ gopilot '{"message": "What's the weather today?"}'Response:
{
"message": "What's the weather today?",
"response": {
"forecast": "sunny",
"temperature": "25 degrees"
}
}Actions are the core of GoPilot. They represent discrete, composable, agentic workflows. Actions leverage the full GoPilot framework to accomplish a set of very specific AI-driven tasks, such as updating a README after a new commit to main, or reviewing a new PR, or generating a new client SDK after an API chanegs. Actions are purpose built to solve typical grunt work and tasks on engineering and Devops teams, but supercharge them with the power of AI. Actions are meant to be used in pipelines, automations, or as part of a local development workflow. Actions are meant to be highly deterministic and utilize structured inputs and outputs and are optimized to not require human intervention or triggering.
NOTE: This project is still in early development and many planned actions are not yet implemented.
The edit-code action optimizes the interaction for code editing tasks. It:
- Formats the AI's instructions to focus on code modifications
- Returns only the relevant changed sections of code
- Adds helpful comments explaining the changes
Example usage:
gopilot "Update the error handling in main.go" --action=edit-code --with-context=main.goGoPilot uses configuration values to determine how it interacts with AI providers and their models. These configuration values can be set in several ways, allowing flexibility for different workflows and use cases.
The following configuration options are supported:
-
PROVIDER: Specifies the AI provider to use. Supported values include:openaicohere-ai@huggingface/inferencelangchainopenrouteranthropic
-
API_KEY: The API key for the selected provider. You must supply this for authentication when using the providers. -
MODEL: The model to use with the selected provider. Refer to the provider's documentation for available models. For example, OpenAI'stext-davinci-003.
Configuration values can be set in one of the following ways:
- Define configuration values directly in your shell or in a
.envfile located in the same directory where GoPilot is being executed. Values from the.envfile are loaded automatically.
- Create a JSON or YAML file with the following names:
gopilot.config.jsonorgopilot.config.yml. Place the configuration file in the directory from which you run the GoPilot CLI, as this is where GoPilot will look for the configuration. Example of a JSON configuration file:
{
"PROVIDER": "openai",
"API_KEY": "your-api-key",
"MODEL": "text-davinci-003"
}- You can specify a configuration file path directly using the
--configor-cflag when running the CLI. This method takes precedence over the environment variables and configuration files.
Example usage:
gopilot --config /path/to/gopilot.config.jsonEach configuration method is optional, and values provided through later methods will override any earlier settings.
GoPilot uses GitHub Actions to automatically build and release binaries for multiple platforms when a new tag is pushed. To create a new release:
- Tag the commit:
git tag -a v1.0.0 -m "Release v1.0.0" - Push the tag:
git push origin v1.0.0
The GitHub Action will automatically:
- Build binaries for Windows, macOS, and Linux (both amd64 and arm64)
- Generate SHA256 checksums for each binary
- Create a GitHub release with all artifacts
- Generate release notes
- How should complex JSON inputs (e.g., examples for classification) be handled in a CLI-friendly way?
- Should the CLI support multiple configuration files for different providers or workflows?
- How will the CLI gracefully handle rate-limiting or API errors across different providers?
To build GoPilot from source:
git clone https://github.com/zacharyiles/gopilot
cd gopilot
go build -o gopilot ./cmd/main.goFor a release build with optimizations:
go build -trimpath -ldflags="-s -w" -o gopilot ./cmd/main.go- Visit the releases page
- Download the appropriate binary for your system:
gopilot-darwin-amd64for Intel macOSgopilot-darwin-arm64for Apple Silicon macOSgopilot-linux-amd64for 64-bit Linuxgopilot-linux-arm64for ARM64 Linuxgopilot-windows-amd64.exefor 64-bit Windowsgopilot-windows-arm64.exefor ARM64 Windows
- Verify the checksum (recommended):
sha256sum -c gopilot-<os>-<arch>.sha256
- Make the binary executable (Linux/macOS):
chmod +x gopilot-<os>-<arch>
- Move to a location in your PATH (Linux/macOS):
sudo mv gopilot-<os>-<arch> /usr/local/bin/gopilot
Contributions are welcome. Please open an issue or pull request for any feature requests, bug fixes, or improvements.
This project is licensed under the MIT License - see the LICENSE file for details.