@alarife/tools
v1.0.0
Published
Command line functionalities for plugin management in Alarife.
Downloads
552
Readme
@alarife/tools - Command line functionalities for plugin management in Alarife.
Alarife CLI toolset for plugin development
📋 Table of Contents
🚀 Installation
npm install @alarife/tools --save-dev⚙️ Commands
| Command | Description |
|---|---|
| add-license | Add the license paragraph to the beginning of each file. |
| copy | Copy files from source to target. |
| generate-key | Generate a random key pair (public/private). |
| encrypt | Encrypt a value with a public key. |
| decrypt | Decrypt a value with a private key. |
| new-plugin | Generate a new plugin from the Alarife skeleton. |
📦 Basic Usage
add-license
Adds a license header to all matching files in a directory. Files that already contain a license header are skipped.
alarife-tools add-license ./src \
--extensions ts js \
--project-name=@alarife/tools \
--project-author="Soria Garcia Jose Eduardo" \
--project-license=Apache-2.0| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| path | argument | ✅ | — | Path to the directory to process. |
| --extensions | option | ❌ | js | File extensions to include (variadic). |
| --project-name | option | ✅ | — | Name of the project. |
| --project-author | option | ✅ | — | Author of the project. |
| --project-license | option | ❌ | Apache-2.0 | License identifier. |
copy
Copies files or directories from a source path to a target path.
alarife-tools copy ./src ./dist --deep| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| source | argument | ✅ | — | Path to the source file or directory. |
| target | argument | ✅ | — | Path to the target location. |
| --deep, -d | option | ❌ | false | Copy directories recursively. |
generate-key
Generates a cryptographic key pair and saves the private key to the specified path. The public key is printed to stdout.
alarife-tools generate-key ./keys/private.pem \
--key-type=ed25519 \
--key-format=pem| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| target | argument | ✅ | — | Path to save the generated private key. |
| --key-type | option | ❌ | ed25519 | Type of key to generate. |
| --private-export-type | option | ❌ | pkcs8 | Private key export type. |
| --public-export-type | option | ❌ | spki | Public key export type. |
| --key-format | option | ❌ | pem | Key export format. |
encrypt
Encrypts a value using a public key. The output is prefixed with {cipher}.
alarife-tools encrypt "my-secret-value" ./keys/public.pem --encoding=base64| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| value | argument | ✅ | — | Value to encrypt. |
| key-path | argument | ✅ | — | Path to the public key file. |
| --encoding | option | ❌ | base64 | Encoding for the encrypted output. |
decrypt
Decrypts a {cipher} prefixed value using a private key.
alarife-tools decrypt "{cipher}encrypted-value" ./keys/private.pem --encoding=base64| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| value | argument | ✅ | — | Encrypted value to decrypt (with or without {cipher} prefix). |
| key-path | argument | ✅ | — | Path to the private key file. |
| --encoding | option | ❌ | base64 | Input encoding of the encrypted value. |
new-plugin
Scaffolds a new Alarife plugin from the official skeleton repository.
alarife-tools new-plugin ./my-plugin \
--author-name="Soria Garcia Jose Eduardo" \
--author-email="[email protected]" \
--library-name=alarife-my-plugin \
--package-name=@alarife/my-plugin \
--package-description="My custom Alarife plugin" \
--plugin-resume="A brief description of the plugin"| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| target | argument | ✅ | — | Path to generate the plugin. |
| --author-name | option | ✅ | — | Plugin author name. |
| --author-email | option | ✅ | — | Plugin author email. |
| --library-name | option | ✅ | — | Library name for the plugin. |
| --package-name | option | ✅ | — | NPM package name. |
| --package-description | option | ✅ | — | Package description. |
| --plugin-resume | option | ✅ | — | Short plugin summary. |
📄 License
This project is licensed under Apache-2.0. See the LICENSE file for details.
Built with ❤️ by Jose Eduardo Soria Garcia
🌍 Product developed in Andalucia, España 🇪🇸
Part of the Alarife ecosystem
