Create a CLI for using potpie locally
Create Development CLI for Local PotPie Usage
Objective
Create a command-line interface for local development interactions with PotPie.
Commands
0. init
potpie start
and
potpie stop
commands to turn on and off the server.
1. parse
potpie parse <repo-path> [--branch <branch-name>]
- Submit repository for parsing
- Poll status until complete
- Display progress/status
- Block until ready
2. chat
potpie chat <project-id> --agent <agent-name> [--branch <branch-name>]
- Validate project readiness
- Initialize conversation with specified agent
- Interactive console for messages
- Display responses
Requirements
- Input validation for repo paths and branches
- Status feedback during parsing
- Error handling for invalid inputs
- Clean console output formatting
- Session management for chat
Success Criteria
- [ ] Successfully parses repositories
- [ ] Shows parse status clearly
- [ ] Validates project status
- [ ] Handles errors gracefully
/bounty 10
💎 $10 bounty • potpie.ai
Steps to solve:
- Start working: Comment
/attempt #224with your implementation plan - Submit work: Create a pull request including
/claim #224in the PR body to claim the bounty - Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts
Thank you for contributing to potpie-ai/potpie!
Add a bounty • Share on socials
| Attempt | Started (GMT+0) | Solution |
|---|---|---|
| 🟢 @aayushdhiman01 | Jan 10, 2025, 12:37:54 PM | WIP |
| 🟢 @DeepeshKalura | Jan 20, 2025, 4:47:15 PM | WIP |
| 🟢 @riturajFi | Feb 11, 2025, 4:39:14 PM | WIP |
/attempt #224
Hey I am solving this issue but I will project structure refactoring, @dhirenmathur will go to need your help to improve
Options
@DeepeshKalura go for it! Please share a plan before implementing! Thank you for your contribution!
@dhirenmathur Yeah, I was going to tell you that.
So, Currently, I see that we manage the server startup with ./start.sh.
Let's start the I will use click to create CLI as it pre-install the package with fastAPI. And super easy to use. ( If you want i don't mind using a more traditional argparse to build CLI.
So, If I see this PR and just focus that thing in mind then. I will add the click code on the server code. For example, would be.
in app > main.py.
def start_server():
uvicorn.run(app, host="0.0.0.0", port=8034,)
def stop_server():
pass
@click.group()
def cli():
pass
@cli.command()
def start():
start_server()
@cli.command()
def stop():
stop_server()
if __name__ == "__main__":
cli()
Just add these lines on the end. Yes all of these will work, Similarly then I will create singletion instance of cli and pass where I need from the serve code as the reference and make a wrapper similar code with cli. I think it work for small projects. ( Yeah I know it destroys the separate of concern case here )
but it will work.
Key points will 1. Single Instance of CLI and use the server ( fastapi ) wrapper around the CLI if needed.
I think you will avoid such code. I will also avoid it.
So, I was thinking to create a separate CLI logic that will be the same but it will separate instance.
More like one file or folder.
Maybe I am in right directions of thinking.
Would like to give it a try as I have worked on CLI's before...
/attempt https://github.com/potpie-ai/potpie/issues/224
Hey @Savio629 I think @DeepeshKalura is already working on this issue. You are welcome to give it a try parallelly if you want, but the bounty will be awarded to the solution that will best suit the requirements in the end.
Hey @DeepeshKalura . Using click is good. Please DM me on discord if you're still working on this, I would like to understand your proposal better.
@dhirenmathur yes I am working on this can, Ok joining discord
@dhirenmathur I read the requirement "Poll status until complete" I don't think it good idea ( because we cannot tell how much time it will take as API is not telling it. I will have a better idea. I just dm you.
@riturajFi bro you are super late for this. I think Fulfil the requirements currently writing tests. So, I think you waste time on this issue. Just a warning bro!