srcbookdev / srcbook

TypeScript-centric app development platform
https://srcbook.com
Apache License 2.0
2.58k stars 101 forks source link

Add a cli flag to configure base directory of srcbooks #429

Open ShikherVerma opened 3 weeks ago

ShikherVerma commented 3 weeks ago

Fixes https://github.com/srcbookdev/srcbook/issues/187

Changes

Building on the work in https://github.com/srcbookdev/srcbook/pull/180 I've added another flag to be able to configure the base directory.

Usecase

I want to create a github repo of srcbook files. Each file is a different prompt engineering experiment. I need different members of the team to pull the latest experiments and share their work.

Possible enhancements

nichochar commented 3 weeks ago

Hey @ShikherVerma thanks for the contribution. I'm looking at this but it's going to take a bit of time to QA and make sure things work as expected, since we make some assumptions about directories in different places.

I'm checking out your changes and looking at them on a local build before I approve this or come back with more comment.

Did you test this? If yes, what testing did you do?

ShikherVerma commented 3 weeks ago

since we make some assumptions about directories in different places.

The codebase does include hardcoded references to .srcbooks

Did you test this? If yes, what testing did you do?

This commits ads a -b flag to change the base directory. I'm now using srcbook like this:

pnpm run start -- -b "/Users/shikher/projects/spt/prompts"

prompts folder is git tracked and shared with my team. Earlier all files were stored in home directory which is fine for personal use but not good for collaboration on these files. With this change the .srcbooks folder is created in the prompts dir, not in home.