copit 1.0.2 → 1.2.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.
Files changed (3) hide show
  1. package/README.md +32 -100
  2. package/dist/index.js +592 -7344
  3. package/package.json +5 -8
package/README.md CHANGED
@@ -1,134 +1,66 @@
1
1
  # copit
2
2
 
3
- A GitHub File Fetcher TUI application that allows you to browse and download files from GitHub repositories with OAuth authentication, fuzzy search, and download history management.
3
+ A TUI tool for managing local file templates. Register frequently used config files and copy them to new projects with a single command.
4
4
 
5
5
  ## Features
6
6
 
7
- - 🔐 **GitHub OAuth Authentication** - Secure Device Flow authentication
8
- - 🔍 **Fuzzy Search** - Fast file and repository search using fuse.js
9
- - 📋 **Download History** - Track and quickly re-download recent files
10
- - 🚀 **Terminal UI** - Beautiful terminal interface built with ink + React
11
- - 💾 **Encrypted Storage** - Secure token storage with AES-256-GCM encryption
12
- - 🛡️ **Security** - Path traversal protection and input validation
7
+ - 📌 **Template Registration** - Save local files as reusable templates
8
+ - 📄 **Relative Path Preservation** - Maintains directory structure (e.g., `.vscode/settings.json`)
9
+ - ⚠️ **Overwrite Confirmation** - Prompts before overwriting existing files
10
+ - 🚀 **Terminal UI** - Simple interface built with ink + React
13
11
 
14
12
  ## Installation
15
13
 
16
- ### Global Installation
17
-
18
14
  ```bash
19
15
  # Install globally via npm
20
16
  npm install -g copit
21
17
 
22
- # Or install via bunx (recommended)
18
+ # Or run directly with bunx
23
19
  bunx copit
24
20
  ```
25
21
 
26
- ### Local Development
27
-
28
- ```bash
29
- # Clone the repository
30
- git clone https://github.com/mrsekut/copit.git
31
- cd copit
32
-
33
- # Install dependencies
34
- bun install
35
-
36
- # Run in development mode
37
- bun run dev
38
- ```
39
-
40
22
  ## Usage
41
23
 
42
- ### Basic Usage
43
-
44
24
  ```bash
45
- # Run the application
46
25
  copit
47
-
48
- # Or with bunx
49
- bunx copit
50
26
  ```
51
27
 
52
- ### Environment Variables
53
-
54
- Create a `.env` file or set environment variables:
28
+ ### Workflow
55
29
 
56
- ```bash
57
- # GitHub OAuth Client ID (optional - uses default if not set)
58
- GITHUB_CLIENT_ID=your_github_client_id
59
- ```
30
+ 1. **Register a template**
31
+ - Press `Tab` to switch to Register screen
32
+ - Navigate to the file you want to register
33
+ - Press `Enter` to select, then enter a template name
60
34
 
61
- ### First Run
35
+ 2. **Use a template**
36
+ - Select a template from the list
37
+ - Press `Enter` to copy it to the current directory
38
+ - Confirm overwrite if the file already exists
62
39
 
63
- 1. Run `copit` command
64
- 2. Follow the OAuth authentication flow
65
- 3. Browse repositories and download files
66
- 4. Use Tab to switch between History and Browse modes
40
+ 3. **Delete a template**
41
+ - Highlight a template and press `d`
42
+ - Confirm deletion
67
43
 
68
- ### Navigation
44
+ ## Development
69
45
 
70
- - **↑/↓** - Navigate through lists
71
- - **Enter** - Select/Download files
72
- - **Tab** - Switch between History and Browse modes
73
- - **Esc** - Go back or exit
74
- - **Type** - Fuzzy search in any list
75
-
76
- ## GitHub OAuth Setup
77
-
78
- To use your own GitHub OAuth App:
79
-
80
- 1. Go to [GitHub Developer Settings](https://github.com/settings/applications/new)
81
- 2. Create a new OAuth App with these settings:
82
- - Application name: `copit` (or your preferred name)
83
- - Homepage URL: `https://github.com/mrsekut/copit`
84
- - Authorization callback URL: `http://localhost` (not used for device flow)
85
- 3. Enable "Device Flow" in the app settings
86
- 4. Copy the Client ID and set it as `GITHUB_CLIENT_ID` environment variable
87
-
88
- ## Architecture
89
-
90
- Built with modern technologies and patterns:
91
-
92
- - **Runtime**: Bun
93
- - **UI**: ink + React for terminal interface
94
- - **State Management**: jotai
95
- - **Authentication**: GitHub OAuth Device Flow
96
- - **Search**: fuse.js for fuzzy search
97
- - **Architecture**: Package by Feature pattern
98
- - **Language**: TypeScript with strict type checking
46
+ ```bash
47
+ # Clone the repository
48
+ git clone https://github.com/mrsekut/copit.git
49
+ cd copit
99
50
 
100
- ## Security
51
+ # Install dependencies
52
+ bun install
101
53
 
102
- - OAuth tokens are encrypted using AES-256-GCM
103
- - Path traversal protection for file downloads
104
- - Input validation and sanitization
105
- - No hardcoded secrets (configurable via environment variables)
54
+ # Run in development mode
55
+ bun run dev
106
56
 
107
- ## Scripts
57
+ # Build
58
+ bun run build
108
59
 
109
- ```bash
110
- # Development
111
- bun run dev # Start development server
112
- bun run build # Build for production
113
- bun run typecheck # Run TypeScript type checking
114
- bun run lint # Run ESLint
115
- bun run format # Format code with Prettier
116
- bun run test # Run tests
117
- bun run check # Run all checks (typecheck + lint + format + test)
60
+ # Run checks
61
+ bun run check
118
62
  ```
119
63
 
120
- ## Contributing
121
-
122
- 1. Fork the repository
123
- 2. Create a feature branch
124
- 3. Make your changes
125
- 4. Run `bun run check` to ensure code quality
126
- 5. Submit a pull request
127
-
128
64
  ## License
129
65
 
130
- MIT License - see [LICENSE](LICENSE) file for details.
131
-
132
- ## Author
133
-
134
- [mrsekut](https://github.com/mrsekut)
66
+ MIT