fli_video 0.0.2 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.builders/generators/back/scripts/01-get-technical-design-and-feature-list.rb +32 -0
  3. data/.builders/generators/back/scripts/02-get-feature-list-and-components.rb +42 -0
  4. data/.builders/generators/back/scripts/03-get-structure.rb +104 -0
  5. data/.builders/generators/back/scripts/generated/application-structure.json +231 -0
  6. data/.builders/generators/back/scripts/generated/features-and-components.md +988 -0
  7. data/.builders/generators/back/scripts/generated/technical-design-and-features.md +424 -0
  8. data/.builders/klues/add_episode.klue +25 -0
  9. data/.builders/klues/change_chapter_name.klue +32 -0
  10. data/.builders/klues/create_chapter_video.klue +34 -0
  11. data/.builders/klues/create_project.klue +37 -0
  12. data/.builders/klues/empty_trash.klue +24 -0
  13. data/.builders/klues/episode_path.klue +77 -0
  14. data/.builders/klues/global_config.klue +31 -0
  15. data/.builders/klues/move_ecamm_file.klue +21 -0
  16. data/.builders/klues/move_to_trash.klue +35 -0
  17. data/.builders/klues/open_in_finder.klue +25 -0
  18. data/.builders/klues/project_config.klue +123 -0
  19. data/.builders/klues/project_meta_data_store.klue +28 -0
  20. data/.builders/klues/project_path.klue +77 -0
  21. data/.builders/klues/recording_file_watcher.klue +28 -0
  22. data/.builders/klues/recording_filename.klue +112 -0
  23. data/.builders/klues/restore_from_trash.klue +29 -0
  24. data/.builders/klues/switch_focus.klue +24 -0
  25. data/.builders/klues/text_to_speech.klue +29 -0
  26. data/.builders/klues/transcript_data_store.klue +28 -0
  27. data/.rubocop.yml +2 -0
  28. data/CHANGELOG.md +26 -0
  29. data/README.md +13 -20
  30. data/bin/fli_video +6 -0
  31. data/docs/feature-list.md +76 -0
  32. data/docs/generated/application-structure.json +53 -0
  33. data/docs/generated/features-and-components.md +993 -0
  34. data/docs/generated/technical-design-and-features.md +437 -0
  35. data/docs/technical-specifications.md +360 -0
  36. data/fli.rb +138 -0
  37. data/lib/fli_video/cli.rb +30 -0
  38. data/lib/fli_video/version.rb +1 -1
  39. data/package-lock.json +2 -2
  40. data/package.json +1 -1
  41. data/scripts/01-get-technical-design-and-feature-list.md +5 -0
  42. data/scripts/01-get-technical-design-and-feature-list.rb +39 -0
  43. data/scripts/02-get-feature-list-and-components.md +26 -0
  44. data/scripts/02-get-feature-list-and-components.rb +56 -0
  45. data/scripts/03-get-code-structure.md +33 -0
  46. data/scripts/03-get-code-structure.rb +73 -0
  47. metadata +41 -3
  48. data/README-features.md +0 -36
