OpenCoze
Back to template library

Automate Code Generation with GitHub Copilot CLI: Interactiv

DevelopmentCozeUpdated 2026-05-01

Use GitHub Copilot CLI to automatically generate or fix code in a repository, choosing between interactive or non-interactive modes to fit different workflow needs.

System Prompt
Run {copilot_mode} mode on {repo_path} with prompt: {prompt}

Variable Dictionary (fill in your AI tool)

This section only explains placeholders. It is not an input form on this website. Copy the prompt, then replace variables in Coze / Dify / ChatGPT.

{repo_path}

Local repository path

Filling hint: replace this with your real business context.

{branch_name}

Branch to switch to

Filling hint: replace this with your real business context.

{copilot_mode}

Copilot CLI mode, either interactive or non-interactive

Filling hint: replace this with your real business context.

{prompt}

Prompt to pass to Copilot for code generation or fix

Filling hint: replace this with your real business context.

Quick Variable Filler (Optional)

Fill variables below to generate a ready-to-run prompt in your browser.

{repo_path}

Local repository path

{branch_name}

Branch to switch to

{copilot_mode}

Copilot CLI mode, either interactive or non-interactive

{prompt}

Prompt to pass to Copilot for code generation or fix

Generated Prompt Preview

Missing: 4
Run {copilot_mode} mode on {repo_path} with prompt: {prompt}

How to Use This Template

Best for

Teams that need faster development output with more stable prompt quality.

Problem it solves

Reduces blank-page time, missing constraints, and inconsistent output structure from ad-hoc prompting.

Steps

  1. Copy the template prompt.
  2. Paste it into your AI tool (Coze / Dify / ChatGPT).
  3. Replace placeholder variables using the dictionary above.
  4. Run and refine constraints based on output quality.

Not ideal when

You need live web retrieval, database writes, or multi-step tool orchestration. Use full workflow automation for that.

Success Case

Input:
repo_path: /home/user/project, branch_name: feature/new-api, copilot_mode: non-interactive, prompt: "Add unit tests for the new API endpoint."
Output:
Generated test files added to the project and successfully pushed to the remote repository.

Boundary Case

Input:
repo_path: /home/user/project, branch_name: feature/new-api, copilot_mode: interactive, prompt: ""
Fix:
Ensure the prompt is not empty and check network connectivity.

What to Try Next

Keep exploring with similar templates and matching tools.

Continue Where You Left Off

No recent items yet.

Workflow Steps

  1. 1. Ensure GitHub Copilot CLI is installed and logged in with a valid GitHub token.

  2. 2. Navigate to the target repository: cd {repo_path}.

  3. 3. Switch to the specified branch: git checkout {branch_name}.

  4. 4. Run Copilot CLI: copilot {copilot_mode} --prompt "{prompt}".

  5. 5. Review the generated code or fix, adjust manually if needed.

  6. 6. Commit and push changes: git add . && git commit -m "Copilot {copilot_mode} changes" && git push.

Constraints

  • Repository must be a valid Git repo
  • GitHub Copilot CLI installed and token configured
  • Network connectivity available

Explore More in This Category

Development

Recommended Stack

Tools that work well with this template.

Coze

Official site

Low-code agent workflow platform for fast automation delivery.

Open

OpenAI

Official site

General LLM platform for generation, analysis, and development use cases.

Open