|
1 | 1 | # Getting Started with Git CMS |
2 | 2 |
|
3 | | -Welcome to **Git CMS**! This tool allows you to write and manage blog posts using Git—the same technology developers use to track code—but with a simple interface that works like a regular app. |
4 | | - |
5 | | -Follow these steps to get up and running. |
| 3 | +This quick guide is the lightweight entry point. For the full walkthrough, use [`docs/GETTING_STARTED.md`](docs/GETTING_STARTED.md). |
6 | 4 |
|
7 | 5 | --- |
8 | 6 |
|
9 | | -## 1. Prerequisites |
10 | | - |
11 | | -Before you start, you need two things installed on your computer: |
| 7 | +## Prerequisites |
12 | 8 |
|
13 | | -1. **Git**: [Download and install Git here](https://git-scm.com/downloads). (Choose the default options during installation). |
14 | | -2. **Node.js**: [Download and install Node.js here](https://nodejs.org/). (Choose the "LTS" version). |
| 9 | +- Git |
| 10 | +- Node.js 22+ |
| 11 | +- Docker Desktop (recommended for safe testing) |
15 | 12 |
|
16 | 13 | --- |
17 | 14 |
|
18 | | -## 2. Installation |
19 | | - |
20 | | -You can install Git CMS directly on your computer or run it using **Docker**. |
21 | | - |
22 | | -### Option A: Direct Installation |
23 | | -1. Open your **Terminal** (on Mac/Linux) or **Command Prompt/PowerShell** (on Windows). |
24 | | -2. Type the following commands one by one: |
25 | | - ```bash |
26 | | - # Download the tool |
27 | | - git clone https://github.com/clduab11/git-cms.git |
28 | | - |
29 | | - # Enter the folder |
30 | | - cd git-cms |
31 | | - |
32 | | - # Install the helper files |
33 | | - npm install |
34 | | - |
35 | | - # Make the 'git-cms' command available everywhere on your computer |
36 | | - npm link |
37 | | - ``` |
38 | | - |
39 | | -### Option B: Using Docker (Recommended for isolation) |
40 | | -If you have [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed, you can run the CMS without installing Node.js: |
41 | | -1. Download the tool: `git clone https://github.com/clduab11/git-cms.git` |
42 | | -2. Enter the folder: `cd git-cms` |
43 | | -3. Run with Docker: `docker compose up app` |
44 | | - *Note: By default, this will save posts inside the `git-cms` folder. See Section 3 to change this.* |
| 15 | +## Installation |
45 | 16 |
|
46 | | ---- |
| 17 | +### Option A: Local CLI Install |
47 | 18 |
|
48 | | -## 3. Setting Up Your "Content Home" |
| 19 | +```bash |
| 20 | +git clone https://github.com/flyingrobots/git-cms.git |
| 21 | +cd git-cms |
| 22 | +npm install |
| 23 | +npm link |
| 24 | +``` |
49 | 25 |
|
50 | | -Git CMS doesn't save your posts inside the tool itself; it saves them in a "Repository" (a special folder) of your choice. |
| 26 | +### Option B: Docker (Recommended) |
51 | 27 |
|
52 | | -1. Create a new folder for your blog posts (e.g., `my-awesome-blog`). |
53 | | -2. Enter that folder in your terminal and "initialize" it: |
54 | | - ```bash |
55 | | - mkdir my-awesome-blog |
56 | | - cd my-awesome-blog |
57 | | - git init |
58 | | - ``` |
59 | | -3. **Crucial Step**: Tell Git CMS to use this folder. You do this by setting an "Environment Variable" named `GIT_CMS_REPO` to the path of this folder. |
60 | | - * **Mac/Linux**: `export GIT_CMS_REPO=/Users/yourname/my-awesome-blog` |
61 | | - * **Windows**: `$env:GIT_CMS_REPO="C:\Users\yourname\my-awesome-blog"` |
| 28 | +```bash |
| 29 | +git clone https://github.com/flyingrobots/git-cms.git |
| 30 | +cd git-cms |
| 31 | +npm run setup |
| 32 | +npm run dev |
| 33 | +``` |
62 | 34 |
|
63 | | ---- |
| 35 | +Open the UI at [http://localhost:4638/](http://localhost:4638/). |
64 | 36 |
|
65 | | -## 4. Running the CMS |
| 37 | +--- |
66 | 38 |
|
67 | | -Now you are ready to start the interface! |
| 39 | +## First Article |
68 | 40 |
|
69 | | -1. In your terminal, type: |
70 | | - ```bash |
71 | | - git-cms serve |
72 | | - ``` |
73 | | -2. You will see a message: `[git-cms] Admin UI: http://localhost:4638/` |
74 | | -3. Open your web browser (Chrome, Safari, or Edge) and go to **http://localhost:4638/**. |
| 41 | +1. Click `+ New Article`. |
| 42 | +2. Set a slug like `my-first-post`. |
| 43 | +3. Add title + body content. |
| 44 | +4. Click `Save Draft`. |
| 45 | +5. Click `Publish` when ready. |
75 | 46 |
|
76 | 47 | --- |
77 | 48 |
|
78 | | -## 5. Writing Your First Post |
| 49 | +## CLI Basics |
79 | 50 |
|
80 | | -1. Click the **+ New Article** button on the left. |
81 | | -2. **Slug**: Enter a short ID for your post (e.g., `my-first-post`). No spaces! |
82 | | -3. **Title**: Enter the title of your article. |
83 | | -4. **Content**: Type your post in the large box. You can use [Markdown](https://www.markdownguide.org/basic-syntax/) to add formatting like **bold** or *italics*. |
84 | | -5. Click **Save Draft**. |
| 51 | +```bash |
| 52 | +# Draft reads content from stdin |
| 53 | +echo "# Hello" | git cms draft hello-world "Hello World" |
85 | 54 |
|
86 | | -### To Make it Public: |
87 | | -When you are happy with your post, click the **Publish** button. This marks the post as "live." |
| 55 | +# List drafts |
| 56 | +git cms list |
88 | 57 |
|
89 | | ---- |
90 | | -
|
91 | | -## 6. Managing Images and Files |
| 58 | +# Publish |
| 59 | +git cms publish hello-world |
92 | 60 |
|
93 | | -You can add images to your posts easily: |
94 | | -1. In the editor, click the **Attach File** button at the bottom. |
95 | | -2. Select an image from your computer. |
96 | | -3. Git CMS will "chunk" the image, store it safely in Git, and automatically add the code to your post so the image shows up. |
| 61 | +# Show article |
| 62 | +git cms show hello-world |
| 63 | +``` |
97 | 64 |
|
98 | 65 | --- |
99 | 66 |
|
100 | | -## 7. Advanced: CLI Power (Optional) |
| 67 | +## Safety Notes |
101 | 68 |
|
102 | | -If you prefer using the terminal instead of the web browser, you can use these commands: |
103 | | -* `git-cms list`: See all your drafts. |
104 | | -* `git-cms show <slug>`: Read a post in the terminal. |
105 | | -* `git-cms publish <slug>`: Publish a draft. |
106 | | -
|
107 | | ---- |
| 69 | +- Prefer Docker workflows while learning. |
| 70 | +- Use a dedicated test repository for local CLI experimentation. |
| 71 | +- Avoid running low-level Git plumbing in repositories you care about. |
108 | 72 |
|
109 | | -### Troubleshooting |
110 | | -* **"Command not found"**: Ensure you ran `npm link` in the `git-cms` folder. |
111 | | -* **"Not a git repository"**: Ensure you ran `git init` inside your content folder and that your `GIT_CMS_REPO` path is correct. |
| 73 | +See [`TESTING_GUIDE.md`](TESTING_GUIDE.md) for safety and cleanup procedures. |
0 commit comments