@blackycoderx4/devc 0.4.0 → 0.6.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 +268 -0
- package/bin/devc.js +1 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# devc
|
|
2
|
+
|
|
3
|
+
CLI tool for generating ready-to-use development containers.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`devc` is a command-line interface that generates development container configurations for various technologies. It downloads templates from the [devcontainers](https://github.com/SamitoX4/devcontainers) repository and sets them up in your project.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- 🚀 Instant dev environment setup
|
|
12
|
+
- 📦 Multiple technology templates (including nested categories like `android/kotlin-native`)
|
|
13
|
+
- 🔄 Auto-updates for templates
|
|
14
|
+
- 💾 Offline support with local cache
|
|
15
|
+
- ⚙️ Git configuration support
|
|
16
|
+
- 🎯 Interactive mode with guided prompts
|
|
17
|
+
- 🎛️ **Interactive version selector** — customize tool versions (Android API, Kotlin, NDK, Node, etc.) with arrow-key selection
|
|
18
|
+
- 🔗 **Smart version suggestions** — Build Tools auto-suggests the matching version when you pick an Android API Level
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
### npm (Recommended — works on all platforms)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm i @blackycoderx4/devc
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Requires Node.js 14+. The package automatically downloads the correct native binary for your platform (Windows, Linux, or macOS).
|
|
29
|
+
|
|
30
|
+
### Quick Install (Linux / macOS)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
curl -fsSL https://raw.githubusercontent.com/SamitoX4/devc/main/docs/install.sh | bash
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Windows
|
|
37
|
+
|
|
38
|
+
If you have Node.js installed, use the npm method above.
|
|
39
|
+
|
|
40
|
+
Alternatively:
|
|
41
|
+
- **WSL2**: Run the Linux installer inside your WSL2 distribution.
|
|
42
|
+
- **Manual**: Download the latest `.zip` for Windows from the [Releases](https://github.com/SamitoX4/devc/releases) page, extract it, and add `devc.exe` to your PATH.
|
|
43
|
+
|
|
44
|
+
### From Source
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git clone https://github.com/SamitoX4/devc.git
|
|
48
|
+
cd devc/cli
|
|
49
|
+
cargo build --release
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
On Linux/macOS copy the binary to your PATH:
|
|
53
|
+
```bash
|
|
54
|
+
cp target/release/devc ~/.local/bin/
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
On Windows the binary will be at `target\release\devc.exe`.
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
### Interactive Mode (Recommended)
|
|
62
|
+
|
|
63
|
+
Just run:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
devc gen
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The CLI will guide you through:
|
|
70
|
+
1. **Select a template** (arrow keys) — supports nested templates like `android/kotlin-native`
|
|
71
|
+
2. **Project name** (default: current directory)
|
|
72
|
+
3. **Git User Name**
|
|
73
|
+
4. **Git User Email**
|
|
74
|
+
5. **Customize versions** (optional) — if the template supports parameterized versions, you can pick from a curated list:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
KOTLIN_VERSION:
|
|
78
|
+
2.0.0
|
|
79
|
+
2.0.10
|
|
80
|
+
> 2.0.21
|
|
81
|
+
2.1.0
|
|
82
|
+
|
|
83
|
+
ANDROID_API_LEVEL:
|
|
84
|
+
33
|
|
85
|
+
34
|
|
86
|
+
35
|
|
87
|
+
> 36
|
|
88
|
+
|
|
89
|
+
BUILD_TOOLS_VERSION:
|
|
90
|
+
33.0.0
|
|
91
|
+
34.0.0
|
|
92
|
+
35.0.0
|
|
93
|
+
> 36.0.0 ← auto-suggested from API Level 36
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### With Flags
|
|
97
|
+
|
|
98
|
+
Skip prompts by passing flags:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Specify template and project name
|
|
102
|
+
devc gen --template nodejs --name my-project
|
|
103
|
+
|
|
104
|
+
# Nested templates (Android stack)
|
|
105
|
+
devc gen --template android/kotlin-native --name my-native-app
|
|
106
|
+
devc gen --template android/flutter --name my-flutter-app
|
|
107
|
+
devc gen --template android/ndk --name my-ndk-project
|
|
108
|
+
|
|
109
|
+
# With Git configuration
|
|
110
|
+
devc gen --template android/react-native --name my-app --git-name "John Doe" --git-email "john@example.com"
|
|
111
|
+
|
|
112
|
+
# All options
|
|
113
|
+
devc gen -t java -n my-java-app --git-name "John Doe" --git-email "john@example.com"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Configure Git
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Interactive (prompts for name and email)
|
|
120
|
+
devc config
|
|
121
|
+
|
|
122
|
+
# With flags
|
|
123
|
+
devc config --git-name "Your Name" --git-email "your@email.com"
|
|
124
|
+
|
|
125
|
+
# Show current configuration
|
|
126
|
+
devc config --show
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### List Available Templates
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
devc list
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Update Templates
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
devc update
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Available Templates
|
|
142
|
+
|
|
143
|
+
### General
|
|
144
|
+
|
|
145
|
+
| Template | Description |
|
|
146
|
+
|----------|-------------|
|
|
147
|
+
| `nodejs` | Node.js with TypeScript, npm/pnpm |
|
|
148
|
+
| `java` | Java 17 + Maven |
|
|
149
|
+
| `laravel` | PHP 8.3 + Composer |
|
|
150
|
+
| `rust` | Rust (stable) + Cargo |
|
|
151
|
+
| `go` | Go 1.22 |
|
|
152
|
+
| `python` | Python 3.12 + pip |
|
|
153
|
+
|
|
154
|
+
### Android Stack
|
|
155
|
+
|
|
156
|
+
| Template | Description | Customizable Versions |
|
|
157
|
+
|----------|-------------|----------------------|
|
|
158
|
+
| `android/java` | Java 17 + Android SDK | API Level, Build Tools, NDK, CMD Line Tools |
|
|
159
|
+
| `android/kotlin-native` | Kotlin/Native + Android SDK | Kotlin, API Level, Build Tools, NDK, CMD Line Tools |
|
|
160
|
+
| `android/ndk` | Android NDK + CMake | API Level, Build Tools, NDK, CMake, CMD Line Tools |
|
|
161
|
+
| `android/react-native` | Node.js + React Native + Android SDK | Node version, API Level, Build Tools, NDK, CMD Line Tools |
|
|
162
|
+
| `android/flutter` | Flutter + Android SDK | Flutter branch, API Level, Build Tools, NDK, CMD Line Tools |
|
|
163
|
+
|
|
164
|
+
## Commands
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
devc gen [options] Generate a devcontainer (interactive if no options)
|
|
168
|
+
devc list [options] List available templates
|
|
169
|
+
devc update [options] Update templates from repository
|
|
170
|
+
devc config [options] Configure Git user settings
|
|
171
|
+
|
|
172
|
+
Options:
|
|
173
|
+
-t, --template <name> Template name (e.g., nodejs, android/kotlin-native)
|
|
174
|
+
-n, --name <name> Project name
|
|
175
|
+
--git-name <name> Git user name
|
|
176
|
+
--git-email <email> Git user email
|
|
177
|
+
--verbose Verbose output
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## How It Works
|
|
181
|
+
|
|
182
|
+
1. **First Run**: Downloads templates to `~/.devc/cache/`
|
|
183
|
+
2. **Template Discovery**: Automatically finds all valid templates, including nested ones like `android/kotlin-native`
|
|
184
|
+
3. **Interactive Mode**: Guides you through setup with prompts, including an optional version picker for parameterized templates
|
|
185
|
+
4. **Flag Mode**: Skip prompts by passing options
|
|
186
|
+
5. **Git Configuration**: Saved to `~/.devc/config.json` for future use
|
|
187
|
+
6. **Each Execution**: Checks for updates in the background
|
|
188
|
+
7. **Offline Mode**: Uses cached templates when offline
|
|
189
|
+
|
|
190
|
+
## Project Structure
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
devc/
|
|
194
|
+
├── .github/ # GitHub Actions workflows
|
|
195
|
+
│ └── workflows/
|
|
196
|
+
│ └── release.yml
|
|
197
|
+
├── cli/ # Rust CLI source code
|
|
198
|
+
│ ├── src/
|
|
199
|
+
│ │ ├── commands/ # CLI commands (gen, list, update, config)
|
|
200
|
+
│ │ └── utils/ # Cache, fetcher, copier, merger
|
|
201
|
+
│ └── Cargo.toml
|
|
202
|
+
├── npm/ # npm wrapper package
|
|
203
|
+
│ ├── bin/
|
|
204
|
+
│ ├── install.js
|
|
205
|
+
│ ├── platform.js
|
|
206
|
+
│ └── package.json
|
|
207
|
+
├── docs/ # GitHub Pages (landing + install)
|
|
208
|
+
│ ├── index.html
|
|
209
|
+
│ └── install.sh
|
|
210
|
+
└── scripts/ # Build scripts
|
|
211
|
+
└── build-release.sh
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Creating a Release
|
|
215
|
+
|
|
216
|
+
Releases are built automatically with **GitHub Actions**. Simply push a version tag:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
git tag v0.3.0
|
|
220
|
+
git push origin v0.3.0
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
GitHub Actions will compile binaries for Linux, macOS (Intel & Apple Silicon), and Windows, package them with templates, and publish them to the [Releases](https://github.com/SamitoX4/devc/releases) page.
|
|
224
|
+
|
|
225
|
+
### Manual Release (local)
|
|
226
|
+
|
|
227
|
+
If you prefer to build locally:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
cd scripts
|
|
231
|
+
chmod +x build-release.sh
|
|
232
|
+
./build-release.sh
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
After the package is created, upload it manually to GitHub Releases.
|
|
236
|
+
|
|
237
|
+
## Configuration
|
|
238
|
+
|
|
239
|
+
The CLI stores configuration in:
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
~/.devc/
|
|
243
|
+
├── cache/
|
|
244
|
+
│ └── templates/ # Downloaded templates
|
|
245
|
+
└── config.json # CLI configuration (Git user, etc.)
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### config.json Example
|
|
249
|
+
|
|
250
|
+
```json
|
|
251
|
+
{
|
|
252
|
+
"templates_version": "1.0.0",
|
|
253
|
+
"last_check": "2026-03-31",
|
|
254
|
+
"git": {
|
|
255
|
+
"name": "Your Name",
|
|
256
|
+
"email": "your@email.com"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## License
|
|
262
|
+
|
|
263
|
+
MIT
|
|
264
|
+
|
|
265
|
+
## Links
|
|
266
|
+
|
|
267
|
+
- [GitHub Repository](https://github.com/SamitoX4/devc)
|
|
268
|
+
- [Templates Repository](https://github.com/SamitoX4/devcontainers)
|
package/bin/devc.js
CHANGED
|
@@ -18,7 +18,7 @@ const binPath = path.join(vendorDir, asset.bin);
|
|
|
18
18
|
|
|
19
19
|
if (!fs.existsSync(binPath)) {
|
|
20
20
|
console.error(
|
|
21
|
-
'devc binary not found. Please reinstall the package (npm
|
|
21
|
+
'devc binary not found. Please reinstall the package (npm i @blackycoderx4/devc).'
|
|
22
22
|
);
|
|
23
23
|
process.exit(1);
|
|
24
24
|
}
|
package/package.json
CHANGED