copit 1.0.2 → 1.1.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.
- package/README.md +32 -100
- package/dist/index.js +553 -6959
- package/package.json +5 -7
package/README.md
CHANGED
|
@@ -1,134 +1,66 @@
|
|
|
1
1
|
# copit
|
|
2
2
|
|
|
3
|
-
A
|
|
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
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- 🚀 **Terminal UI** -
|
|
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
|
|
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
|
-
###
|
|
53
|
-
|
|
54
|
-
Create a `.env` file or set environment variables:
|
|
28
|
+
### Workflow
|
|
55
29
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
44
|
+
## Development
|
|
69
45
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
51
|
+
# Install dependencies
|
|
52
|
+
bun install
|
|
101
53
|
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
57
|
+
# Build
|
|
58
|
+
bun run build
|
|
108
59
|
|
|
109
|
-
|
|
110
|
-
|
|
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
|
|
131
|
-
|
|
132
|
-
## Author
|
|
133
|
-
|
|
134
|
-
[mrsekut](https://github.com/mrsekut)
|
|
66
|
+
MIT
|