A command-line tool for easily managing zCLI applications and commands with Deno.
curl -fsSL https://raw.githubusercontent.com/jaredLunde/zcli-cli/main/install.sh | sh
Get started by running zcli init
to create a new zCLI application. For more
information, see zcli init
.
Then run zcli add <command>
to add a new command to your zCLI application. The
command will be created in the commands
directory of your zCLI application. It
will be automatically imported and added to the commands
array in your
commands/mod.ts
file. Sub-commands are supported.
Command | Description |
---|---|
zcli |
A command-line tool for easily creating zCLI applications and commands with Deno. |
zcli add |
Add a new command to your zCLI application. |
zcli completion |
Generate an autocompletion script for the specified shell |
zcli completion bash |
Generate an autocompletion script for the bash shell |
zcli completion fish |
Generate an autocompletion script for the fish shell |
zcli completion zsh |
Generate an autocompletion script for the zsh shell |
zcli config |
Manage your zCLI configuration. |
zcli config delete |
Delete a configuration value. |
zcli config get |
Get a configuration value. |
zcli config set |
Set a configuration value. |
zcli help |
Show help for a zcli command |
zcli help commands |
List zcli commands |
zcli init |
Create a new CLI application. |
zcli version |
Show version information |
A command-line tool for easily creating zCLI applications and commands with Deno.
Get started by running zcli init
to create a new zCLI application. For more
information, run zcli help init
.
Then run zcli add <command>
to add a new command to your zCLI application.
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
Add a new command to your zCLI application.
This command will create a new file in the commands
directory of your zCLI
application.
To add a sub-command to an existing command, separate the command arguments with a space.
For example, zcli add foo bar
will create a new command called bar
in the
foo
directory. If the foo
command does not exist, it will be created as
well.
The name of the command to add. To add a sub-command to an existing command, separate the command names with a space.
Type | Variadic? | Description |
---|---|---|
string |
Yes |
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--short, -s | string |
No | Add a short description for the command. | |
--cwd | string |
No | "Deno.cwd()" |
The current working directory. |
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
Generate an autocompletion script for zcli in the specified shell. See each sub-command's help for details on how to use the generated script.
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
Generate the autocompletion script for the bash shell.
This script depends on the bash-completion
package. If it is not installed
already, you can install it via your OS's package manager.
To load completions in your current shell session:
$ source <(zcli completion bash)
To load completions for every new session, execute once:
Linux:
$ zcli completion bash > /etc/bash_completion.d/zcli
macOS:
$ zcli completion bash > /usr/local/etc/bash_completion.d/zcli
You will need to start a new shell for this setup to take effect.
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
Generate the autocompletion script for the fish shell.
To load completions in your current shell session:
$ zcli completion fish | source
To load completions for every new session, execute once:
$ zcli completion fish > ~/.config/fish/completions/zcli.fish
You will need to start a new shell for this setup to take effect.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--no-descriptions | boolean |
No | Disable completion descriptions |
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
Generate the autocompletion script for the zsh shell.
If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
To load completions for every new session, execute once:
Linux:
$ zcli completion zsh > "${fpath[1]}/_zcli"
macOS:
$ zcli completion zsh > /usr/local/share/zsh/site-functions/_zcli
Oh My Zsh:
$ zcli completion zsh > ~/.oh-my-zsh/completions/_zcli
You will need to start a new shell for this setup to take effect.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--no-descriptions | boolean |
No | Disable completion descriptions |
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
This command manages your zCLI configuration. You can use it to set, get, and delete configuration values. Running this command without any subcommands will print your current configuration.
Your configuration is stored in a TOML file at ~/.zcli/config.toml
.
The following configuration values are available:
license
: The default license to use when creating a new application.org
: The default organization to use when creating a new application.
For example, to set the default license to MIT, run:
zcli config set license "mit"
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
Delete a configuration value.
The key to delete.
Type | Variadic? | Description |
---|---|---|
"org" | "license" |
No | The configuration key. |
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
Get a configuration value.
The key to get.
Type | Variadic? | Description |
---|---|---|
"org" | "license" |
No | The configuration key. |
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
Set a configuration value.
The key/value pair to set.
Type | Variadic? | Description |
---|---|---|
"org" | "license" |
No | The configuration key. |
string |
No | The new configuration value. |
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
Show help for a zcli command
Type | Variadic? | Description |
---|---|---|
"add" | "init" | "config" | "version" | "completion" | "help" |
No | The command to show help for. |
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
List zcli commands
Example:
$ zcli help commands
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--all, -a | boolean |
No | Show all commands, including hidden ones |
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
Create a new CLI application. This command will create a new directory in the current working directory with the name of your CLI application. It will also create the following files:
mod.ts
- The entry point for your zCLI application.test/mod.test.ts
- A file for writing tests in your zCLI application.commands
- A directory for your zCLI commands.commands/mod.ts
- An auto-generated file for importing your zCLI commands.deps.ts
- A file for importing dependencies.errors.ts
- A file for defining custom errors.zcli.ts
- A file for importing zCLI.deno.jsonc
- A configuration file for Deno.
To add a command to your CLI application, run zcli add <command>
.
To run your CLI application, run:
deno task run
To test your CLI application, run:
deno task test
To compile your CLI application, run:
deno task compile
To generate documentation for your CLI application, run:
deno task docs
The name of the CLI application. This will be used as the name of the directory to create the CLI application in. If not provided, the current working directory will be used.
Type | Variadic? | Description |
---|---|---|
string |
No | The name of the zCLI application. |
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--cwd | string |
No | "Deno.cwd()" |
The directory to create the zCLI application in. |
--short, -s | string |
No | "An awesome new zCLI application." |
The short description of the zCLI application. |
--license, -l | "agpl3" | "apache" | "bsd2" | "bsd3" | "cc0" | "cc_by" | "cc_by_nc" | "cc_by_nc_sa" | "cc_by_nd" | "cc_by_sa" | "epl" | "gpl2" | "gpl3" | "isc" | "lgpl" | "mit" | "mpl" | "unilicense" | "wtfpl" | "x11" | "zlib" |
No | The license of the zCLI application. | |
--org, -o | string |
No | The organization of the zCLI application. This will be used in the license. |
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |
Shows version information command, including version number and build date.
These flags are available on all commands.
Name | Type | Required? | Default | Description |
---|---|---|---|---|
--help, -h | boolean |
No | Show help for a command |