Exclude CLI-generated APIs from a module
Stop the Catalyst CLI from emitting operations or files you do not want — either an entire CRUD operation across every layer, or one specific file that collides with a hand-written artefact.
Before you start
Section titled “Before you start”- You have a Catalyst project with at least one backend module already scaffolded.
- You know the bounded context and module name (for example,
iam/role). - You can run
catalyst load back module --forcelocally.
-
Locate the module YAML. It lives at
cliter/<bounded-context>/<module>.aurora.yaml. Foriam/role, that iscliter/iam/role.aurora.yaml. -
Choose the granularity you need.
- To remove a whole operation — no controller, no resolver, no handler, no service, no DTO, no GraphQL fragment — use
excludedOperations. - To keep the operation but skip one specific file (because you wrote it by hand or it collides with an
additionalApisfile), useexcludedFiles.
- To remove a whole operation — no controller, no resolver, no handler, no service, no DTO, no GraphQL fragment — use
-
Edit the YAML at its top level. Both keys live next to
aggregatePropertiesandadditionalApis. The names you can list underexcludedOperationsare the ones from the operations table.cliter/iam/role.aurora.yaml additionalApis:- path: iam/role/inherit-permissions-roleresolverType: mutationhttpMethod: postexcludedOperations:- count- getRaw- max- min- sum- updateAndIncrement- upsertexcludedFiles:- backend/src/@app/iam/role/application/upsert/iam-upsert-role.handler.ts -
Regenerate.
Terminal window catalyst load back module --name=iam/role --force -
Remove orphan files by hand. If you just excluded an operation that used to be generated, the files the CLI produced previously stay on disk — the CLI never deletes. Delete them manually, commit, and rerun
catalyst load …to confirm the output is consistent.
Verify it worked
Section titled “Verify it worked”-
Rerun with
--verboseand confirm the excluded operation is not among the emitted paths:Terminal window catalyst load back module --name=iam/role --force --verbose -
For
excludedFiles: confirm the listed path is not reported in the output log. -
Run your usual backend build (
pnpm back:buildor the equivalent in your project) to catch any dangling imports that referred to the removed artefact.
Troubleshooting
Section titled “Troubleshooting”The operation did not reappear after I removed it from excludedOperations.
Double-check for typos. Operation names are case-sensitive and must match the supported set exactly. Rerun with --force --verbose to see every file the CLI considered.
.origin files appeared for operations I did not touch.
That means the on-disk files have hand edits whose SHA-1 no longer matches the lockfile. This is unrelated to exclusion — see Backend module scaffolding → Lockfile and .origin files. Reconcile each .origin, or pass --noReview if you want to handle them later.
I excluded an operation but the GraphQL schema still references it.
The GraphQL type exports regenerate after the module load. If you skipped that step with --noGraphQLTypes, run pnpm back:graphql:types by hand to refresh the exports.
Related
Section titled “Related”- Backend module scaffolding — the concept behind what gets emitted and why.
catalyst loadreference — every flag and argument.