keyman-cli 0.0.0-stage → 0.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/LICENSE +21 -0
- package/README.md +25 -2
- package/bin/keyman.cjs +37 -0
- package/bin/native/aarch64-apple-darwin/keyman +0 -0
- package/bin/native/aarch64-unknown-linux-gnu/keyman +0 -0
- package/bin/native/x86_64-apple-darwin/keyman +0 -0
- package/bin/native/x86_64-pc-windows-msvc/keyman.exe +0 -0
- package/bin/native/x86_64-unknown-linux-gnu/keyman +0 -0
- package/package.json +24 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 moonmangit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# keyman-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Install the Rust-based Keyman CLI with npm:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install -g keyman-cli
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Create a private `.yml` file with one mapping per project:
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
my-app:
|
|
13
|
+
API_KEY: "secret-value"
|
|
14
|
+
DEBUG: "true"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then run:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
keyman load /path/to/master.yml
|
|
21
|
+
keyman inject my-app /path/to/existing/project
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`load` remembers the master file path. `inject` replaces the project's `.env` file. Keep the master file private and ignore `.env` in Git.
|
|
25
|
+
|
|
26
|
+
Prebuilt binaries are included for Windows x64, macOS Intel and Apple Silicon, and Linux x64 and ARM64. No Rust installation is needed. [Source and full documentation](https://github.com/moonmangit/keyman-cli).
|
package/bin/keyman.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const { spawnSync } = require('node:child_process');
|
|
6
|
+
|
|
7
|
+
const targets = {
|
|
8
|
+
'darwin-arm64': 'aarch64-apple-darwin',
|
|
9
|
+
'darwin-x64': 'x86_64-apple-darwin',
|
|
10
|
+
'linux-arm64': 'aarch64-unknown-linux-gnu',
|
|
11
|
+
'linux-x64': 'x86_64-unknown-linux-gnu',
|
|
12
|
+
'win32-x64': 'x86_64-pc-windows-msvc',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const platform = `${process.platform}-${process.arch}`;
|
|
16
|
+
const target = targets[platform];
|
|
17
|
+
if (!target) {
|
|
18
|
+
console.error(`keyman: unsupported platform ${platform}`);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const binary = path.join(__dirname, 'native', target, `keyman${process.platform === 'win32' ? '.exe' : ''}`);
|
|
23
|
+
if (!fs.existsSync(binary)) {
|
|
24
|
+
console.error(`keyman: binary for ${platform} is missing from this package`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' });
|
|
29
|
+
if (result.error) {
|
|
30
|
+
console.error(`keyman: ${result.error.message}`);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
if (result.signal) {
|
|
34
|
+
process.kill(process.pid, result.signal);
|
|
35
|
+
} else {
|
|
36
|
+
process.exitCode = result.status ?? 1;
|
|
37
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keyman-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Manage project .env files from one private YAML file",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/moonmangit/keyman-cli.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/moonmangit/keyman-cli#readme",
|
|
11
|
+
"bugs": "https://github.com/moonmangit/keyman-cli/issues",
|
|
12
|
+
"bin": {
|
|
13
|
+
"keyman": "bin/keyman.cjs"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"bin/",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
}
|
|
26
|
+
}
|