Genotype CLI
The Genotype installation includes the gt binary, which you can use to run Genotype commands.
Project Paths
Section titled “Project Paths”Genotype resolves a project by searching for genotype.toml in a starting directory and then its parents. The first configuration file found defines the project. An explicit configuration path bypasses this search.
Paths can be absolute or relative to the working directory. The resolved configuration determines the project root, source files, and output directories.
gt init
Section titled “gt init”gt init starts an interactive wizard that creates genotype.toml and a src directory, with optional example types:
gt init [PATH]PATH is the directory to create the project in. It defaults to the current directory:
gt init ./bookstore-typesThe wizard helps you choose target languages, generate standalone packages or integrate into existing ones, optionally add example types, and install the Genotype agent skill as the final step. You can adjust these choices later in genotype.toml.
gt skill
Section titled “gt skill”gt skill install
Section titled “gt skill install”Install the bundled Genotype agent skill or update existing installations:
gt skill install [PATH] [--agent AGENT]gt skill update [PATH]PATH defaults to the current directory. Installation prompts for an agent unless --agent is specified. Update discovers installed skills in known agent directories under PATH and replaces their bundled files with the content from your installed CLI.
See Agent Skill for more info and installation instructions.
gt skill update
Section titled “gt skill update”gt build
Section titled “gt build”gt build builds the project using the configuration in genotype.toml or a specified configuration file or directory.
gt build [PATH] [--config CONFIG]PATH is the starting directory for project resolution. It defaults to the current directory:
gt buildSource selection and target options come from genotype.toml.
Configuration File
Section titled “Configuration File”--config selects a configuration file explicitly, instead of searching for genotype.toml:
gt build --config ./genotype.release.tomlThe path is relative to the working directory, even when you also pass a project path. Paths inside the configuration are resolved from its directory; see project root.
Exit Status
Section titled “Exit Status”For scripts and CI, a successful build exits with status 0. Build errors exit with status 1. Warnings alone don’t cause a build failure.
gt version
Section titled “gt version”gt version updates package versions in genotype.toml. It has two subcommands: set and bump.
Changes are saved to the configuration. Run gt build afterward to update generated package manifests.
Version Fields
Section titled “Version Fields”Package versions come from the global version and any overrides in target manifests. Existing overrides are updated even when their targets are disabled.
gt version set
Section titled “gt version set”gt version set assigns a version to the existing version fields:
gt version set VERSION [PATH] [--ts VERSION] [--py VERSION] [--rs VERSION]PATH selects the starting directory for project resolution and defaults to the current directory.
VERSION is required and accepts a semantic version string, e.g., 0.2.0:
gt version set 0.2.0If no version fields exist, this adds a global version. Otherwise, it updates the fields already present without adding missing global or target fields.
Target Version Overrides
Section titled “Target Version Overrides”Use --ts, --py, or --rs to assign a different version to an existing target override. --rust is an alias for --rs:
gt version set 0.3.0 --ts 0.4.0 --py 0.5.0 --rs 0.6.0These flags require an existing version in the target manifest. Targets without an override inherit the global version.
The positional VERSION must be at least as high as every existing version field, including targets with an override flag.
gt version bump
Section titled “gt version bump”gt version bump increments a version component in every existing version field:
gt version bump [PART] [PATH]PATH selects the starting directory for project resolution and defaults to the current directory.
PART accepts major, minor, or patch and defaults to minor:
gt version bumpStarting from 1.2.3, each choice produces:
| Command | Result |
|---|---|
gt version bump major |
2.0.0 |
gt version bump minor |
1.3.0 |
gt version bump patch |
1.2.4 |
Each version is bumped independently. E.g., a patch bump changes a global version of 0.2.0 to 0.2.1 and a TypeScript override of 0.3.4 to 0.3.5.
To bump another project, specify the part before its path:
gt version bump patch ./bookstore-typesIf no version fields exist, the command reports an error. Use gt version set to assign an initial version first.
Help and CLI Version
Section titled “Help and CLI Version”Run gt without arguments to show the available commands. You can also use --help or -h:
gt --helpUse --help with a command to see its arguments and options:
gt build --helpTo print the installed CLI version, use --version or -V:
gt --versionThe gt version command manages your project’s package versions.