Skip to content

Commit 4d56eda

Browse files
refactor: clean and reorganize documentation structure
- Consolidate 16 scattered files into 8 focused documents - Remove ~60% duplicate content across CLI and deployment docs - Create clear docs/ structure with logical organization - Merge 5 enhancement files into single comprehensive guide - Keep CLAUDE.md and README.md in root as required - Remove memory.md from git tracking (added to .gitignore) - Eliminate redundant deployment/ and enhancement/ subdirectories New clean structure: - docs/CLI_GUIDE.md - Complete CLI documentation - docs/DEPLOYMENT_GUIDE.md - Unified deployment instructions - docs/CONTENT_ENHANCEMENT_GUIDE.md - H2-only content principles - docs/ARCHITECTURE.md - Technical details - docs/QUICK_REFERENCE.md - Cheat sheet - docs/DEPRECATED.md - Migration guide - docs/RELEASE_NOTES.md - Version history - docs/examples/ - Example content
1 parent 01140d6 commit 4d56eda

15 files changed

+400
-2687
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Thumbs.db
4545

4646
# Personal/development files
4747
CLAUDE.md
48+
memory.md
4849
repomix*
4950
.repomixignore
5051
.github/FUNDING.yml
File renamed without changes.

docs/CLI_GUIDE.md

Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
# Gist CLI: Complete User Guide
2+
3+
## Overview
4+
5+
The Gist CLI is a powerful, git-style command-line tool for managing GitHub Gists, designed for seamless blog publishing and content management. Built with clean architecture principles, it provides a comprehensive set of tools for creating, managing, and synchronizing your blog posts.
6+
7+
## Features
8+
9+
- 📝 **Direct Publishing** - Create gists directly from files
10+
- 📋 **List & Browse** - View all your public gists
11+
- 🔍 **Search by Tags** - Filter gists using hashtags
12+
- 🔄 **Sync** - Keep local cache up-to-date with GitHub
13+
- 🔒 **Privacy Control** - Create private or public gists
14+
- 🎨 **Interactive TUI** - Terminal UI for gist management
15+
16+
## Installation
17+
18+
### Quick Install
19+
20+
```bash
21+
# Clone the repository
22+
git clone https://github.com/yourusername/gist
23+
cd gist
24+
25+
# Build and install
26+
make build
27+
make install-cli
28+
29+
# Verify installation
30+
gist version
31+
```
32+
33+
### Manual Installation
34+
35+
```bash
36+
# Build binary
37+
go build -o gist gist.go
38+
39+
# Install to system path
40+
sudo cp gist /usr/local/bin/
41+
```
42+
43+
## Configuration
44+
45+
### Authentication Methods
46+
47+
1. **Environment Variables**
48+
```bash
49+
export GITHUB_USER="your-github-username"
50+
export GITHUB_TOKEN="ghp_your_personal_access_token"
51+
```
52+
53+
2. **Dotenv File**
54+
Create a `.env` file in your project or home directory:
55+
```
56+
GITHUB_USER=your-username
57+
GITHUB_PERSONAL_ACCESS_TOKEN=ghp_your_token_here
58+
```
59+
60+
3. **Interactive Setup**
61+
```bash
62+
# Initialize configuration
63+
gist init
64+
```
65+
66+
### Token Requirements
67+
68+
Your GitHub personal access token needs:
69+
- `gist` scope to create and manage gists
70+
- Optional `read:user` for profile access
71+
72+
## Basic Workflow
73+
74+
### 1. Create Content
75+
76+
Write your posts in Markdown:
77+
```bash
78+
vim my-post.md
79+
```
80+
81+
### 2. Stage Changes
82+
83+
```bash
84+
# Stage a new post (private by default)
85+
gist add my-post.md -d "My Post Title #tag1 #tag2"
86+
87+
# Stage as public post
88+
gist add -p my-post.md -d "Public Post #blog"
89+
90+
# Stage multiple files
91+
gist add file1.md file2.md -d "Multi-file post"
92+
```
93+
94+
### 3. Check Status
95+
96+
```bash
97+
gist status
98+
99+
# Example output:
100+
# Changes to be pushed (2):
101+
# new file: my-post.md
102+
# → My Post Title #tag1 #tag2
103+
# new file: another.md
104+
# → Another Post #blog
105+
```
106+
107+
### 4. Push to GitHub
108+
109+
```bash
110+
gist push
111+
```
112+
113+
## Commands Reference
114+
115+
| Command | Alias | Description |
116+
|---------|-------|-------------|
117+
| `gist init` | | Initialize configuration |
118+
| `gist status` | `st` | Show staged changes |
119+
| `gist add` | | Stage files for upload |
120+
| `gist rm` | `remove` | Stage gist for deletion |
121+
| `gist tag` | | Add tags to a gist |
122+
| `gist push` | | Upload changes to GitHub |
123+
| `gist pull` | | Sync from GitHub |
124+
| `gist list` | `ls` | List all gists |
125+
| `gist show` | | Show gist details |
126+
| `gist log` | | Show gist history |
127+
| `gist diff` | | Show staged changes |
128+
| `gist search` | | Search gists |
129+
| `gist reset` | | Unstage all changes |
130+
| `gist config` | | Manage configuration |
131+
| `gist clean` | | Remove cache |
132+
| `gist help` | | Show help |
133+
| `gist version` | | Show version |
134+
135+
## Advanced Features
136+
137+
### Manage Existing Posts
138+
139+
```bash
140+
# Pull latest gists
141+
gist pull
142+
143+
# List posts
144+
gist list
145+
146+
# Search gists
147+
gist search docker
148+
149+
# Show gist details
150+
gist show abc123d
151+
```
152+
153+
### Modify Posts
154+
155+
```bash
156+
# Add tags
157+
gist tag abc123d tutorial featured
158+
159+
# Remove post
160+
gist rm abc123d
161+
162+
# Toggle visibility
163+
gist toggle abc123d
164+
```
165+
166+
## Caching
167+
168+
- **Location**: `~/.gist-cache/`
169+
- **TTL**: 5 minutes
170+
- **Force Refresh**: `gist sync`
171+
172+
## Best Practices
173+
174+
1. Always pull before making changes
175+
```bash
176+
gist pull
177+
gist status
178+
```
179+
180+
2. Use descriptive commit messages
181+
```bash
182+
gist add post.md -d "Tutorial: Docker multi-stage builds #docker #tutorial"
183+
```
184+
185+
3. Review before pushing
186+
```bash
187+
gist diff
188+
gist push
189+
```
190+
191+
4. Keep cache fresh
192+
```bash
193+
gist pull
194+
```
195+
196+
5. Organize with tags
197+
```bash
198+
gist tag old-post-id archive deprecated
199+
```
200+
201+
## Troubleshooting
202+
203+
### Permission Issues
204+
205+
```bash
206+
# If /usr/local/bin is not writable
207+
sudo make install-cli
208+
209+
# Or install to user directory
210+
mkdir -p ~/bin
211+
cp gist ~/bin/
212+
export PATH="$HOME/bin:$PATH"
213+
```
214+
215+
### Token Problems
216+
217+
```bash
218+
# Test configuration
219+
gist config
220+
gist pull
221+
222+
# Update token if needed
223+
gist config github.token ghp_new_token
224+
```
225+
226+
### Cache Problems
227+
228+
```bash
229+
# Clear and rebuild cache
230+
gist clean
231+
gist pull
232+
```
233+
234+
## Tips & Tricks
235+
236+
### Shell Aliases
237+
238+
Add to `.bashrc` or `.zshrc`:
239+
```bash
240+
alias gs='gist status'
241+
alias ga='gist add'
242+
alias gp='gist push'
243+
alias gl='gist list'
244+
alias gd='gist diff'
245+
```
246+
247+
### Auto-sync
248+
249+
Add to crontab for hourly sync:
250+
```bash
251+
0 * * * * /usr/local/bin/gist pull
252+
```
253+
254+
## Contributing
255+
256+
1. Fork the repository
257+
2. Create your feature branch (`git checkout -b feature/amazing`)
258+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
259+
4. Push to the branch (`git push origin feature/amazing`)
260+
5. Open a Pull Request
261+
262+
## License
263+
264+
MIT License - see LICENSE file for details

0 commit comments

Comments
 (0)