--- sidebar_position: 3 --- # CLI Usage ```sh-session $ npm install -g @the-codegen-project/cli $ codegen COMMAND running command... $ codegen (--version) @the-codegen-project/cli/0.72.0 linux-x64 node-v22.22.2 $ codegen --help [COMMAND] USAGE $ codegen COMMAND ... ``` ## Table of contents * [CLI Usage](#cli-usage) ## Commands * [`codegen autocomplete [SHELL]`](#codegen-autocomplete-shell) * [`codegen base`](#codegen-base) * [`codegen generate [FILE]`](#codegen-generate-file) * [`codegen help [COMMAND]`](#codegen-help-command) * [`codegen init`](#codegen-init) * [`codegen telemetry ACTION`](#codegen-telemetry-action) * [`codegen version`](#codegen-version) ## `codegen autocomplete [SHELL]` Display autocomplete installation instructions. ``` USAGE $ codegen autocomplete [SHELL] [-r] ARGUMENTS SHELL (zsh|bash|powershell) Shell type FLAGS -r, --refresh-cache Refresh cache (ignores displaying instructions) DESCRIPTION Display autocomplete installation instructions. EXAMPLES $ codegen autocomplete $ codegen autocomplete bash $ codegen autocomplete zsh $ codegen autocomplete powershell $ codegen autocomplete --refresh-cache ``` _See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.45/src/commands/autocomplete/index.ts)_ ## `codegen base` ``` USAGE $ codegen base [--json] [--no-color] [--debug | [-q | -v | --silent] | ] FLAGS -q, --quiet Only show errors and warnings -v, --verbose Show detailed output --debug Show debug information --json Output results as JSON for scripting --no-color Disable colored output --silent Suppress all output except fatal errors ``` _See code: [src/commands/base.ts](https://github.com/the-codegen-project/cli/blob/v0.72.0/src/commands/base.ts)_ ## `codegen generate [FILE]` Generate code based on your configuration, use `init` to get started, `generate` to generate code from the configuration. ``` USAGE $ codegen generate [FILE] [--json] [--no-color] [--debug | [-q | -v | --silent] | ] [--help] [-w] [-p ] ARGUMENTS FILE Path or URL to the configuration file, defaults to root of where the command is run FLAGS -p, --watchPath= Optional path to watch for changes when --watch flag is used. If not provided, watches the input file from configuration -q, --quiet Only show errors and warnings -v, --verbose Show detailed output -w, --watch Watch for file changes and regenerate code automatically --debug Show debug information --help Show CLI help. --json Output results as JSON for scripting --no-color Disable colored output --silent Suppress all output except fatal errors DESCRIPTION Generate code based on your configuration, use `init` to get started, `generate` to generate code from the configuration. ``` _See code: [src/commands/generate.ts](https://github.com/the-codegen-project/cli/blob/v0.72.0/src/commands/generate.ts)_ ## `codegen help [COMMAND]` Display help for codegen. ``` USAGE $ codegen help [COMMAND...] [-n] ARGUMENTS COMMAND... Command to show help for. FLAGS -n, --nested-commands Include all nested commands in the output. DESCRIPTION Display help for codegen. ``` _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.22/src/commands/help.ts)_ ## `codegen init` Initialize The Codegen Project in your project ``` USAGE $ codegen init [--json] [--no-color] [--debug | | [--silent | -v | -q]] [--help] [--input-file ] [--config-name ] [--input-type asyncapi|openapi] [--output-directory ] [--config-type esm|json|yaml|ts] [--languages typescript] [--no-tty] [--include-payloads] [--include-headers] [--include-client] [--include-parameters] [--include-channels] [--gitignore-generated] FLAGS -q, --quiet Only show errors and warnings -v, --verbose Show detailed output --config-name= [default: codegen] The name to use for the configuration file (dont include file extension) --config-type=