appydave-tools 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/CLAUDE.md +577 -0
- data/README.md +52 -3
- data/exe/ad_config +6 -0
- data/exe/gpt_context +6 -0
- data/exe/prompt_tools +6 -0
- data/exe/subtitle_manager +6 -0
- data/exe/youtube_automation +6 -0
- data/exe/youtube_manager +6 -0
- data/lib/appydave/tools/version.rb +1 -1
- data/package.json +1 -1
- metadata +16 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f220893e70bf53b9a6da3b1a46857c3221f2672aba453616e4bab5b87528d65
|
|
4
|
+
data.tar.gz: 1e5aef7918151c423393131dcfc8e2538cd6b95632b2a58dd8f23a1c864f1c06
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe5e90a6677bcb82e0d1af5fde786eba72d2380f1dcbe291b4fe998b239f71c6381bd33b7dfa87755e2b9390d97241387422c84522d3763236e87688668ed861
|
|
7
|
+
data.tar.gz: 70abc6727a6e318d329097b42a72fc8de4061965d60e7d33d013fa361b00a1c6e3b9eabe94a7a15a5e993523ea6ba96b69231c83bdae0f030f16ad0ec4a1e50d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [0.14.1](https://github.com/appydave/appydave-tools/compare/v0.14.0...v0.14.1) (2025-08-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* updagte claude and readmegs ([308af2f](https://github.com/appydave/appydave-tools/commit/308af2f3085f6bfd054c9d12154da7055d47bb3b))
|
|
7
|
+
|
|
8
|
+
# [0.14.0](https://github.com/appydave/appydave-tools/compare/v0.13.0...v0.14.0) (2025-04-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* 'cops' ([51bc6f2](https://github.com/appydave/appydave-tools/commit/51bc6f2e7bd08a3aff165e6d488f3f99c4ab7f45))
|
|
14
|
+
* ci ([11e934b](https://github.com/appydave/appydave-tools/commit/11e934b2f4f6be2457dea65c46b37ae350480b91))
|
|
15
|
+
* cops ([94817c6](https://github.com/appydave/appydave-tools/commit/94817c6ecc930dcb79a59fa7d6d977ba2aa197b9))
|
|
16
|
+
* update gem file ([9b0d21d](https://github.com/appydave/appydave-tools/commit/9b0d21d278a3c2bd6669122f33e55f084c76997b))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* update gem file ([b15dbcb](https://github.com/appydave/appydave-tools/commit/b15dbcbb13e0025f82ab54d8a87104d0d0fa4e14))
|
|
22
|
+
|
|
1
23
|
# [0.13.0](https://github.com/appydave/appydave-tools/compare/v0.12.0...v0.13.0) (2024-12-03)
|
|
2
24
|
|
|
3
25
|
|
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Common Commands
|
|
6
|
+
|
|
7
|
+
### Development Setup
|
|
8
|
+
```bash
|
|
9
|
+
bin/setup # Install dependencies and setup development environment
|
|
10
|
+
bin/console # Interactive Ruby console for experimentation
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### CLI Tools Usage
|
|
14
|
+
|
|
15
|
+
**Installation Note:** When installed as a gem (`gem install appydave-tools`), these tools are available as system commands. During development, run them from `bin/` directory as `bin/script_name.rb`.
|
|
16
|
+
|
|
17
|
+
#### Quick Reference Index
|
|
18
|
+
|
|
19
|
+
| Command | Gem Command | Description |
|
|
20
|
+
|---------|-------------|-------------|
|
|
21
|
+
| **GPT Context** | `gpt_context` | Collect project files for AI context ⭐ |
|
|
22
|
+
| **YouTube Manager** | `youtube_manager` | Manage YouTube video metadata via API |
|
|
23
|
+
| **Subtitle Manager** | `subtitle_manager` | Process and join SRT subtitle files |
|
|
24
|
+
| **Prompt Tools** | `prompt_tools` | AI prompt completion workflows |
|
|
25
|
+
| **YouTube Automation** | `youtube_automation` | Automated YouTube workflows with GPT agents |
|
|
26
|
+
| **Configuration** | `ad_config` | Manage appydave-tools configuration files |
|
|
27
|
+
| **Move Images** | N/A (dev only) | Organize video project images (development tool) |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
#### 1. GPT Context Gatherer (`bin/gpt_context.rb`) ⭐ PRIMARY TOOL
|
|
32
|
+
Collect and organize project files for AI context:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Basic usage - gather files with debug output and file output
|
|
36
|
+
bin/gpt_context.rb -i '**/*.rb' -e 'spec/**/*' -d -o context.txt
|
|
37
|
+
|
|
38
|
+
# Multiple formats and patterns
|
|
39
|
+
bin/gpt_context.rb -i 'lib/**/*.rb' -i 'bin/**/*.rb' -f tree,content -d
|
|
40
|
+
|
|
41
|
+
# Advanced web project filtering
|
|
42
|
+
bin/gpt_context.rb -i 'apps/**/*.ts' -i 'apps/**/*.tsx' -e '**/node_modules/**/*' -e '**/_generated/**/*' -d -f tree -o typescript.txt
|
|
43
|
+
|
|
44
|
+
# Tree view only for project structure
|
|
45
|
+
bin/gpt_context.rb -i '**/*' -e '**/node_modules/**/*' -e '.git/**/*' -f tree -d
|
|
46
|
+
|
|
47
|
+
# Line-limited content gathering
|
|
48
|
+
bin/gpt_context.rb -i '**/*.rb' -l 20 -f content -d
|
|
49
|
+
|
|
50
|
+
# Multiple output targets
|
|
51
|
+
bin/gpt_context.rb -i 'docs/**/*' -f tree,content -o clipboard -o docs-context.txt
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
See detailed usage guide: [docs/usage/gpt-context.md](./docs/usage/gpt-context.md)
|
|
55
|
+
|
|
56
|
+
#### 2. YouTube Manager (`bin/youtube_manager.rb`)
|
|
57
|
+
Manage YouTube video metadata via YouTube API:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Get video details
|
|
61
|
+
bin/youtube_manager.rb get --video-id VIDEO_ID
|
|
62
|
+
|
|
63
|
+
# Update video metadata
|
|
64
|
+
bin/youtube_manager.rb update --video-id ID --title "New Title"
|
|
65
|
+
bin/youtube_manager.rb update --video-id ID --description "New Description"
|
|
66
|
+
bin/youtube_manager.rb update --video-id ID --tags "tag1,tag2,tag3"
|
|
67
|
+
bin/youtube_manager.rb update --video-id ID --category-id 28
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Features:**
|
|
71
|
+
- YouTube API authorization and authentication
|
|
72
|
+
- Retrieve video details, captions, and metadata
|
|
73
|
+
- Update video title, description, tags, and category
|
|
74
|
+
- Generate detailed reports
|
|
75
|
+
|
|
76
|
+
#### 3. Subtitle Manager (`bin/subtitle_manager.rb`)
|
|
77
|
+
Process and manage SRT subtitle files:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Clean and normalize SRT files
|
|
81
|
+
bin/subtitle_manager.rb clean -f input.srt -o cleaned.srt
|
|
82
|
+
|
|
83
|
+
# Join multiple SRT files
|
|
84
|
+
bin/subtitle_manager.rb join -d ./subtitles -f "*.srt" -o merged.srt
|
|
85
|
+
bin/subtitle_manager.rb join -f "part1.srt,part2.srt" -s asc -b 100 -o final.srt
|
|
86
|
+
|
|
87
|
+
# Join with options
|
|
88
|
+
bin/subtitle_manager.rb join -d ./subs -f "*.srt" -s inferred -b 200 -o output.srt -L detail
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Options:**
|
|
92
|
+
- `-d, --directory` - Directory containing SRT files
|
|
93
|
+
- `-f, --files` - File pattern or comma-separated list
|
|
94
|
+
- `-s, --sort` - Sort order: asc, desc, or inferred (default)
|
|
95
|
+
- `-b, --buffer` - Buffer between files in milliseconds (default: 100)
|
|
96
|
+
- `-L, --log-level` - Log level: none, info, detail
|
|
97
|
+
|
|
98
|
+
**Note:** Internal module is called `SubtitleMaster` but CLI tool is `subtitle_manager`
|
|
99
|
+
|
|
100
|
+
#### 4. Prompt Tools (`bin/prompt_tools.rb`)
|
|
101
|
+
AI prompt completion workflows:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Run AI prompt completion
|
|
105
|
+
bin/prompt_tools.rb completion [options]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Features:**
|
|
109
|
+
- OpenAI GPT integration
|
|
110
|
+
- Prompt execution and management
|
|
111
|
+
|
|
112
|
+
#### 5. YouTube Automation (`bin/youtube_automation.rb`)
|
|
113
|
+
Automated YouTube workflows using GPT agents:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Run automation sequence
|
|
117
|
+
bin/youtube_automation.rb -s 01-1
|
|
118
|
+
bin/youtube_automation.rb -s 01-1 -d # with debug output
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Options:**
|
|
122
|
+
- `-s, --sequence` - Sequence number (required, e.g., 01-1)
|
|
123
|
+
- `-d, --debug` - Enable debug mode
|
|
124
|
+
|
|
125
|
+
#### 6. Configuration Tool (`bin/configuration.rb`)
|
|
126
|
+
Manage appydave-tools configuration files:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# List all configurations
|
|
130
|
+
bin/configuration.rb -l
|
|
131
|
+
|
|
132
|
+
# Print specific configuration keys
|
|
133
|
+
bin/configuration.rb -p settings,channels
|
|
134
|
+
|
|
135
|
+
# Create missing configuration files
|
|
136
|
+
bin/configuration.rb -c
|
|
137
|
+
|
|
138
|
+
# Edit configurations in VS Code
|
|
139
|
+
bin/configuration.rb -e
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Configuration Types:**
|
|
143
|
+
- **settings** - General settings and paths
|
|
144
|
+
- **channels** - YouTube channel definitions (code, name, youtube_handle)
|
|
145
|
+
- **youtube_automation** - Automation workflow configurations
|
|
146
|
+
|
|
147
|
+
#### 7. Move Images (`bin/move_images.rb`)
|
|
148
|
+
Organize and rename downloaded images into video project asset folders.
|
|
149
|
+
|
|
150
|
+
**Purpose:** Batch move and rename images from a download folder into organized video project asset directories with proper naming conventions.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Move images to video project assets folder
|
|
154
|
+
bin/move_images.rb -f <project-folder> <section> <prefix>
|
|
155
|
+
|
|
156
|
+
# Example: Move images for intro section of project b40
|
|
157
|
+
bin/move_images.rb -f b40 intro b40
|
|
158
|
+
# Result: Creates files like b40-intro-1.jpg, b40-intro-2.jpg in /path/to/b40/assets/intro/
|
|
159
|
+
|
|
160
|
+
# Example: Move thumbnail images
|
|
161
|
+
bin/move_images.rb -f b40 thumb b40
|
|
162
|
+
# Result: Creates files like b40-thumb-1.jpg, b40-thumb-2.jpg in /path/to/b40/assets/thumb/
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Configuration:**
|
|
166
|
+
- **Source:** `~/Sync/smart-downloads/download-images/` (downloads folder)
|
|
167
|
+
- **Destination:** `/Volumes/Expansion/Sync/tube-channels/video-projects/<folder>/assets/<section>/`
|
|
168
|
+
- **Supported sections:** intro, outro, content, teaser, thumb (or any custom section name)
|
|
169
|
+
- **File format:** Processes `.jpg` files only
|
|
170
|
+
|
|
171
|
+
**Arguments:**
|
|
172
|
+
- `-f, --folder` - Project folder name (e.g., b40, b41, etc.)
|
|
173
|
+
- `<section>` - Asset section name (intro, outro, content, teaser, thumb)
|
|
174
|
+
- `<prefix>` - Filename prefix (typically matches project folder)
|
|
175
|
+
|
|
176
|
+
**Workflow:**
|
|
177
|
+
1. Download images to smart-downloads folder
|
|
178
|
+
2. Run move_images with project folder, section, and prefix
|
|
179
|
+
3. Images are renamed sequentially and moved to organized asset directory
|
|
180
|
+
4. Automatically creates section subdirectory if it doesn't exist
|
|
181
|
+
|
|
182
|
+
**Note:** This is a development/workflow tool specific to video project organization. Not installed as a gem command.
|
|
183
|
+
|
|
184
|
+
#### 8. Bank Reconciliation (`bin/bank_reconciliation.rb`) 🗄️ DEPRECATED
|
|
185
|
+
Bank transaction reconciliation tool - **DEPRECATED, DO NOT USE**
|
|
186
|
+
|
|
187
|
+
**WARNING:** This tool contains deprecated code and should not be used for new work. Code has been moved to `lib/appydave/tools/deprecated/bank_reconciliation/`
|
|
188
|
+
|
|
189
|
+
### Testing & Quality
|
|
190
|
+
```bash
|
|
191
|
+
rake spec # Run all RSpec tests
|
|
192
|
+
rake # Default task: compile, spec (clobber compile spec)
|
|
193
|
+
guard # Watch files and auto-run tests + rubocop on changes
|
|
194
|
+
bundle exec rspec -f doc # Run tests with detailed documentation format
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Linting & Style
|
|
198
|
+
```bash
|
|
199
|
+
rubocop # Run RubyGem style checks
|
|
200
|
+
bundle exec rubocop --format clang # Run with clang format (as used in Guard)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Build & Release
|
|
204
|
+
```bash
|
|
205
|
+
rake build # Build the gem
|
|
206
|
+
rake publish # Build and publish gem to RubyGems.org
|
|
207
|
+
rake clean # Remove built *.gem files
|
|
208
|
+
gem build # Build gemspec into .gem file
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Architecture Overview
|
|
212
|
+
|
|
213
|
+
This is a Ruby gem called `appydave-tools` that provides YouTube automation and content creation tools.
|
|
214
|
+
|
|
215
|
+
### Core Structure
|
|
216
|
+
- **CLI Tools**: Multiple executable scripts in `bin/` for different functionalities
|
|
217
|
+
- **Modular Design**: Organized into focused modules under `lib/appydave/tools/`
|
|
218
|
+
- **Configuration System**: Flexible config management with channel and project settings
|
|
219
|
+
- **Type System**: Custom type classes for data validation and transformation
|
|
220
|
+
|
|
221
|
+
### Key Components
|
|
222
|
+
|
|
223
|
+
#### CLI Actions (`lib/appydave/tools/cli_actions/`)
|
|
224
|
+
- Base action pattern for command-line operations
|
|
225
|
+
- YouTube video management (get, update)
|
|
226
|
+
- AI prompt completion workflows
|
|
227
|
+
|
|
228
|
+
#### Configuration (`lib/appydave/tools/configuration/`)
|
|
229
|
+
- Multi-channel YouTube setup support
|
|
230
|
+
- Project folder management (content, video, published, abandoned)
|
|
231
|
+
- OpenAI integration configuration
|
|
232
|
+
- Channel-specific settings (code, name, youtube_handle)
|
|
233
|
+
|
|
234
|
+
#### GPT Context (`lib/appydave/tools/gpt_context/`)
|
|
235
|
+
- File collection for AI context gathering
|
|
236
|
+
- Content filtering and organization
|
|
237
|
+
- Output handling for various formats
|
|
238
|
+
|
|
239
|
+
#### YouTube Management (`lib/appydave/tools/youtube_manager/`)
|
|
240
|
+
- YouTube API authorization and authentication
|
|
241
|
+
- Video metadata retrieval and updates
|
|
242
|
+
- Caption/subtitle management
|
|
243
|
+
- Detailed reporting capabilities
|
|
244
|
+
|
|
245
|
+
#### Subtitle Management (`lib/appydave/tools/subtitle_manager/`)
|
|
246
|
+
- SRT file cleaning and normalization
|
|
247
|
+
- Multi-part subtitle joining
|
|
248
|
+
- Timeline synchronization
|
|
249
|
+
|
|
250
|
+
### Type System (`lib/appydave/tools/types/`)
|
|
251
|
+
- `BaseModel`: Foundation for data models with validation
|
|
252
|
+
- `ArrayType` & `HashType`: Collection type wrappers
|
|
253
|
+
- `IndifferentAccessHash`: Symbol/string key flexibility
|
|
254
|
+
|
|
255
|
+
## Development Conventions
|
|
256
|
+
|
|
257
|
+
### Ruby Style
|
|
258
|
+
- All Ruby files must start with `# frozen_string_literal: true`
|
|
259
|
+
- Follow existing code patterns and naming conventions
|
|
260
|
+
- Use the Guard setup for continuous testing during development
|
|
261
|
+
|
|
262
|
+
### Testing
|
|
263
|
+
- RSpec for all testing
|
|
264
|
+
- No `require` statements needed in spec files (handled by spec_helper)
|
|
265
|
+
- VCR for HTTP request mocking (YouTube API calls)
|
|
266
|
+
- SimpleCov for coverage reporting
|
|
267
|
+
|
|
268
|
+
### File Organization
|
|
269
|
+
- CLI executables in `bin/`
|
|
270
|
+
- Core library code in `lib/appydave/tools/`
|
|
271
|
+
- Tests mirror lib structure in `spec/`
|
|
272
|
+
- Configuration examples and docs in respective `_doc.md` files
|
|
273
|
+
|
|
274
|
+
## Key Dependencies
|
|
275
|
+
- `google-api-client`: YouTube API integration
|
|
276
|
+
- `ruby-openai`: OpenAI GPT integration
|
|
277
|
+
- `activemodel`: Data validation and modeling
|
|
278
|
+
- `clipboard`: System clipboard operations
|
|
279
|
+
- `dotenv`: Environment variable management
|
|
280
|
+
|
|
281
|
+
## Configuration Management
|
|
282
|
+
|
|
283
|
+
### Configuration Overview
|
|
284
|
+
The gem uses JSON configuration files for managing YouTube channels, OpenAI settings, and automation workflows.
|
|
285
|
+
|
|
286
|
+
**Configuration Tool:** `bin/configuration.rb`
|
|
287
|
+
|
|
288
|
+
### Setting Up Configuration
|
|
289
|
+
|
|
290
|
+
1. **List available configurations:**
|
|
291
|
+
```bash
|
|
292
|
+
bin/configuration.rb -l
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
2. **Create missing configuration files:**
|
|
296
|
+
```bash
|
|
297
|
+
bin/configuration.rb -c
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
3. **View configuration values:**
|
|
301
|
+
```bash
|
|
302
|
+
bin/configuration.rb -p settings,channels,youtube_automation
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
4. **Edit configurations in VS Code:**
|
|
306
|
+
```bash
|
|
307
|
+
bin/configuration.rb -e
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Configuration Types
|
|
311
|
+
|
|
312
|
+
#### 1. Settings Config
|
|
313
|
+
General application settings and paths.
|
|
314
|
+
|
|
315
|
+
**Typical structure:**
|
|
316
|
+
```json
|
|
317
|
+
{
|
|
318
|
+
"project_paths": {
|
|
319
|
+
"content": "/path/to/content",
|
|
320
|
+
"video": "/path/to/video",
|
|
321
|
+
"published": "/path/to/published",
|
|
322
|
+
"abandoned": "/path/to/abandoned"
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
#### 2. Channels Config
|
|
328
|
+
YouTube channel definitions for multi-channel management.
|
|
329
|
+
|
|
330
|
+
**Typical structure:**
|
|
331
|
+
```json
|
|
332
|
+
{
|
|
333
|
+
"channels": [
|
|
334
|
+
{
|
|
335
|
+
"code": "main",
|
|
336
|
+
"name": "Main Channel",
|
|
337
|
+
"youtube_handle": "@channelhandle"
|
|
338
|
+
}
|
|
339
|
+
]
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
#### 3. YouTube Automation Config
|
|
344
|
+
Automation workflow configurations and sequences.
|
|
345
|
+
|
|
346
|
+
#### 4. OpenAI Config (via dotenv)
|
|
347
|
+
OpenAI API integration settings managed through environment variables:
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
# .env file
|
|
351
|
+
OPENAI_API_KEY=your_api_key_here
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Configuration Locations
|
|
355
|
+
Configuration files are typically stored in:
|
|
356
|
+
- `~/.config/appydave-tools/` (user-level)
|
|
357
|
+
- Or project-specific locations as defined in settings
|
|
358
|
+
|
|
359
|
+
### Environment Variables
|
|
360
|
+
The gem uses `dotenv` for environment variable management. Create a `.env` file in your project root:
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
# Required for YouTube API
|
|
364
|
+
GOOGLE_CLIENT_ID=your_client_id
|
|
365
|
+
GOOGLE_CLIENT_SECRET=your_client_secret
|
|
366
|
+
|
|
367
|
+
# Required for OpenAI features
|
|
368
|
+
OPENAI_API_KEY=your_openai_api_key
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
**IMPORTANT:** Never commit `.env` files to version control. Ensure `.env` is in your `.gitignore`.
|
|
372
|
+
|
|
373
|
+
## Git Hooks & Security
|
|
374
|
+
|
|
375
|
+
### Pre-commit Hooks
|
|
376
|
+
This repository uses custom git hooks located in `.githooks/` directory.
|
|
377
|
+
|
|
378
|
+
**Setup:**
|
|
379
|
+
```bash
|
|
380
|
+
git config core.hookspath .githooks
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
**Current pre-commit checks:**
|
|
384
|
+
- ✅ Detects debug code: `binding.pry`, `byebug`, `debugger`
|
|
385
|
+
- ✅ Warns about: `console.log`, `console.dir`
|
|
386
|
+
- ✅ Excludes specific files: Gemfile, .json, .yml files
|
|
387
|
+
- ❌ **Does NOT check for secrets/API keys** (see Security Notes below)
|
|
388
|
+
|
|
389
|
+
**Force commit (bypass hooks):**
|
|
390
|
+
```bash
|
|
391
|
+
git commit --no-verify -m "message"
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### Security Notes
|
|
395
|
+
|
|
396
|
+
**⚠️ IMPORTANT SECURITY CONSIDERATIONS:**
|
|
397
|
+
|
|
398
|
+
1. **No Secret Scanning:** The current pre-commit hook does NOT scan for:
|
|
399
|
+
- API keys (OpenAI, Google, AWS, etc.)
|
|
400
|
+
- OAuth tokens or credentials
|
|
401
|
+
- Private keys or certificates
|
|
402
|
+
- Credit card numbers or financial data
|
|
403
|
+
- Email addresses or phone numbers
|
|
404
|
+
|
|
405
|
+
2. **Manual Vigilance Required:** Always review your commits for sensitive data before pushing.
|
|
406
|
+
|
|
407
|
+
3. **Recommended Secret Scanning Tools:**
|
|
408
|
+
|
|
409
|
+
#### Option 1: Gitleaks (Recommended for Ruby/Go projects)
|
|
410
|
+
|
|
411
|
+
**Installation (macOS):**
|
|
412
|
+
```bash
|
|
413
|
+
brew install gitleaks
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
**Setup as pre-commit hook:**
|
|
417
|
+
```bash
|
|
418
|
+
# Create .gitleaks.toml configuration
|
|
419
|
+
cat > .gitleaks.toml << 'EOF'
|
|
420
|
+
title = "Gitleaks Configuration"
|
|
421
|
+
|
|
422
|
+
[extend]
|
|
423
|
+
useDefault = true
|
|
424
|
+
|
|
425
|
+
[[rules]]
|
|
426
|
+
description = "AWS Access Key"
|
|
427
|
+
id = "aws-access-key"
|
|
428
|
+
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
|
|
429
|
+
|
|
430
|
+
[[rules]]
|
|
431
|
+
description = "OpenAI API Key"
|
|
432
|
+
id = "openai-api-key"
|
|
433
|
+
regex = '''sk-[a-zA-Z0-9]{48}'''
|
|
434
|
+
|
|
435
|
+
[[rules]]
|
|
436
|
+
description = "Google OAuth"
|
|
437
|
+
id = "google-oauth"
|
|
438
|
+
regex = '''[0-9]+-[0-9A-Za-z_]{32}\.apps\.googleusercontent\.com'''
|
|
439
|
+
|
|
440
|
+
[[rules]]
|
|
441
|
+
description = "Credit Card Numbers"
|
|
442
|
+
id = "credit-card"
|
|
443
|
+
regex = '''\b(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|6(?:011|5[0-9]{2})[0-9]{12}|(?:2131|1800|35\d{3})\d{11})\b'''
|
|
444
|
+
|
|
445
|
+
[allowlist]
|
|
446
|
+
paths = [
|
|
447
|
+
'''\.md$''',
|
|
448
|
+
'''^\.releaserc\.json$''',
|
|
449
|
+
'''CHANGELOG\.md'''
|
|
450
|
+
]
|
|
451
|
+
EOF
|
|
452
|
+
|
|
453
|
+
# Add to pre-commit hook (append to existing .githooks/pre-commit)
|
|
454
|
+
# Add after line 89 (before final 'end'):
|
|
455
|
+
echo "
|
|
456
|
+
# Gitleaks secret scanning
|
|
457
|
+
echo 'Running gitleaks scan...'
|
|
458
|
+
gitleaks protect --staged --verbose
|
|
459
|
+
if [ \$? -ne 0 ]; then
|
|
460
|
+
echo 'ERROR: Gitleaks found secrets in staged files'
|
|
461
|
+
echo 'Use --no-verify to bypass (NOT RECOMMENDED)'
|
|
462
|
+
exit 1
|
|
463
|
+
fi
|
|
464
|
+
" >> .githooks/pre-commit
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
**Manual scan:**
|
|
468
|
+
```bash
|
|
469
|
+
# Scan staged files
|
|
470
|
+
gitleaks protect --staged
|
|
471
|
+
|
|
472
|
+
# Scan entire repository
|
|
473
|
+
gitleaks detect
|
|
474
|
+
|
|
475
|
+
# Scan git history
|
|
476
|
+
gitleaks detect --verbose --log-opts="--all"
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
#### Option 2: git-secrets (AWS-focused)
|
|
480
|
+
|
|
481
|
+
**Installation (macOS):**
|
|
482
|
+
```bash
|
|
483
|
+
brew install git-secrets
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
**Setup:**
|
|
487
|
+
```bash
|
|
488
|
+
# Initialize git-secrets in repository
|
|
489
|
+
git secrets --install
|
|
490
|
+
git secrets --register-aws
|
|
491
|
+
|
|
492
|
+
# Add custom patterns
|
|
493
|
+
git secrets --add 'sk-[a-zA-Z0-9]{48}' # OpenAI
|
|
494
|
+
git secrets --add '[0-9]+-[0-9A-Za-z_]{32}\.apps\.googleusercontent\.com' # Google OAuth
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
#### Option 3: truffleHog (Deep history scanning)
|
|
498
|
+
|
|
499
|
+
**Installation:**
|
|
500
|
+
```bash
|
|
501
|
+
brew install trufflehog
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
**Usage:**
|
|
505
|
+
```bash
|
|
506
|
+
# Scan entire git history
|
|
507
|
+
trufflehog git file://. --json
|
|
508
|
+
|
|
509
|
+
# Scan from remote
|
|
510
|
+
trufflehog git https://github.com/user/repo
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
4. **`.gitignore` Critical Files:**
|
|
514
|
+
```gitignore
|
|
515
|
+
.env
|
|
516
|
+
.env.*
|
|
517
|
+
*.key
|
|
518
|
+
*.pem
|
|
519
|
+
credentials.json
|
|
520
|
+
client_secret*.json
|
|
521
|
+
**/bank_reconciliation/**/*.csv
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
### Gem Version Management
|
|
525
|
+
|
|
526
|
+
**Current Published Version:** `0.14.1` (on RubyGems.org)
|
|
527
|
+
|
|
528
|
+
**IMPORTANT: Automated Versioning System**
|
|
529
|
+
|
|
530
|
+
This project uses **semantic-release** for automated versioning and publishing. **DO NOT manually edit version files.**
|
|
531
|
+
|
|
532
|
+
**How it works:**
|
|
533
|
+
1. Commits are analyzed using conventional commit messages (feat, fix, chore, docs, etc.)
|
|
534
|
+
2. GitHub Actions CI/CD automatically:
|
|
535
|
+
- Determines next version based on commit types
|
|
536
|
+
- Updates `lib/appydave/tools/version.rb`
|
|
537
|
+
- Updates `CHANGELOG.md`
|
|
538
|
+
- Builds and publishes gem to RubyGems.org
|
|
539
|
+
- Creates git tag
|
|
540
|
+
- Pushes changes back to repository
|
|
541
|
+
|
|
542
|
+
**Commit Message Format:**
|
|
543
|
+
```bash
|
|
544
|
+
feat: add new feature # Triggers minor version bump (0.14.0 → 0.15.0)
|
|
545
|
+
fix: fix bug # Triggers patch version bump (0.14.0 → 0.14.1)
|
|
546
|
+
chore: update dependencies # No version bump
|
|
547
|
+
docs: update readme # No version bump
|
|
548
|
+
|
|
549
|
+
# Breaking change (major version bump)
|
|
550
|
+
feat!: remove deprecated API
|
|
551
|
+
BREAKING CHANGE: removes old API
|
|
552
|
+
|
|
553
|
+
# Or with body
|
|
554
|
+
feat: new feature
|
|
555
|
+
|
|
556
|
+
BREAKING CHANGE: This breaks existing API
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
**Configuration:**
|
|
560
|
+
- **CI/CD:** `.github/workflows/main.yml`
|
|
561
|
+
- **Semantic Release:** `.releaserc.json`
|
|
562
|
+
- **Plugins:**
|
|
563
|
+
- `@semantic-release/commit-analyzer` - Analyzes commits
|
|
564
|
+
- `@semantic-release/release-notes-generator` - Generates changelog
|
|
565
|
+
- `@klueless-js/semantic-release-rubygem` - Publishes to RubyGems
|
|
566
|
+
- `@semantic-release/git` - Commits version bumps
|
|
567
|
+
- `@semantic-release/github` - Creates GitHub releases
|
|
568
|
+
|
|
569
|
+
**Manual Publishing (Emergency Only):**
|
|
570
|
+
If you absolutely must publish manually:
|
|
571
|
+
1. Update version in `lib/appydave/tools/version.rb`
|
|
572
|
+
2. Run tests: `rake spec`
|
|
573
|
+
3. Build gem: `rake build`
|
|
574
|
+
4. Publish: `rake publish`
|
|
575
|
+
5. Tag release: `git tag v0.14.1 && git push --tags`
|
|
576
|
+
|
|
577
|
+
**Note:** Manual publishing will break the automated workflow. Use conventional commits and let CI/CD handle releases.
|
data/README.md
CHANGED
|
@@ -33,7 +33,52 @@ See all [stories](./STORIES.md)
|
|
|
33
33
|
|
|
34
34
|
## Usage
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
### CLI Tools
|
|
37
|
+
|
|
38
|
+
This gem provides several command-line tools for content creation and YouTube automation:
|
|
39
|
+
|
|
40
|
+
#### GPT Context Gatherer
|
|
41
|
+
Collect and organize project files for AI context analysis:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Basic usage - gather all Ruby files, exclude specs
|
|
45
|
+
gpt_context -i '**/*.rb' -e 'spec/**/*' -d -o context.txt
|
|
46
|
+
|
|
47
|
+
# Multiple patterns with tree and content output
|
|
48
|
+
gpt_context -i 'lib/**/*.rb' -i 'bin/**/*.rb' -f tree,content -d
|
|
49
|
+
|
|
50
|
+
# Advanced filtering for web projects
|
|
51
|
+
gpt_context -i 'apps/**/*.ts' -i 'apps/**/*.tsx' -e '**/node_modules/**/*' -e '**/_generated/**/*' -d -f tree -o typescript-files.txt
|
|
52
|
+
|
|
53
|
+
# Documentation and config files
|
|
54
|
+
gpt_context -i 'docs/**/*' -i '**/*.json' -i '**/*.config.*' -e '**/node_modules/**/*' -d -f tree
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
See detailed usage guide: [GPT Context Gatherer](./docs/usage/gpt-context.md)
|
|
58
|
+
|
|
59
|
+
#### YouTube Manager
|
|
60
|
+
```bash
|
|
61
|
+
# Get video details
|
|
62
|
+
bin/youtube_manager.rb get [options]
|
|
63
|
+
|
|
64
|
+
# Update video metadata
|
|
65
|
+
bin/youtube_manager.rb update [options]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
#### Subtitle Manager
|
|
69
|
+
```bash
|
|
70
|
+
# Clean subtitle files
|
|
71
|
+
bin/subtitle_manager.rb clean [options]
|
|
72
|
+
|
|
73
|
+
# Join multiple subtitle parts
|
|
74
|
+
bin/subtitle_manager.rb join [options]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### Prompt Tools
|
|
78
|
+
```bash
|
|
79
|
+
# Run AI prompt completion
|
|
80
|
+
bin/prompt_tools.rb completion [options]
|
|
81
|
+
```
|
|
37
82
|
|
|
38
83
|
|
|
39
84
|
## Development
|
|
@@ -51,8 +96,12 @@ You can also run `bin/console` for an interactive prompt that will allow you to
|
|
|
51
96
|
```bash
|
|
52
97
|
bin/console
|
|
53
98
|
|
|
54
|
-
|
|
55
|
-
# => ""
|
|
99
|
+
Appydave::Tools::VERSION
|
|
100
|
+
# => "0.14.0"
|
|
101
|
+
|
|
102
|
+
# Access configuration
|
|
103
|
+
config = Appydave::Tools::Configuration::Config.new
|
|
104
|
+
# => #<Appydave::Tools::Configuration::Config:...>
|
|
56
105
|
```
|
|
57
106
|
|
|
58
107
|
`appydave-tools` is setup with Guard, run `guard`, this will watch development file changes and run tests automatically, if successful, it will then run rubocop for style quality.
|
data/exe/ad_config
ADDED
data/exe/gpt_context
ADDED
data/exe/prompt_tools
ADDED
data/exe/youtube_manager
ADDED
data/package.json
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: appydave-tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Cruwys
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|
|
@@ -153,7 +153,13 @@ dependencies:
|
|
|
153
153
|
description: " AppyDave YouTube Automation Tools\n"
|
|
154
154
|
email:
|
|
155
155
|
- david@ideasmen.com.au
|
|
156
|
-
executables:
|
|
156
|
+
executables:
|
|
157
|
+
- ad_config
|
|
158
|
+
- gpt_context
|
|
159
|
+
- prompt_tools
|
|
160
|
+
- subtitle_manager
|
|
161
|
+
- youtube_automation
|
|
162
|
+
- youtube_manager
|
|
157
163
|
extensions: []
|
|
158
164
|
extra_rdoc_files: []
|
|
159
165
|
files:
|
|
@@ -165,6 +171,7 @@ files:
|
|
|
165
171
|
- ".rspec"
|
|
166
172
|
- ".rubocop.yml"
|
|
167
173
|
- CHANGELOG.md
|
|
174
|
+
- CLAUDE.md
|
|
168
175
|
- CODE_OF_CONDUCT.md
|
|
169
176
|
- Gemfile
|
|
170
177
|
- Guardfile
|
|
@@ -184,6 +191,12 @@ files:
|
|
|
184
191
|
- bin/youtube_manager.rb
|
|
185
192
|
- docs/dam/overview.md
|
|
186
193
|
- docs/usage/gpt-context.md
|
|
194
|
+
- exe/ad_config
|
|
195
|
+
- exe/gpt_context
|
|
196
|
+
- exe/prompt_tools
|
|
197
|
+
- exe/subtitle_manager
|
|
198
|
+
- exe/youtube_automation
|
|
199
|
+
- exe/youtube_manager
|
|
187
200
|
- images.log
|
|
188
201
|
- lib/appydave/tools.rb
|
|
189
202
|
- lib/appydave/tools/cli_actions/_doc.md
|