Forge CLI by Hasal Dharmagunawardana
AI-Powered Git Automation & Release Tool
forge-cli is a powerful Node.js CLI that automates your git workflow while keeping everything organized. It uses AI to help with release flows, simplifies branch management, and can automatically log every release to a Google Sheet.
You can run Forge directly without installation:
npx @hesxo/forge-cliOr install it globally for daily use (run with forge-cli):
npm install -g @hesxo/forge-cli
# or
pnpm add -g @hesxo/forge-cliOnce installed, run forge-cli in any git repository to start the interactive menu.
Forge is designed to be zero-friction. When you run it for the first time, it will interactively ask for the necessary credentials and save them securely to your global configuration (for example, under your home directory).
Required:
- OpenAI API Key: Used to analyze git data and power AI features.
Optional:
- Google Sheets Webhook URL: Used to log release history automatically.
You can modify these settings at any time by running:
forge-cli settingsOr selecting "⚙️ Settings" from the main menu.
Forge guides you through your core release workflow using AI-backed automation and prompts.
- Helps you structure predictable release flows.
- Plays nicely with semantic versioning and tagging strategies.
Keep a permanent record of every deployment. Forge can send a structured payload (User, Branch, Type, Message, Technical Description) to your Google Sheet via a simple webhook.
- Safe Switch: Optionally stash changes before switching branches and restore them after.
- Cleanup: Easily manage and clean up local branches.
Forge provides a clean, visual history of your recent commits and allows you to explore rollback/reset options with confirmation prompts.
You can use Forge in Interactive Mode (recommended) or via Direct Commands.
Just type forge or forge-cli to enter the interactive dashboard.
| Command | Description |
|---|---|
forge release |
Run the release flow (build / tag / push / log) |
forge build |
Run install and build scripts from package.json |
forge branch |
Manage branches (switch, update, clean up) |
forge stash |
Interactive stash management (save, apply, drop) |
forge undo |
Visual commit history and rollback/reset tools |
forge sync |
Fetch and pull changes with one command |
forge settings |
View or update API keys and configurations |
To enable the automatic changelog/release logger, follow these steps to deploy a simple Webhook.
Go to sheets.new and create a blank spreadsheet.
Click Extensions > Apps Script in the top menu. Remove any existing code and paste this:
function doPost(e) {
const sheet = SpreadsheetApp.getActiveSheet();
const data = JSON.parse(e.postData.contents);
// Appends: Timestamp | User | Branch | Type | Message | Description
sheet.appendRow([
new Date(),
data.user,
data.branch,
data.type,
data.message,
data.description,
]);
return ContentService.createTextOutput(
JSON.stringify({ status: "success" }),
).setMimeType(ContentService.MimeType.JSON);
}- Click the blue Deploy button > New deployment.
- Click the gear icon next to "Select type" and choose Web app.
- Description:
Forge Logger - Execute as: Me
- Who has access: Anyone (Important! This allows the CLI to send data without OAuth complexity).
- Click Deploy.
Copy the Web app URL (it starts with https://script.google.com/...).
Run forge settings and paste the URL when prompted.
Most release tools are just scripts. Forge is meant to be an intelligent assistant for your Git workflow.
- It doesn’t just run commands; it guides you through safe, repeatable workflows.
- It protects your work-in-progress when working with branches.
- It makes it easy to keep a human-readable trail of what changed and why.
- Node.js 18.0.0 or higher
- Git
forge-cli is published on npm as forge-cli.