Skip to content

Commit fd7442a

Browse files
committed
docs: update installation and usage instructions for Forge CLI
- Clarified prerequisites by specifying the need for the Forge CLI in the first-app tutorial. - Enhanced the installation guide to include detailed steps for installing the Forge CLI via various methods (Homebrew, Go, Scoop, binary download, Linux packages, Docker). - Updated quick start guide to reflect the use of `forge dev` for running applications instead of `go run`. - Added a new document for the Forge CLI, outlining its command structure, core commands, and quick start examples. These changes improve the clarity and accessibility of the documentation, ensuring users have the necessary information to effectively use the Forge CLI.
1 parent 58eb2bd commit fd7442a

7 files changed

Lines changed: 141 additions & 18 deletions

File tree

docs/content/docs/forge/(cli)/build-deploy.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,13 +685,13 @@ deploy_production:
685685
686686
```bash
687687
# Check for syntax errors
688-
go build ./cmd/api-gateway
688+
forge build -a api-gateway
689689

690690
# Check dependencies
691691
go mod tidy
692692

693693
# Build with verbose output
694-
forge build --verbose
694+
forge build -a api-gateway --verbose
695695
```
696696

697697
### Docker Build Issues
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ Forge provides a comprehensive command-line interface that helps you develop, bu
1515
### Install the CLI Tool
1616

1717
```bash
18-
# Install the latest version
18+
# Homebrew (macOS/Linux) - recommended
19+
brew install xraph/tap/forge
20+
21+
# Or using Go install
1922
go install github.com/xraph/forge/cmd/forge@latest
2023

2124
# Verify installation
2225
forge version
2326
```
2427

28+
See the [Installation](/docs/forge/installation) guide for all available methods (Scoop, binary download, Linux packages, Docker).
29+
2530
### CLI Commands Overview
2631

2732
```bash

docs/content/docs/forge/(cli)/development.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@ forge dev build -a my-app
507507

508508
**Solution:**
509509
```bash
510-
# Check for syntax errors
511-
go build ./cmd/my-app
510+
# Retry the build
511+
forge dev build -a my-app
512512
513513
# Install dependencies
514514
go mod tidy

