Tooling
funcgo is the companion CLI for local development, project setup,
and production bundling. The template wires these commands into
package.json for you.
If you created your project with the default func template,
funcgo is already integrated. You can run the template scripts
directly and do not need to run funcgo setup again.
Setup
funcgo setup inspects your project and prints suggested
configuration changes. Use it when you add funcgo to an existing
project or repair a custom setup. Add --fix to write the
recommended fields.
funcgo setup funcgo setup --fix
Setup can infer or write func.entry, func.outDir,
bin, scripts.dev, and scripts.build.
Development
funcgo dev runs the TypeScript entry through a local runtime. Use
-- to pass arguments to your CLI.
funcgo dev -- hello funcgo dev -f src/index.ts -- hello --help
Build
funcgo build bundles the configured entry, writes the output
directory, and creates an executable bin.js.
funcgo build funcgo build -o dist funcgo build -e react -e ink
Use -e or --external for packages that should stay
external to the bundle.
Configuration
These fields are the main contract between your package and
funcgo:
"func": {
"entry": "src/index.ts",
"outDir": "dist"
},
"bin": {
"my-cli": "./dist/bin.js"
}