diff --git a/lib/llm/index.js b/lib/llm/index.js index f938f6b..fec8d0c 100644 --- a/lib/llm/index.js +++ b/lib/llm/index.js @@ -588,7 +588,7 @@ The \`--body\` flag replaces the whole page content; pass \`--append\` to add to n8nctl: { filename: 'cli-n8nctl.md', name: 'n8nctl', - purpose: 'n8n workflow management, execution, and variables', + purpose: 'n8n workflow management, execution, variables, and source control', content: `## n8n Workflow CLI (n8nctl) CLI for managing n8n workflows - pull/push for version control, execute workflows, and manage multiple instances. @@ -672,10 +672,28 @@ n8nctl execution retry # Retry failed execution n8nctl execution delete # Delete execution \`\`\` +### Source control (instance Git connection) + +\`\`\`bash +n8nctl source-control status # Pending changes a push would commit (IDs for push) +n8nctl source-control status --direction pull # Changes a pull would import +n8nctl source-control push -m "msg" --workflow # Commit + push named workflows (repeatable) +n8nctl source-control push -m "msg" --item credential: # Other types: workflow, tags, variables, file, folders, project, datatable +n8nctl source-control push -m "msg" --workflow --force # Push despite conflicts +n8nctl source-control pull # Import the connected branch (overwrites drafts) +n8nctl source-control pull --auto-publish published # none (default) | all | published +n8nctl source-control pull --force # Discard conflicting local changes +\`\`\` + +- Push commits to the branch other connected instances pull from; name only the items you changed. +- A pull on a production instance is a production deploy: show the command and wait for confirmation. +- A 409 lists the conflicting items; check them before rerunning with \`--force\`. +- 403 means the API key lacks \`sourceControl:read\` / \`sourceControl:push\` / \`sourceControl:pull\`, or source control is not connected. + ### Tips - Use \`--json\` flag on any command for JSON output (useful for scripting) -- Aliases: \`workflow\` → \`wf\`, \`execution\` → \`exec\`, \`variable\` → \`var\` +- Aliases: \`workflow\` → \`wf\`, \`execution\` → \`exec\`, \`variable\` → \`var\`, \`source-control\` → \`sc\` - Recursive pull creates \`manifest.json\` tracking workflow dependencies - Push with manifest handles sub-workflow ID remapping automatically `,