Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/commands/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/commands/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions test/pull.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
6 changes: 6 additions & 0 deletions test/push.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

Expand Down
Loading