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
112 changes: 112 additions & 0 deletions agent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,118 @@ def roadmap():
click.echo("\n🗺️ Team roadmap:\n")
click.echo(content)

# Command: add item to roadmap
@cli.command()
@click.argument("section")
@click.argument("item")
def roadmap_add(section, item):
"""Add an item to the roadmap. Sections: inprogress, todo, backlog"""
roadmap_path = os.path.join(BASE_DIR, "knowledge_base", "roadmap", "roadmap.md")

section_map = {
"inprogress": "### 🟢 In Progress",
"todo": "### 🟡 To Do",
"backlog": "### 🔴 Backlog"
}

if section not in section_map:
click.echo(f"\n❌ Invalid section. Use: inprogress, todo, backlog\n")
return

with open(roadmap_path, "r") as f:
content = f.read()

section_header = section_map[section]
content = content.replace(section_header, f"{section_header}\n- {item}")

with open(roadmap_path, "w") as f:
f.write(content)

click.echo(f"\n✅ Item added to '{section}': {item}\n")

# Command: move item in roadmap
@cli.command()
@click.argument("item")
@click.argument("to_section")
def roadmap_move(item, to_section):
"""Move an item to another section. Sections: inprogress, todo, backlog"""
roadmap_path = os.path.join(BASE_DIR, "knowledge_base", "roadmap", "roadmap.md")

section_map = {
"inprogress": "### 🟢 In Progress",
"todo": "### 🟡 To Do",
"backlog": "### 🔴 Backlog"
}

if to_section not in section_map:
click.echo(f"\n❌ Invalid section. Use: inprogress, todo, backlog\n")
return

with open(roadmap_path, "r") as f:
content = f.read()

if f"- {item}" not in content:
click.echo(f"\n❌ Item '{item}' not found in roadmap.\n")
return

content = content.replace(f"- {item}\n", "")
section_header = section_map[to_section]
content = content.replace(section_header, f"{section_header}\n- {item}")

with open(roadmap_path, "w") as f:
f.write(content)

click.echo(f"\n✅ Item moved to '{to_section}': {item}\n")

# Command: mark roadmap item as completed
@cli.command()
@click.argument("item")
def roadmap_complete(item):
"""Mark a roadmap item as completed."""
roadmap_path = os.path.join(BASE_DIR, "knowledge_base", "roadmap", "roadmap.md")

with open(roadmap_path, "r") as f:
content = f.read()

if f"- {item}" not in content:
click.echo(f"\n❌ Item '{item}' not found in roadmap.\n")
return

content = content.replace(f"- {item}\n", "")
content = content.replace("### ✅ Completed", f"### ✅ Completed\n- {item}")

with open(roadmap_path, "w") as f:
f.write(content)

click.echo(f"\n✅ Item marked as completed: {item}\n")

# Command: remove roadmap item
@cli.command()
@click.argument("item")
def roadmap_remove(item):
"""Remove an item from the roadmap."""
roadmap_path = os.path.join(BASE_DIR, "knowledge_base", "roadmap", "roadmap.md")

with open(roadmap_path, "r") as f:
content = f.read()

if f"- {item}" not in content:
click.echo(f"\n❌ Item '{item}' not found in roadmap.\n")
return

confirm = click.confirm(f" Are you sure you want to remove '{item}'?", default=False)

if not confirm:
click.echo(f"\n❌ Removal cancelled.\n")
return

content = content.replace(f"- {item}\n", "")

with open(roadmap_path, "w") as f:
f.write(content)

click.echo(f"\n✅ Item removed from roadmap: {item}\n")

# Command: show the project history
@cli.command()
def history():
Expand Down
75 changes: 73 additions & 2 deletions agent/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,79 @@ def pull_requests_menu():

elif choice == "⬅️ Back":
break
def roadmap_menu():
"""Submenu for Roadmap management."""
while True:
print("\n🗺️ Roadmap\n")

choice = questionary.select(
"What would you like to do?",
choices=[
"👁️ View Roadmap",
"➕ Add Item",
"🔄 Move Item",
"✅ Mark as Completed",
"🗑️ Remove Item",
"⬅️ Back"
]
).ask()

if choice == "👁️ View Roadmap":
run_command(["roadmap"])
wait_for_menu()

elif choice == "➕ Add Item":
section = questionary.select(
"Select section:",
choices=[
"🟢 In Progress",
"🟡 To Do",
"🔴 Backlog"
]
).ask()

section_map = {
"🟢 In Progress": "inprogress",
"🟡 To Do": "todo",
"🔴 Backlog": "backlog"
}

item = questionary.text("Item description:").ask()
run_command(["roadmap-add", section_map[section], item])
wait_for_menu()

elif choice == "🔄 Move Item":
item = questionary.text("Item to move (exact text):").ask()
section = questionary.select(
"Move to section:",
choices=[
"🟢 In Progress",
"🟡 To Do",
"🔴 Backlog"
]
).ask()

section_map = {
"🟢 In Progress": "inprogress",
"🟡 To Do": "todo",
"🔴 Backlog": "backlog"
}

run_command(["roadmap-move", item, section_map[section]])
wait_for_menu()

elif choice == "✅ Mark as Completed":
item = questionary.text("Item to mark as completed (exact text):").ask()
run_command(["roadmap-complete", item])
wait_for_menu()

elif "Remove Item" in choice:
item = questionary.text("Item to remove (exact text):").ask()
run_command(["roadmap-remove", item])
wait_for_menu()

elif choice == "⬅️ Back":
break

def main():
while True:
Expand All @@ -318,8 +390,7 @@ def main():
test_cases_menu()

elif choice == "🗺️ Roadmap":
run_command(["roadmap"])
wait_for_menu()
roadmap_menu()

elif choice == "📜 History":
history_menu()
Expand Down
2 changes: 2 additions & 0 deletions knowledge_base/roadmap/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The team is in the learning phase of test automation.
- Integrate the agent with test reports
- AI integration for importing external documents

### ✅ Completed

## Notes
- Update this file whenever a step is completed
- Responsible for updates: Diogo