Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
piral-cli
Advanced tools
The standard CLI for creating and building a Piral instance or a Pilet.
Piral CLI is a command-line tool that can also be used as a library. It should make common tasks such as building a pilet, scaffolding a pilet, or debugging a piral instance simple.
Internally, Piral CLI is build upon existing tools with connection points to their respective eco-systems.
For details on the available commands check out the documentation at Piral or on GitHub.
The Piral CLI can be extended with plugins.
Right now the following generic plugins exist:
Also the following bundler plugin exists (bringing build/debug capabilities):
You'll find an updated list on NPM using the keyword piral-cli.
A plugin has to be an NPM module with a name that starts with piral-cli-
, e.g., piral-cli-local-feed
.
Recommendation: If your CLI plugin adds a new command, name your plugin accordingly, e.g., for a new command named foo-piral
create an NPM package called piral-cli-foo-piral
. The foo-piral
command can be invoked by the user in the command line via piral foo
or pb foo-piral
.
The NPM module needs to look as follows:
module.exports = function (cliApi) {
// your code
};
With the CLI API you can do things such as wrapping commands or adding new commands. For commands the yargs command definition is followed.
An example command for a pilet:
module.exports = function (cliApi) {
cliApi.withCommand({
name: 'dependencies-pilet',
alias: ['deps-pilet'],
description: 'Lists the dependencies of the current pilet.',
arguments: [],
flags(argv) {
return argv
.boolean('only-shared')
.describe('only-shared', 'Only outputs the declared shared dependencies.')
.default('only-shared', false)
.string('base')
.default('base', process.cwd())
.describe('base', 'Sets the base directory. By default the current directory is used.');
},
run(args) {
// your code here, where args.onlyShared refers to our custom argument
},
});
};
The resolution for plugins is as follows:
piral-cli
must be installed/run locally)Plugins are never loaded twice. Local versions have precedence.
Using a plugin you can also attach to the hooks of the pilet build/debug
and piral build/debug
commands.
module.exports = function (cliApi) {
cliApi.wrapCommand('debug-pilet', (args, run) => run({
...args,
hooks: {
afterBuild({ outFile, outDir }) {
console.log('Build done', outFile, outDir);
},
},
}));
};
In this case the afterBuild
hook of the pilet debug
command is set. You can do whatever else hook, too. Furthermore, you are not limited to a single command - you might want to wrap multiple here.
Piral is released using the MIT license. For more information see the license file.
FAQs
The standard CLI for creating and building a Piral instance or a Pilet.
The npm package piral-cli receives a total of 7,760 weekly downloads. As such, piral-cli popularity was classified as popular.
We found that piral-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.