Allow Actionhero developers to create new files in ./bin
which can be run via the CLI. These commands will have access to a the Actionhero api
and CLI arguments object within a run
method.
You can create namespaces for commands by using folders. For example, a file in ./bin/redis/keys
would be run via npx Actionhero redis keys
import { api, log, CLI } from "actionhero";
export class RedisKeys extends CLI {
constructor() {
super();
this.name = "redis keys";
this.description = "I list all the keys in redis";
this.example = "actionhero keys --prefix actionhero";
this.inputs = {
prefix: {
required: true,
default: "actionhero",
note: "the redis prefix for searching keys",
},
};
}
async run({ params }) {
let keys = await api.redis.clients.client.keys(params.prefix);
log("Found " + keys.length + "keys:");
keys.forEach((k) => {
log(k);
});
}
}
actionhero CLI commands have:
Inputs for CLI commands have:
These are sourced automatically by actionhero help
, and the example above would return:
* redis keys
description: I list all the keys in redis
example: actionhero keys --prefix actionhero
inputs:
[prefix] (optional)
note: the redis prefix for searching keys
default: actionhero
The Actionhero server is open source, under the Apache-2 license
Actionhero runs on Linux, OS X, and Windows
You always have access to the Actionhero team via Slack and Github
We provide support for corporate & nonprofit customers starting at a flat rate of $200/hr. Our services include:
We have packages appropriate for all company sizes. Contact us to learn more.
We provide support for corporate & nonprofit customers starting at a flat rate of $200/hr. Our services include:
We have packages appropriate for all company sizes. Contact us to learn more.
For larger customers in need of a support contract, we offer an enterprise plan including everything in the Premium plan plus: