Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a CLI for using potpie locally #224

Open
4 tasks
dhirenmathur opened this issue Jan 9, 2025 · 11 comments
Open
4 tasks

Create a CLI for using potpie locally #224

dhirenmathur opened this issue Jan 9, 2025 · 11 comments

Comments

@dhirenmathur
Copy link
Contributor

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 <repo-url> --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
@dhirenmathur
Copy link
Contributor Author

dhirenmathur commented Jan 9, 2025

/bounty 10

Copy link

algora-pbc bot commented Jan 9, 2025

💎 $10 bounty • potpie.ai

Steps to solve:

  1. Start working: Comment /attempt #224 with your implementation plan
  2. Submit work: Create a pull request including /claim #224 in the PR body to claim the bounty
  3. 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 bountyShare 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

@aayushdhiman01
Copy link

aayushdhiman01 commented Jan 10, 2025

/attempt #224

@DeepeshKalura
Copy link

DeepeshKalura commented Jan 20, 2025

/attempt #224

Hey I am solving this issue but I will project structure refactoring, @dhirenmathur will go to need your help to improve

@dhirenmathur
Copy link
Contributor Author

dhirenmathur commented Jan 20, 2025

@DeepeshKalura go for it! Please share a plan before implementing! Thank you for your contribution!

@DeepeshKalura
Copy link

DeepeshKalura commented Jan 20, 2025

@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.

@Savio629
Copy link

Would like to give it a try as I have worked on CLI's before...

@Savio629
Copy link

/attempt #224

@dhirenmathur
Copy link
Contributor Author

dhirenmathur commented Jan 23, 2025

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.

@dhirenmathur
Copy link
Contributor Author

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.

@DeepeshKalura
Copy link

@dhirenmathur yes I am working on this can, Ok joining discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants