Command
This page is the compact reference for decorators and provider classes. See Concepts, Tooling, and Errors for behavior details.
| Signature | Structure | Description |
|---|---|---|
@Command(params: CommandParams) | CommandParams = { name: string, description?: string, alias?: string } | Create a command. |
@Option(params: OptionParams) | OptionParams = { name: string, type?: OptionType, description?: string, alias?: string } | Create an option. |
@SubOptions(params: Array<OptionParams>) | Same as OptionParams. | Create sub-options, usually used with Command. |
@CommandMissing() | - | Create a handler for undeclared commands. |
@CommandMajor() | - | Create the main command. |
@CommandError() | - | Create one handler for runtime-print errors. |
Arguments
All providers used to get parameters.
| Signature | Description |
|---|---|
CommandArgsProvider | Provides information about the current command. |
OptionArgsProvider | Provides information about the current option. |
RegisterProvider | Provides all registered metadata. |
CommandErrorProvider | Provides the current error to a CommandError handler. |
Support
funcgo provides the standard development and build commands for
func projects. The full workflow is documented in
Tooling.
| Signature | Structure | Description |
|---|---|---|
funcgo setup | --fix? | Inspect package.json and suggest missing func.entry, func.outDir, bin, dev script, and build script configuration. |
funcgo dev | -f, --file <entry>; -- <args> | Run the project entry with a local TypeScript runtime and pass arguments through to the command. |
funcgo build | -f, --file <entry>; -o, --out <dir>; -e, --external <package> | Bundle the project entry for production, write output to func.outDir or dist, and create the executable bin.js. |
Configuration
funcgo setup --fix can write the recommended project configuration automatically.
| Signature | Description |
|---|---|
package.json#func.entry | Default TypeScript entry file used by funcgo dev and funcgo build when --file is not provided. |
package.json#func.outDir | Default build output directory used by funcgo build when --out is not provided. |