diff --git a/src/commands/pull.ts b/src/commands/pull.ts index 62c25ccd..9bf75638 100644 --- a/src/commands/pull.ts +++ b/src/commands/pull.ts @@ -17,6 +17,10 @@ const config = { Run \`prismic docs view cli#pull-models-from-prismic\` for details. `, + agents: ` + Use --force only when the user asks for it. It discards uncommitted + local model changes. + `, options: { force: { type: "boolean", diff --git a/src/commands/push.ts b/src/commands/push.ts index ef572a2c..f428fe39 100644 --- a/src/commands/push.ts +++ b/src/commands/push.ts @@ -27,6 +27,10 @@ const config = { Run \`prismic docs view cli#push-models-to-prismic\` for details. `, + agents: ` + Use --force only when the user asks for it. It lets push delete remote + models and skips the git check. + `, options: { force: { type: "boolean", diff --git a/test/pull.test.ts b/test/pull.test.ts index a6285659..87dbb13c 100644 --- a/test/pull.test.ts +++ b/test/pull.test.ts @@ -32,6 +32,16 @@ it("supports --help", { concurrent: false }, async ({ expect, prismic }) => { expect(stdout).toContain("prismic docs view cli#pull-models-from-prismic"); }); +it( + "tells agents to use --force only when the user asks", + { concurrent: false }, + async ({ expect, prismic }) => { + const agent = { nodeOptions: { env: { AI_AGENT: "test-agent" } } }; + const { stdout } = await prismic("pull", ["--help"], agent); + expect(stdout).toContain("Use --force only when the user asks for it."); + }, +); + it( "pulls slices and custom types from remote", { concurrent: false }, diff --git a/test/push.test.ts b/test/push.test.ts index 7ff93bbd..d83bac1a 100644 --- a/test/push.test.ts +++ b/test/push.test.ts @@ -19,6 +19,12 @@ it("supports --help", async ({ expect, prismic }) => { expect(stdout).toContain("prismic docs view cli#push-models-to-prismic"); }); +it("tells agents to use --force only when the user asks", async ({ expect, prismic }) => { + const agent = { nodeOptions: { env: { AI_AGENT: "test-agent" } } }; + const { stdout } = await prismic("push", ["--help"], agent); + expect(stdout).toContain("Use --force only when the user asks for it."); +}); + describe("with an isolated repository", () => { it.scoped({ isolateRepo: true });