# `fxt` fxt is a CLI tool to manage project and file generator templates. [See the Flexlate documentation]( https://nickderobertis.github.io/flexlate/ ) for more information. **Usage**: ```console $ fxt [OPTIONS] COMMAND [ARGS]... ``` **Options**: * `-v, --version`: Show Flexlate version and exit * `--install-completion`: Install completion for the current shell. * `--show-completion`: Show completion for the current shell, to copy it or customize the installation. * `--help`: Show this message and exit. **Commands**: * `add`: Add template sources and generate new... * `bootstrap`: Sets up a Flexlate project from an existing... * `check`: Checks whether there are any updates... * `config`: Modify Flexlate configs via CLI * `init`: Initializes a flexlate project. * `init-from`: Generates a project from a template and sets... * `merge`: Merges feature flexlate branches into the... * `push`: Push Flexlate branches to remote... * `remove`: Remove template sources and previously... * `sync`: Syncs manual changes to the flexlate... * `undo`: Undoes the last flexlate operation, like... * `update`: Updates applied templates in the project to... ## `fxt add` Add template sources and generate new projects and files from existing template sources See the [user guide on adding new templates within an existing project]( https://nickderobertis.github.io/flexlate/tutorial/get-started/add-to-project.html ) for more details. **Usage**: ```console $ fxt add [OPTIONS] COMMAND [ARGS]... ``` **Options**: * `--help`: Show this message and exit. **Commands**: * `output`: Applies a template to a given location, and... * `source`: Adds a new template source, so that files can... ### `fxt add output` Applies a template to a given location, and stores it in config so it can be updated See the [user guide on adding new templates within an existing project]( https://nickderobertis.github.io/flexlate/tutorial/get-started/add-to-project.html ) for more details. **Usage**: ```console $ fxt add output [OPTIONS] NAME [TEMPLATE_ROOT] ``` **Arguments**: * `NAME`: The name of the template. It must match a name in template sources [required] * `[TEMPLATE_ROOT]`: The root directory the template should be rendered from, defaults to current **Options**: * `-a, --add-mode [local|project|user]`: Local adds the config to the template root, project adds it to the project config (which may also be template root), and user adds it to the user config * `-n, --no-input`: Whether to proceed without any input from the user (skip all prompts) * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ### `fxt add source` Adds a new template source, so that files can be generated from it. See the [user guide on adding new templates within an existing project]( https://nickderobertis.github.io/flexlate/tutorial/get-started/add-to-project.html ) for more details. **Usage**: ```console $ fxt add source [OPTIONS] PATH [NAME] ``` **Arguments**: * `PATH`: Template source. Can be a file path or a git url [required] * `[NAME]`: A custom name for the template. By default, it will use the folder or repo name **Options**: * `-v, --version TEXT`: A specific version to target. Only useful for git repos, pass a branch name or commit SHA * `-r, --root PATH`: The root directory the template should be rendered from, defaults to current * `-a, --add-mode [local|project|user]`: Local adds the config to the template root, project adds it to the project config (which may also be template root), and user adds it to the user config * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ## `fxt bootstrap` Sets up a Flexlate project from an existing project that was already generated by another tool such as Cookiecutter or Copier. See the user guide on [adding Flexlate to a project already generated from a template]( https://nickderobertis.github.io/flexlate/tutorial/get-started/existing-project.html ) for more information. **Usage**: ```console $ fxt bootstrap [OPTIONS] TEMPLATE_PATH [PATH] ``` **Arguments**: * `TEMPLATE_PATH`: A template source path to bootstrap the project from. Can be a file path or a git url [required] * `[PATH]`: The location of the project [default: .] **Options**: * `-v, --version TEXT`: A specific version to target. Only useful for git repos, pass a branch name or commit SHA * `-n, --no-input`: Whether to proceed without any input from the user (skip all prompts) * `-q, --quiet`: Suppress CLI output except for prompts * `-a, --add-mode [local|project|user]`: Local adds the config to the template root, project adds it to the project config (which may also be template root), and user adds it to the user config [default: local] * `-r, --remote TEXT`: The name of the remote repository [default: origin] * `--merged-branch-name TEXT`: The name of the branch that flexlate creates to store the merges between template updates and the project [default: flexlate-output] * `--template-branch-name TEXT`: The name of the branch that flexlate creates that stores only the template output [default: flexlate-templates] * `--help`: Show this message and exit. ## `fxt check` Checks whether there are any updates available for the current template sources Displays a tabular output of the templates that need to be updated. It will also exist with code 1 when updates are available so that it is easy to use in scripting. See the user guide on [updating templates]( https://nickderobertis.github.io/flexlate/tutorial/updating.html ), especially [the section about checking for updates]( https://nickderobertis.github.io/flexlate/tutorial/updating.html#checking-for-updates ), for more information. **Usage**: ```console $ fxt check [OPTIONS] [NAMES]... ``` **Arguments**: * `[NAMES]...`: Optional names of templates to updates. Defaults to all templates **Options**: * `--path PATH`: The location of the project [default: .] * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ## `fxt config` Modify Flexlate configs via CLI **Usage**: ```console $ fxt config [OPTIONS] COMMAND [ARGS]... ``` **Options**: * `--help`: Show this message and exit. **Commands**: * `target`: Updates a target version for a template... ### `fxt config target` Updates a target version for a template source. If no version is passed, it will remove the targeting so it will always update. See the user guide on [updating templates]( https://nickderobertis.github.io/flexlate/tutorial/updating.html ), especially [the section about changing target version]( https://nickderobertis.github.io/flexlate/tutorial/updating.html#change-target-version ), for more information. **Usage**: ```console $ fxt config target [OPTIONS] NAME [VERSION] ``` **Arguments**: * `NAME`: The name of the template. It must match a name in template sources [required] * `[VERSION]`: A specific version to target. Only useful for git repos, pass a branch name or commit SHA **Options**: * `--path PATH`: The location of the project [default: .] * `-a, --add-mode [local|project|user]`: Local adds the config to the template root, project adds it to the project config (which may also be template root), and user adds it to the user config * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ## `fxt init` Initializes a flexlate project. This must be run before other commands See the user guide on [adding templates within an existing project]( https://nickderobertis.github.io/flexlate/tutorial/get-started/add-to-project.html ) for more details. **Usage**: ```console $ fxt init [OPTIONS] [PATH] ``` **Arguments**: * `[PATH]`: The location of the project [default: .] **Options**: * `-a, --add-mode [local|project|user]`: Local adds the config to the template root, project adds it to the project config (which may also be template root), and user adds it to the user config [default: local] * `--merged-branch-name TEXT`: The name of the branch that flexlate creates to store the merges between template updates and the project [default: flexlate-output] * `--template-branch-name TEXT`: The name of the branch that flexlate creates that stores only the template output [default: flexlate-templates] * `--user`: Store the flexlate project configuration in the user directory rather than in the project [default: False] * `-r, --remote TEXT`: The name of the remote repository [default: origin] * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ## `fxt init-from` Generates a project from a template and sets it up as a Flexlate project. Note that this will also create a new folder and initialize a git repository in it before adding the Flexlate output. See the user guide on [creating a new project with Flexlate]( https://nickderobertis.github.io/flexlate/tutorial/get-started/new-project.html ) for more information. **Usage**: ```console $ fxt init-from [OPTIONS] TEMPLATE_PATH [PATH] ``` **Arguments**: * `TEMPLATE_PATH`: A template source path to initialize the project from. Can be a file path or a git url [required] * `[PATH]`: The location of the project [default: .] **Options**: * `-v, --version TEXT`: A specific version to target. Only useful for git repos, pass a branch name or commit SHA * `-f, --folder-name TEXT`: The name of the outputted folder. This only applies on templates that don't set the name of the folder (Copier) [default: project] * `-n, --no-input`: Whether to proceed without any input from the user (skip all prompts) * `-q, --quiet`: Suppress CLI output except for prompts * `-a, --add-mode [local|project|user]`: Local adds the config to the template root, project adds it to the project config (which may also be template root), and user adds it to the user config [default: local] * `-r, --remote TEXT`: The name of the remote repository [default: origin] * `--merged-branch-name TEXT`: The name of the branch that flexlate creates to store the merges between template updates and the project [default: flexlate-output] * `--template-branch-name TEXT`: The name of the branch that flexlate creates that stores only the template output [default: flexlate-templates] * `--help`: Show this message and exit. ## `fxt merge` Merges feature flexlate branches into the main flexlate branches Feature flexlate branches should be merged into main flexlate branches when the corresponding feature branch is merged into the repo's main branch. This command provides a convenient way to do so. See the user guide on [saving Flexlate updates]( https://nickderobertis.github.io/flexlate/tutorial/saving.html ), especially [the section about locally merging branches]( https://nickderobertis.github.io/flexlate/tutorial/saving.html#locally-merging-branches ), for more information. **Usage**: ```console $ fxt merge [OPTIONS] [BRANCH_NAME] ``` **Arguments**: * `[BRANCH_NAME]`: Optional name of feature branch for which to merge corresponding flexlate branches. Defaults to current branch **Options**: * `-n, --no-delete`: Pass to prevent deleting feature flexlate branches after merge * `--path PATH`: The location of the project [default: .] * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ## `fxt push` Push Flexlate branches to remote repositories. See the user guide on [saving Flexlate updates]( https://nickderobertis.github.io/flexlate/tutorial/saving.html ) for more information. **Usage**: ```console $ fxt push [OPTIONS] COMMAND [ARGS]... ``` **Options**: * `--help`: Show this message and exit. **Commands**: * `feature`: Pushes feature Flexlate branches to remote... * `main`: Pushes main Flexlate branches to remote See... ### `fxt push feature` Pushes feature Flexlate branches to remote See the user guide on [saving Flexlate updates]( https://nickderobertis.github.io/flexlate/tutorial/saving.html ), especially [the section about pushing changes with a PR workflow]( https://nickderobertis.github.io/flexlate/tutorial/saving.html#push-your-flexlate-feature-branch-changes ), for more information. **Usage**: ```console $ fxt push feature [OPTIONS] [FEATURE_BRANCH] ``` **Arguments**: * `[FEATURE_BRANCH]`: The name of the branch used while running the flexlate operations for which we want to push the corresponding flexlate branches **Options**: * `-r, --remote TEXT`: The name of the remote repository [default: origin] * `--path PATH`: The location of the project [default: .] * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ### `fxt push main` Pushes main Flexlate branches to remote See the user guide on [saving Flexlate updates]( https://nickderobertis.github.io/flexlate/tutorial/saving.html ), especially [the section about pushing with a local workflow]( https://nickderobertis.github.io/flexlate/tutorial/saving.html#push-your-flexlate-main-branch-changes ), for more information. **Usage**: ```console $ fxt push main [OPTIONS] ``` **Options**: * `-r, --remote TEXT`: The name of the remote repository * `--path PATH`: The location of the project [default: .] * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ## `fxt remove` Remove template sources and previously generated outputs **Usage**: ```console $ fxt remove [OPTIONS] COMMAND [ARGS]... ``` **Options**: * `--help`: Show this message and exit. **Commands**: * `output`: Removes an applied template output * `source`: Removes a template source, so that files can... ### `fxt remove output` Removes an applied template output **Usage**: ```console $ fxt remove output [OPTIONS] TEMPLATE_NAME [TEMPLATE_ROOT] ``` **Arguments**: * `TEMPLATE_NAME`: The name of the template source corresponding to the applied template output to remove [required] * `[TEMPLATE_ROOT]`: The root directory the template should be rendered from, defaults to current **Options**: * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ### `fxt remove source` Removes a template source, so that files can no longer be generated from it. **Usage**: ```console $ fxt remove source [OPTIONS] TEMPLATE_NAME ``` **Arguments**: * `TEMPLATE_NAME`: The name of the template source to remove [required] **Options**: * `-r, --root PATH`: The root directory the template should be rendered from, defaults to current * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ## `fxt sync` Syncs manual changes to the flexlate branches, and updates templates accordingly. This is useful if you want to move or modify flexlate configs after they are created, but there is no command in the CLI for it. Note: Be sure to commit your changes before running sync See the user guide on [making arbitrary changes]( https://nickderobertis.github.io/flexlate/tutorial/arbitrary-changes.html ) for more information. **Usage**: ```console $ fxt sync [OPTIONS] [PATH] ``` **Arguments**: * `[PATH]`: The location of the project [default: .] **Options**: * `-p, --prompt`: Pass to enable answering template prompts * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ## `fxt undo` Undoes the last flexlate operation, like ctrl/cmd + z for flexlate. Note that this modifies the git history, discarding the last commits. It has protections against deleting user commits but you should only use this on a feature branch. See the user guide on [undoing Flexlate operations]( https://nickderobertis.github.io/flexlate/tutorial/undoing.html ) for more information. **Usage**: ```console $ fxt undo [OPTIONS] [NUM_OPERATIONS] ``` **Arguments**: * `[NUM_OPERATIONS]`: Number of flexlate operations to undo [default: 1] **Options**: * `--path PATH`: The location of the project [default: .] * `-q, --quiet`: Suppress CLI output except for prompts * `--help`: Show this message and exit. ## `fxt update` Updates applied templates in the project to the newest versions available that still satisfy source target versions See the user guide on [updating templates]( https://nickderobertis.github.io/flexlate/tutorial/updating.html ) for more information. **Usage**: ```console $ fxt update [OPTIONS] [NAMES]... ``` **Arguments**: * `[NAMES]...`: Optional names of templates to updates. Defaults to all templates **Options**: * `-n, --no-input`: Whether to proceed without any input from the user (skip all prompts) * `-a, --abort`: Automatically abort the update if a merge conflict is encountered. Useful in combination with --no-input for CI systems [default: False] * `-c, --no-cleanup`: Do not abort the merge or reset branch state upon abort. Note that this flag is ignored if --abort is not passed [default: False] * `-q, --quiet`: Suppress CLI output except for prompts * `--path PATH`: The location of the project [default: .] * `--help`: Show this message and exit.