fleet/pkg/spec
Scott Gress 91362ba2ca
Add fleetctl new command (#41909)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #41345 

# Details

This PR:

* Adds a new `fleetctl new` command which creates a starter GitOps repo
file structure
* Adds support for file globs for the `configuration_profiles:` key in
GitOps, to support its use in the `fleetctl new` templates. This
involved moving the `BaseItem` type and `SupportsFileInclude` interface
into the `fleet` package so that the `MDMProfileSpec` type could
implement the interface and do glob expansion.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [X] Added/updated automated tests
  - [X] added unit and intg tests for globbing profiles
  - [ ] added tests for `fleetctl new`
- [X] QA'd all new/changed functionality manually
- [X] `fleetctl new` with no args prompted for org name and created a
new `it-and-security` folder under current folder w/ correct files
- [X] `fleetctl new --dir /tmp/testnew` created correct files under
`/tmp/testnew`
- [X] `fleetctl new --dir /tmp/testexisting --force` with an existing
`/tmp/testexisting` folder created correct files under
`/tmp/testexisting`
- [X] `fleetctl new --org-name=foo` created correct files under
`it-and-security` without prompting for org name
- [X] `paths:` in `configuration_profiles` picks up multiple matching
profiles
- [X] `paths:` + `path:` in `configuration_profiles` will error if the
same profile is picked up twice


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added `fleetctl new` command to initialize GitOps repository structure
via CLI.
* Added glob pattern support for `configuration_profiles` field,
enabling flexible profile selection.

* **Chores**
  * Updated CLI dependencies to support enhanced user interactions.
  * Removed legacy website generator configuration files.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-20 17:27:27 -05:00
..
testdata Add aliases for more multi-platform setup experience fields (#41599) 2026-03-13 15:17:05 -05:00
gitops.go Add fleetctl new command (#41909) 2026-03-20 17:27:27 -05:00
gitops_deprecations.go Add more deprecation logs and mute by default (#40305) 2026-02-23 23:09:08 -06:00
gitops_test.go Add fleetctl new command (#41909) 2026-03-20 17:27:27 -05:00
gitops_validate.go Feat/31914 patch policy (#41518) 2026-03-13 16:47:09 -04:00
gitops_validate_test.go Feat/31914 patch policy (#41518) 2026-03-13 16:47:09 -04:00
spec.go Allow hosts key to be empty for manual labels (#42022) 2026-03-20 10:36:14 -05:00
spec_test.go Add aliases for macos fields (#40959) 2026-03-05 18:08:54 -06:00