docs/content/docs/forge/(cli)/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "Forge CLI",
33
"pages": [
4-
"index",
4+
"router",
55
"system",
66
"development",
77
"code-generation",

docs/content/docs/forge/first-app.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ In this tutorial, you will build a complete TODO REST API with CRUD operations,
2020

2121
## Prerequisites
2222

23-
Make sure you have completed the [Installation](/docs/forge/installation) guide and have Go 1.21+ installed.
23+
Make sure you have completed the [Installation](/docs/forge/installation) guide, have Go 1.21+ installed, and have the Forge CLI available (`forge version`).
2424

2525
---
2626

@@ -284,8 +284,8 @@ If a handler returns a plain `error` (not an `HTTPError`), Forge automatically w
284284
Start the server and run through the full CRUD cycle:
285285

286286
```bash
287-
# Start the server
288-
go run main.go
287+
# Start the development server
288+
forge dev
289289
```
290290

291291
In another terminal:

docs/content/docs/forge/installation.mdx

Lines changed: 124 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Installation
3-
description: Install Forge and set up your development environment
3+
description: Install the Forge CLI and set up your development environment
44
icon: Download
55
---
66

@@ -19,7 +19,123 @@ import { Tabs, Tab } from 'fumadocs-ui/components/tabs';
1919
Forge uses Go generics extensively for type-safe dependency injection. Go 1.21 or later is required.
2020
</Callout>
2121

22-
## Install Forge
22+
## Install the Forge CLI
23+
24+
The Forge CLI (`forge`) is the primary tool for developing, building, and managing Forge applications. It provides hot-reload development servers, code generation, database migrations, and more.
25+
26+
<Tabs items={["Homebrew (macOS/Linux)", "Go Install", "Scoop (Windows)", "Binary Download", "Linux Packages", "Docker"]}>
27+
<Tab value="Homebrew (macOS/Linux)">
28+
29+
The recommended way to install on macOS and Linux:
30+
31+
```bash
32+
brew install xraph/tap/forge
33+
```
34+
35+
To upgrade to the latest version:
36+
37+
```bash
38+
brew upgrade xraph/tap/forge
39+
```
40+
41+
</Tab>
42+
<Tab value="Go Install">
43+
44+
If you already have Go installed:
45+
46+
```bash
47+
go install github.com/xraph/forge/cmd/forge@latest
48+
```
49+
50+
Make sure `$GOPATH/bin` (or `$HOME/go/bin`) is in your `PATH`.
51+
52+
</Tab>
53+
<Tab value="Scoop (Windows)">
54+
55+
Install using [Scoop](https://scoop.sh):
56+
57+
```bash
58+
scoop bucket add xraph https://github.com/xraph/scoop-bucket
59+
scoop install forge
60+
```
61+
62+
To upgrade:
63+
64+
```bash
65+
scoop update forge
66+
```
67+
68+
</Tab>
69+
<Tab value="Binary Download">
70+
71+
Download the pre-built binary for your platform from the [GitHub Releases](https://github.com/xraph/forge/releases) page.
72+
73+
1. Download the archive for your OS and architecture (e.g., `forge-x.x.x-darwin-arm64.tar.gz`)
74+
2. Extract the binary:
75+
76+
```bash
77+
tar -xzf forge-*.tar.gz
78+
```
79+
80+
3. Move it to a directory in your `PATH`:
81+
82+
```bash
83+
sudo mv forge /usr/local/bin/
84+
```
85+
86+
4. Verify:
87+
88+
```bash
89+
forge version
90+
```
91+
92+
</Tab>
93+
<Tab value="Linux Packages">
94+
95+
Pre-built `.deb`, `.rpm`, `.apk`, and Arch Linux packages are available on the [GitHub Releases](https://github.com/xraph/forge/releases) page.
96+
97+
```bash
98+
# Debian / Ubuntu
99+
sudo dpkg -i forge_*.deb
100+
101+
# Fedora / RHEL
102+
sudo rpm -i forge_*.rpm
103+
104+
# Alpine
105+
sudo apk add --allow-untrusted forge_*.apk
106+
```
107+
108+
</Tab>
109+
<Tab value="Docker">
110+
111+
The Forge CLI is also available as a Docker image:
112+
113+
```bash
114+
docker pull ghcr.io/xraph/forge:latest
115+
```
116+
117+
Run it:
118+
119+
```bash
120+
docker run --rm ghcr.io/xraph/forge:latest version
121+
```
122+
123+
</Tab>
124+
</Tabs>
125+
126+
### Verify the CLI
127+
128+
After installation, confirm the CLI is available:
129+
130+
```bash
131+
forge version
132+
```
133+
134+
You should see version, commit, and build information printed to the terminal.
135+
136+
## Add Forge to Your Project
137+
138+
Once the CLI is installed, set up Forge as a Go dependency in your project.
23139

24140
<Steps>
25141
<Step>
@@ -51,9 +167,9 @@ go get github.com/xraph/forge/extensions/grpc@latest
51167
</Step>
52168

53169
<Step>
54-
### Verify the installation
170+
### Verify the library
55171

56-
Create a minimal `main.go` to confirm everything works:
172+
Create a minimal `main.go` to confirm the library is working:
57173

58174
```go
59175
package main
@@ -71,12 +187,13 @@ func main() {
71187
}
72188
```
73189

74-
Run it:
190+
Run it using the Forge CLI:
75191

76192
```bash
77-
go run main.go
78-
# Forge app created: install-check
193+
forge dev
79194
```
195+
196+
You should see the Forge startup banner with your application name and the address it is listening on.
80197
</Step>
81198
</Steps>
82199

docs/content/docs/forge/quick-start.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This guide walks you through creating your first Forge application from scratch.
1414

1515
<Callout type="info">
1616
Forge requires **Go 1.21 or later**. Check your version with `go version`.
17+
Make sure you have the Forge CLI installed. See the [Installation](/docs/forge/installation) guide.
1718
</Callout>
1819

1920
## Build Your First Server
@@ -81,10 +82,10 @@ func main() {
8182
### Run your application
8283

8384
```bash
84-
go run main.go
85+
forge dev
8586
```
8687

87-
You should see a startup banner with your application name, version, and the address it is listening on.
88+
The Forge CLI starts a development server with hot reload enabled by default. You should see a startup banner with your application name, version, and the address it is listening on.
8889
</Step>
8990

9091
<Step>

0 commit comments

Comments
 (0)