@@ -0,0 +1,360 @@
1
+ # FliVideo
2
+
3
+ ## Application Overview
4
+
5
+ FliVideo is a Video Asset Managment tool created by a YouTuber `@AppyDave` for YouTubers.
6
+
7
+ It provides a set of image, video and workflow management tools to help its creator 'AppyDave' to automate and systemetize the video production process.
8
+
9
+ The intiial idea behind FliVideo was Zappier for YouTubers, but it is evolving with a range of capabilities around script, b-roll and presenation canvas automation.
10
+
11
+ ### Video Recording Managment
12
+
13
+ FliVideo initially targeted video content creators using Ecamm Live on the Mac, and adaptable for OBS users.
14
+
15
+ Tailored for projects ranging from individual YouTube videos to episodes in a podcast series, the application fits seamlessly into the workflow between video recording and editing.
16
+
17
+ It streamlines the post-recording process, encompassing file organization, renaming, and assembly of video recordings, thereby enhancing the efficiency and structure of content creation.
18
+
19
+ ### Core Functionality
20
+
21
+ - **Video Management**: The application intelligently handles videos recorded via Ecamm Live. Once Ecamm saves the videos with a name and timestamp in its folder, our system relocates them to a specific project or episode folder within the project/recordings directory.
22
+ - **Project and Episode Handling**: Each video project pertains to either a single YouTube video or a series of podcast episodes. The application supports a structured approach to organizing these projects.
23
+ - **Chapter-Based Recording**: Emulating a book's structure, down to chapters and individual paragraphs or sentences, videos are recorded and categorized as chapters, which can further be divided into smaller segments or 'parts', akin to paragraphs or sentences, labeled sequentially (e.g., a, b, c...).
24
+ - **File Naming and Organization**: Adhering to a sophisticated naming convention, the application names projects using a sequence (e.g., a01..a99, b01..), a YouTube channel code (e.g., ac=AppyCast, fv=FliVideo), and specific project descriptors. This convention is applied to organize and identify video chapters and parts within each project.
25
+ - **Combining Video Chapters**: After completing recordings for a chapter, these are joined to form a new video file in the chapter's folder, enhancing content flow and consistency.
26
+ - **Speech to Text Integration**: The application features advanced speech-to-text capabilities, converting spoken content into transcriptions. These transcriptions are then utilized for various content generation scenarios, including automatic tagging, generating prompts for AI-based tools like DALL·E 3, and providing detailed instructions for video editors.
27
+
28
+ ### Advanced Features
29
+
30
+ - **Dynamic Configuration**: The system adapts to various configurations set by the user before recording, using this information for subsequent file naming and routing.
31
+ - **Trash and Undo Functions**: Videos deemed suboptimal can be moved to a 'trash' folder, with the ability to undo this action if needed.
32
+ - **Automated File Processing**: Utilizing a FileWatch processor, the application automates responses to file events, like moving new recordings to designated folders.
33
+ - **Content Segmentation**: The application supports segmentation of content into sections and subparts, each with a calculated sequence number and name for easy identification and organization.
34
+ - **Metadata and Transcription Integration**: Extracting metadata from video transcriptions and file tags, the system aids in post-production processes such as keyword generation and chapter transitions.
35
+
36
+ ### Organization Suited for
37
+
38
+ - Long form YouTube content
39
+ - Multi Episode Podcasts
40
+ - One off YouTube Short or multiple shorts extracted from Long Form or Episode videos
41
+ - Course Creation
42
+
43
+ ## eCamm Live
44
+
45
+ I use eCamm Live to record my videos. It is simple to create videos with scenes and record individual sections of a video. This application should adapt to OBS with minimal changes.
46
+
47
+ eCamm live recording files are saved in the following format:
48
+
49
+ ```bash
50
+ Ecamm Live Recording on [YYYY-MM-DD] at [HH.MM.SS].mov
51
+
52
+ # Example
53
+ Ecamm Live Recording on 2023-08-25 at 14.51.58.mov
54
+ ```
55
+
56
+ ## Configuration
57
+
58
+
59
+ ### Global configuration
60
+
61
+ FliVideo uses a global configuration file located at `~/.fli-video.json` to store settings and paths for the application and state information such as the current project and episode. This file is created when the application is first run and is updated when the user changes the configuration.
62
+
63
+ ### Project configuration
64
+
65
+ FliVideo stores project-specific settings in `.fv.json` file located in the project's root folder. This file is created when the user creates a new project and is updated when recordings are updated. This file has a section for video and a section for episodes and uses the same structure in both sections
66
+
67
+ ## Project Naming and Structure
68
+
69
+ As part of the application development, each video project is assigned an alphanumeric identifier, ensuring a unique and systematic approach to project management.
70
+
71
+ Currently, the application supports four primary project codes corresponding to distinct content areas: AppyCast, AppyDave, WinningPrompts, and FliVideo.
72
+
73
+ Each project is also given a descriptive title, providing clear and immediate insight into its content or objective. Additionally, project names may include a status or keyword, offering a quick reference to the project's current state or specific characteristics. This naming convention and structure are fundamental to the application, as they facilitate efficient organization, easy retrieval, and effective management of diverse projects, ranging from media production to targeted content creation.
74
+
75
+ ### Sample project folder names
76
+
77
+ ```bash
78
+ a13-wp-openai-moderation-api-announcement-aug-25
79
+ a20-ad-open-interpreter
80
+ a21-ac-custom-gpt-instruction
81
+ a22-ac-browse-with-bing-chatgpt-feature
82
+ a24-ad-appydave-website
83
+ a26-ac-pinokio-NOT-STARTED
84
+ a27-ac-categorize-mp4-CI
85
+ a28-ac-easy-gpt-context-creation-FIND-MINDMAP
86
+ a29-ac-gpts-analyze-pdf-transations
87
+ ```
88
+
89
+ ### Sample project codes
90
+
91
+ - `ac` - AppyCast
92
+ - `ad` - AppyDave
93
+ - `fv` - FliVideo
94
+ - `wp` - WinningPrompts
95
+ - `c9` - Carnivore90
96
+ - `t1` - Trend10
97
+
98
+ ### Video Subfolders
99
+
100
+ Within the application's structure, video subfolders play a crucial role in organizing various elements of a project. These subfolders, residing under `project-name` for single video projects or `project-name/episode-name` for podcast episodes, are named and utilized as follows:
101
+
102
+ - **recordings**: This folder contains individual labeled recordings. Each recording is meticulously named and stored here, serving as the primary repository for raw video footage.
103
+
104
+ - **chapters**: Grouped recordings that have been joined together are stored in this folder. It represents the assembled segments of a project, showcasing the progression from individual recordings to cohesive chapters.
105
+
106
+ - **.trash**: The `.trash` folder is designated for recordings considered as bad takes. This allows for an efficient way to segregate and review discarded content, keeping the main folders clutter-free while retaining the option for retrieval.
107
+
108
+ - **assets**: This folder is utilized for storing extra graphic materials or b-roll assets. These elements are crucial in the production phase of a video, enhancing the visual appeal and providing supplementary content.
109
+
110
+ - **transcription**: Transcription files, providing textual versions of the video content, are stored here. This is especially useful for accessibility, content repurposing, and as a reference during the editing process.
111
+
112
+
113
+ ### Chapter naming convention
114
+
115
+ Each video project is divided into chapters, which are further segmented into parts. This structure is analogous to a book's chapters and paragraphs, respectively.
116
+
117
+ A chapter name like introduction may have additional descriptive labels like `introduction-context`, `introduction-outline`, `introduction-call-to-action`.
118
+
119
+ #### Sample chapter names
120
+
121
+ Chapter names help to identify the content of the video and maybe used for transition slide titles or chapter titles in a YouTube video.
122
+
123
+ - introduction
124
+ - overview
125
+ - example
126
+ - question
127
+ - answer
128
+ - summary
129
+ - outro
130
+
131
+ #### Why are parts important?
132
+
133
+ Too minimize the amount of editing required, I may want to record each part of a chapter separately. This allows clean recordings with minimal editing.
134
+
135
+ ### Keywords and Tags
136
+
137
+ Any recording can have 1 or more tags associated with it. These tags can be used to inform the video editor to inject B-roll or be picked up by another automation such as transcribe and send to GPT Bot
138
+
139
+ #### Example Tags
140
+
141
+ - `INTRO` - This recording needs to be placed into an intro template
142
+ - `CTA` - Like/subscribe, add comment, link in description or any other call to action
143
+ - `TRIM` - This recording needs to be truncated
144
+ - `TRIM-40s` - This recording needs to be truncated to 40 seconds
145
+ - `BROLL` - This recording needs B-roll
146
+ - `TELEPROMPT` - This recording needs to be transcribed and put into the teleprompter or sent to GPT bot for script inprovement
147
+ - `OUTRO` - This recording needs to be placed into an outro template
148
+
149
+ ### Scenarios
150
+
151
+ #### Long form
152
+
153
+ For full-length YouTube videos, the application offers a comprehensive solution from initial recording to final organization. It supports the creation and management of individual video projects, each with unique identifiers and descriptive names. The application's robust structure allows for the segmentation of videos into chapters and subparts, making the editing process more manageable and efficient. This scenario is ideal for YouTubers looking to produce structured, high-quality content for their channels.
154
+
155
+ #### Multi Episode Podcast
156
+
157
+ For podcasters using YouTube as their platform, the application provides excellent tools for episode management. It enables the creation of episodic content, each episode with its own identifier and title, under a single project umbrella. This scenario allows podcast creators to maintain a cohesive series, with easy navigation and organization of episodes, enhancing the listener's experience on YouTube.
158
+
159
+ #### Course Creation
160
+
161
+ In the context of online courses, the application excels in organizing and managing educational content. Course creators can structure their material into distinct sections and chapters, aligning with course modules or lessons. This scenario is particularly useful for educators and trainers who seek to provide a well-organized, accessible learning experience. The application's capabilities in handling multiple recordings and segments ensure that each part of the course is neatly cataloged and easy to access for students.
162
+
163
+ #### Short form
164
+
165
+ The application streamlines YouTube Shorts creation by allowing users to start new shorts projects or extract segments from longer videos. It enables easy segmentation, customization with intros and outros, and organizes these shorts in dedicated folders, enhancing content diversity on YouTube.
166
+
167
+ ### YouTube Shorts
168
+
169
+ The application is proficiently designed to accommodate the creation of YouTube Shorts, catering to both standalone short-form videos and segments derived from longer recordings.
170
+
171
+ **Standalone Shorts**: When starting a brand-new project specifically as a YouTube Short, the process mirrors that of a regular YouTube video. The application allows for the creation, naming, and organization of these shorts in their unique project folders.
172
+
173
+ **Shorts from Longer Recordings**: In many instances, a segment within a chapter or even a single paragraph might be ideal for a YouTube Short. In such cases, the application offers the flexibility to extract and separate these segments. It allows for the recording of additional intros and outros, specifically tailoring the segment for the short-form format. These extracted segments are then organized into a dedicated folder, designated for YouTube Shorts, within the main project. This ensures that while the original recording remains an integral part of the larger video or episode, the segment is also independently accessible for the video editor to assemble into a YouTube Short.
174
+
175
+ ## Project Structure Design
176
+
177
+ The following sections describe the application's structure and naming conventions using an exiting project example and highlights the system's capabilities in managing video projects and episodes.
178
+
179
+ #### Project Naming and Organization
180
+
181
+ Each project in the system is uniquely identified with a structured naming convention. For example, `a27-ac-categorize-mp4-IN-PROGRESS` breaks down as follows:
182
+
183
+ - **Sequence**: 'a27', representing the project's unique identifier.
184
+ - **Project Code**: 'ac', denoting the AppyCast channel.
185
+ - **Project Name**: 'categorize-mp4', describing the project's focus.
186
+ - **Status**: 'IN-PROGRESS', indicating the current stage of the project.
187
+
188
+ #### Episode Management
189
+
190
+ Episodes within a project are optional and are used when a project encompasses multiple videos. Each episode has its own folder named with a sequence and descriptive title, such as `01-flivideo-project-kickoff`:
191
+
192
+ - **Sequence**: '01', '02', etc., showing the episode's order in the series.
193
+ - **Episode Name**: Like 'flivideo-project-kickoff', providing a brief description of the episode's content.
194
+
195
+ #### Recordings Folder
196
+
197
+ The recordings folder, e.g., `a27-ac-categorize-mp4-CI/01-flivideo-project-kickoff/recordings`, contains individual video files. These are named following a specific pattern:
198
+
199
+ - **Sequence and Section Name**: Starting with a number indicating their order, followed by a descriptive name, like '01-introduction.mov'.
200
+ - **Subparts**: For more detailed segmentation, files are further labeled with suffixes like '-a', '-b', '-c', indicating the subparts of a section, such as '02-a-overview.mov', '02-b-overview.mov'.
201
+
202
+ Here is an example from episode 1 of the FliVideo project Podcast.
203
+
204
+ ```bash
205
+ # a27-ac-categorize-mp4-CI/01-flivideo-project-kickoff/recordings
206
+
207
+ 01-introduction.mov
208
+ 02-a-overview.mov
209
+ 02-b-overview.mov
210
+ 02-c-overview.mov
211
+ 02-d-overview.mov
212
+ 02-e-overview.mov
213
+ 03-a-role_CI.mov
214
+ 03-b-overview_CI.mov
215
+ 04-a-gpt-first-attempt.mov
216
+ 04-b-gpt-first-attempt-explanation.mov
217
+ 05-first-commands_TRANSITION.mov
218
+ 06-a-commands_CI.mov
219
+ 07-b-commands_CI.mov
220
+ 07-d-commands-goal_CI.mov
221
+ 08-a-response_CI-TRANSITION.mov
222
+ 08-b-response_CI-TRANSITION.mov
223
+ 09-a-gpt-2nd-attempt.mov
224
+ 09-b-gpt-2nd-attempt.mov
225
+ 09-c-gpt-2nd-attempt.mov
226
+ 10-a-gpt-goal.mov
227
+ 10-b-gpt-goal.mov
228
+ 10-c-gpt-goal.mov
229
+ 10-d-gpt-goal.mov
230
+ 10-e-gpt-goal.mov
231
+ 10-f-gpt-goal.mov
232
+ 11-a-gpt-goal-more.mov
233
+ 11-b-gpt-goal-more.mov
234
+ 12-a-code-cli.mov
235
+ 12-b-code-cli.mov
236
+ 12-c-code-cli.mov
237
+ 13-a-code-cli-run.mov
238
+ 13-b-code-cli-run.mov
239
+ 13-c-code-cli-run.mov
240
+ 14-a-support-project-name.mov
241
+ 14-b-support-project-name.mov
242
+ 14-c-support-project-name.mov
243
+ 15-outro.mov
244
+ ```
245
+
246
+ #### Chapters Folder
247
+
248
+ In the chapters folder, such as `a27-ac-categorize-mp4-CI/01-flivideo-project-kickoff/chapters`, recordings are grouped and combined to form complete chapters of the project:
249
+
250
+ - **Compiled Chapters**: Each file represents a combined version of the recordings from the 'recordings' folder, named by their sequence and section, like '01-introduction.mov', '02-overview.mov'.
251
+ - **Cohesive Segments**: These files reflect the culmination of individual recordings and subparts, merged to create cohesive segments of the project or episode.
252
+
253
+ Here is an example from episode 1 of the FliVideo project Podcast.
254
+
255
+ ```bash
256
+ # a27-ac-categorize-mp4-CI/01-flivideo-project-kickoff/chapters
257
+
258
+ 01-introduction.mov
259
+ 02-overview.mov
260
+ 03-role_CI.mov
261
+ 04-gpt-first-attempt.mov
262
+ 05-first-commands.mov
263
+ 06-commands.mov
264
+ 07-commands-goal.mov
265
+ 08-response_CI.mov
266
+ 09-gpt-2nd-attempt.mov
267
+ 10-gpt-goal.mov
268
+ 11-gpt-goal-more.mov
269
+ 12-code-cli.mov
270
+ 13-code-cli-run.mov
271
+ 14-support-project-name.mov
272
+ 15-outro.mov
273
+ ```
274
+
275
+ #### Sample Project #1 - Single Video
276
+
277
+ Example folder structure for single video projects
278
+
279
+ ```bash
280
+ project-name/recordings/01-introduction.mov
281
+ project-name/recordings/02-a-content.mov
282
+ project-name/recordings/02-b-content.mov
283
+ project-name/recordings/03-a-outro.mov
284
+ project-name/recordings/03-b-outro-cta.mov
285
+ project-name/chapters/01-introduction.mov
286
+ project-name/chapters/02-content.mov
287
+ project-name/chapters/03-outro.mov
288
+ ```
289
+
290
+ #### Sample Project #2 - Multiple Episodes
291
+
292
+ Example folder structure for multiple episode projects
293
+
294
+ ```bash
295
+ project-name/01-episode-name/recordings/01-introduction.mov
296
+ project-name/01-episode-name/recordings/02-a-content.mov
297
+ project-name/01-episode-name/recordings/02-b-content.mov
298
+ project-name/01-episode-name/recordings/03-a-outro.mov
299
+ project-name/01-episode-name/recordings/03-b-outro-cta.mov
300
+ project-name/01-episode-name/chapters/01-introduction.mov
301
+ project-name/01-episode-name/chapters/02-content.mov
302
+ project-name/01-episode-name/chapters/03-outro.mov
303
+ ```
304
+
305
+ ```bash
306
+ project-name/02-different-episode-name/recordings/01-introduction.mov
307
+ project-name/02-different-episode-name/recordings/02-content.mov
308
+ project-name/02-different-episode-name/recordings/03-a-outro.mov
309
+ project-name/02-different-episode-name/recordings/03-b-outro-endcards.mov
310
+ project-name/02-different-episode-name/chapters/01-introduction.mov
311
+ project-name/02-different-episode-name/chapters/02-content.mov
312
+ project-name/02-different-episode-name/chapters/03-outro.mov
313
+ ```
314
+
315
+ #### Sample Project #3 - Awaiting descision to keep or trash
316
+
317
+ Example folder structure where there are a bunch of files that I have not yet marked as Good Takes,
318
+ All recordings need to be considered bad takes until I say save, at which time any prior bad takes will be moved to trash
319
+
320
+ 1 project=1 standard video before trash
321
+
322
+ ```bash
323
+ project-name/.trash
324
+ project-name/recordings/01-introduction.mov
325
+ project-name/recordings/02-a-content.mov
326
+ project-name/recordings/02-b-content.mov
327
+ project-name/recordings/03-a-outro.mov
328
+ project-name/recordings/03-b-outro-cta.mov
329
+ project-name/recordings/Ecamm Live Recording on 2023-12-18 at 09.58.55.mov
330
+ project-name/recordings/Ecamm Live Recording on 2023-12-18 at 09.59.38.mov
331
+ project-name/recordings/Ecamm Live Recording on 2023-12-18 at 10.00.03.mov
332
+ project-name/recordings/Ecamm Live Recording on 2023-12-18 at 10.00.26.mov
333
+ project-name/recordings/Ecamm Live Recording on 2023-12-18 at 10.00.55.mov
334
+ project-name/recordings/Ecamm Live Recording on 2023-12-18 at 10.01.30.mov
335
+ project-name/recordings/Ecamm Live Recording on 2023-12-18 at 10.02.25.mov
336
+ project-name/recordings/Ecamm Live Recording on 2023-12-18 at 10.02.56.mov
337
+ ```
338
+
339
+ #### Sample Project #4 - After trash
340
+
341
+ Notice that most of the bad takes have been moved to the trash folder, but the last one was named as 03-c-outro.mov
342
+
343
+ 1 project=1 standard video after trash
344
+
345
+ ```bash
346
+ project-name/.trash/Ecamm Live Recording on 2023-12-18 at 09.58.55.mov
347
+ project-name/.trash/Ecamm Live Recording on 2023-12-18 at 09.59.38.mov
348
+ project-name/.trash/Ecamm Live Recording on 2023-12-18 at 10.00.03.mov
349
+ project-name/.trash/Ecamm Live Recording on 2023-12-18 at 10.00.26.mov
350
+ project-name/.trash/Ecamm Live Recording on 2023-12-18 at 10.00.55.mov
351
+ project-name/.trash/Ecamm Live Recording on 2023-12-18 at 10.01.30.mov
352
+ project-name/.trash/Ecamm Live Recording on 2023-12-18 at 10.02.25.mov
353
+ project-name/recordings/01-introduction.mov
354
+ project-name/recordings/02-a-content.mov
355
+ project-name/recordings/02-b-content.mov
356
+ project-name/recordings/03-a-outro.mov
357
+ project-name/recordings/03-b-outro-cta.mov
358
+ project-name/recordings/03-c-outro.mov
359
+ ```
360
+
data/fli.rb ADDED
@@ -0,0 +1,138 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Can you just absorb this starter application summary, say yay if you understand.
4
+ # Certainly! Here's a summary of the functionalities implemented in your fli_video.rb application so far:
5
+ # Global Configuration Loading: The application loads global configuration settings from a JSON file located at ~/.fli-video.json. This configuration includes paths like the ecamm-recordings directory and the project-root-folder.
6
+ # Project Configuration Loading: The application is designed to load project-specific configurations from a .fli-video.json or .fv.json file located in the project's root folder. These configurations define folders such as "recordings" and "chapters" specific to each project.
7
+ # Command-Line Interface (CLI): The script uses Ruby's optparse library to parse command-line arguments. This provides a structured way to interact with the application from the terminal.
8
+ # Project Option Handling (-p or --project): The CLI includes an option -p or --project, followed by a project name. This option allows users to specify a project context for the application. The script performs the following actions based on this option:
9
+ # Existing Project: If the specified project already exists under the project-root-folder (defined in the global configuration), the script sets the application to use that project's configuration.
10
+ # New Project Creation: If the specified project does not exist, the application prompts the user to create a new project with the given name. If the user agrees, it creates a subfolder for the project and a .fv.json file within that folder with a predefined configuration structure.
11
+ # User Interaction for Project Creation: When a non-existing project is specified, the application interacts with the user via the command line, asking whether they want to create a new project. If the user confirms, it proceeds with the creation; otherwise, it cancels the operation.
12
+ # Basic Application Structure: The application is structured with a main FliVideo class that handles the overall logic and operation. This class integrates the configuration loading and the CLI options handling.
13
+ # This summary reflects the application's state based on your provided requirements and the code snippets so far. The application is set up to be expanded with more functionalities, such as file handling, video processing, and other features you might require for your project management and video organization tasks.
14
+
15
+
16
+ require 'json'
17
+ require 'optparse'
18
+ require 'pry'
19
+
20
+ # Global configuration
21
+ GLOBAL_CONFIG_PATH = File.expand_path('~/.fli-video.json')
22
+
23
+ # Project-level configuration
24
+ PROJECT_CONFIG_FILENAMES = ['.fli-video.json', '.fv.json']
25
+
26
+ # Class to handle the application configuration
27
+ class Config
28
+ attr_reader :global_config, :project_config
29
+
30
+ def initialize
31
+ @global_config = load_global_config
32
+ end
33
+
34
+ def load_project(project_name)
35
+ @project_config = load_project_config(project_name)
36
+ end
37
+
38
+ private
39
+
40
+ def load_global_config
41
+ if File.exist?(GLOBAL_CONFIG_PATH)
42
+ JSON.parse(File.read(GLOBAL_CONFIG_PATH))
43
+ else
44
+ raise "Global configuration file does not exist."
45
+ end
46
+ end
47
+
48
+ def load_project_config(project_name)
49
+ config_filename = PROJECT_CONFIG_FILENAMES.detect do |filename|
50
+ File.exist?(File.join(project_root_folder, project_name, filename))
51
+ end
52
+
53
+ if config_filename
54
+ JSON.parse(File.read(File.join(project_root_folder, project_name, config_filename)))
55
+ else
56
+ raise "Project configuration file does not exist."
57
+ end
58
+ end
59
+
60
+ def project_root_folder
61
+ @global_config['project-root-folder']
62
+ end
63
+ end
64
+
65
+ # Main Application class
66
+ class FliVideo
67
+ def initialize
68
+ @config = Config.new
69
+ end
70
+
71
+ def run
72
+ # Application logic goes here.
73
+ puts "FLI Video application is running..."
74
+ puts "Global configuration: #{@config.global_config}"
75
+ puts "Project configuration: #{@config.project_config}"
76
+ end
77
+
78
+ def handle_project_option(project_name)
79
+ project_path = File.join(@config.global_config['project-root-folder'], project_name)
80
+
81
+ if Dir.exist?(project_path)
82
+ puts "Setting to existing project configuration..."
83
+ # Logic to set to existing project configuration goes here
84
+ @config.load_project(project_name)
85
+ else
86
+ puts "Do you want to create a project named: #{project_name}? [y/n]"
87
+ answer = STDIN.gets.chomp.downcase
88
+ if answer == 'y'
89
+ create_project_folder(project_path)
90
+ create_project_config(project_path)
91
+ puts "Project '#{project_name}' created."
92
+ else
93
+ puts "Project creation cancelled."
94
+ exit
95
+ end
96
+ @config.load_project(project_name)
97
+ end
98
+ end
99
+
100
+ # Method to create project folder
101
+ def create_project_folder(project_path)
102
+ Dir.mkdir(project_path) unless Dir.exist?(project_path)
103
+ end
104
+
105
+ # Method to create project configuration file
106
+ def create_project_config(project_path)
107
+ config_path = File.join(project_path, '.fv.json')
108
+ config_content = {
109
+ 'folders' => {
110
+ 'recordings' => './recordings',
111
+ 'chapters' => './chapters',
112
+ }
113
+ }
114
+ File.write(config_path, JSON.pretty_generate(config_content))
115
+ end
116
+ end
117
+
118
+ # Command line options parsing
119
+ options = {}
120
+ OptionParser.new do |opts|
121
+ opts.banner = "Usage: fli_video.rb [options]"
122
+
123
+ # Define other options here.
124
+ opts.on("-pPROJECT", "--project=PROJECT", "Specify the project name") do |project|
125
+ options[:project] = project
126
+ end
127
+
128
+ opts.on("-h", "--help", "Prints this help") do
129
+ puts opts
130
+ exit
131
+ end
132
+ end.parse!(ARGV)
133
+
134
+ # Instantiate and run the application
135
+ app = FliVideo.new
136
+ # If the project option is given, handle it before running the app
137
+ app.handle_project_option(options[:project]) if options[:project]
138
+ app.run
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../fli_video'
4
+
5
+ module FliVideo
6
+ # FliVideo::CLI is the command line interface for the FliVideo gem.
7
+ class CLI
8
+ def self.start(args)
9
+ new(args).execute
10
+ end
11
+
12
+ def initialize(args)
13
+ @args = args
14
+ end
15
+
16
+ def execute
17
+ if @args.empty?
18
+ puts 'FliVideo CLI - No command provided'
19
+ return
20
+ end
21
+
22
+ case @args.first
23
+ when 'version'
24
+ puts "FliVideo version #{FliVideo::VERSION}"
25
+ else
26
+ puts "Unknown command: #{@args.first}"
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FliVideo
4
- VERSION = '0.0.2'
4
+ VERSION = '0.1.1'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "fli_video",
3
- "version": "0.0.2",
3
+ "version": "0.1.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "fli_video",
9
- "version": "0.0.2",
9
+ "version": "0.1.1",
10
10
  "devDependencies": {
11
11
  "@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
12
12
  "@semantic-release/changelog": "^6.0.3",
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fli_video",
3
- "version": "0.0.2",
3
+ "version": "0.1.1",
4
4
  "description": "FliVideo - Video Asset Management for Content Creators",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
@@ -0,0 +1,5 @@
1
+ ## Prompt:
2
+
3
+ Write a Ruby script to read `docs/technical-specifictions.md` and `docs/feature-list.md`,
4
+ and merge their content into `docs/generated/technical-design-and-features.md` and copy it to the clipboard.
5
+
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Method to read file contents
4
+ def read_file(file_path)
5
+ begin
6
+ File.read(file_path)
7
+ rescue => e
8
+ puts "Error reading file #{file_path}: #{e}"
9
+ ""
10
+ end
11
+ end
12
+
13
+ # Method to write content to a file
14
+ def write_file(file_path, *contents)
15
+ merged_content = contents.join("\n")
16
+ begin
17
+ # Ensure the directory exists
18
+ Dir.mkdir(File.dirname(file_path)) unless Dir.exist?(File.dirname(file_path))
19
+ File.write(file_path, merged_content)
20
+ rescue => e
21
+ puts "Error writing to file #{file_path}: #{e}"
22
+ end
23
+ end
24
+
25
+ # Method to copy content to clipboard
26
+ def copy_to_clipboard(content)
27
+ IO.popen('pbcopy', 'w') { |clip| clip.puts content }
28
+ end
29
+
30
+ # Main execution
31
+ technical_design = read_file('docs/technical-specifications.md')
32
+ feature_list = read_file('docs/feature-list.md')
33
+ output_file = 'docs/generated/technical-design-and-features.md'
34
+
35
+ # Merge and write the content to the output file
36
+ write_file(output_file, technical_design, feature_list)
37
+
38
+ # Copy content to clipboard
39
+ copy_to_clipboard("#{technical_design}\n#{feature_list}")
@@ -0,0 +1,26 @@
1
+ ## Prompt:
2
+
3
+ Write a Ruby script to read `docs/feature-list.md` and merge it with content from `.builders/klues/*.klue` files.
4
+ Write the result to `docs/generated/features-and-components.md` and copy it to the clipboard.
5
+
6
+ The Klue files should need a heading: "Klue Components"
7
+
8
+ The content from each Klue file have a simple heading and be wraped with in a code block with the language set to ruby.
9
+
10
+ Example:
11
+
12
+
13
+ ## Klue Components
14
+
15
+ Klue Component: `add_episode.klue`
16
+
17
+ ```ruby
18
+ # content of add_episode.klue goes here
19
+ ```
20
+
21
+ Klue Component: `change_chapter_name.klue`
22
+
23
+ ```ruby
24
+ # content of change_chapter_name.klue goes here
25
+ ```
26
+