Skip to content

Commit 8bbe613

Browse files
committed
add more onboarding steps to CONTRIBUTING.md
1 parent e016fa4 commit 8bbe613

File tree

2 files changed

+60
-2
lines changed

2 files changed

+60
-2
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ DISCORD_APPLICATION_ID=dummy_discord_app_id
3737
# Frontend/Public Variables
3838
NEXT_PUBLIC_CB_ENVIRONMENT=dev
3939
NEXT_PUBLIC_CODEBUFF_APP_URL=http://localhost:3000
40-
NEXT_PUBLIC_CODEBUFF_BACKEND_URL=http://localhost:4242
40+
NEXT_PUBLIC_CODEBUFF_BACKEND_URL=localhost:4242
4141
NEXT_PUBLIC_SUPPORT_EMAIL=support@codebuff.com
4242
NEXT_PUBLIC_POSTHOG_API_KEY=phc_dummy_posthog_key
43-
NEXT_PUBLIC_POSTHOG_HOST_URL=https://app.posthog.com
43+
NEXT_PUBLIC_POSTHOG_HOST_URL=https://us.i.posthog.com
4444
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_dummy_publishable
4545
NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL=https://billing.stripe.com/p/login/test_dummy

CONTRIBUTING.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Before you begin, you'll need to install a few tools:
4848
Follow the [Infisical Setup Guide](./INFISICAL_SETUP_GUIDE.md) for detailed setup instructions.
4949

5050
Load all environment variables at once:
51+
5152
```bash
5253
infisical secrets set --file .env.example
5354
infisical secrets set DATABASE_URL=postgresql://manicode_user_local:secretpassword_local@localhost:5432/manicode_db_local
@@ -81,8 +82,65 @@ Before you begin, you'll need to install a few tools:
8182
# Expected: Welcome to Codebuff! + agent list
8283
```
8384

85+
Now, you should be able to run the CLI and send commands, but it will error out because you don't have any credits.
86+
8487
**Note**: CLI requires both backend and web server running for authentication.
8588

89+
8. **Giving yourself credits**:
90+
91+
There are two ways to give yourself credits:
92+
93+
1. If you have the Stripe environment variables set, you can add billing information (just put in a fake credit card) at http://localhost:3000/usage
94+
95+
2. However, if you don't have Stripe set up, you will need to manually add credits to your account in the database.
96+
97+
```bash
98+
bun run start-studio
99+
```
100+
101+
Then, navigate to https://local.drizzle.studio/
102+
103+
Create a new row in the `credit_ledger` table. The values should be:
104+
105+
- `operation_id`: [anything you want should be unique]
106+
- `user_id`: [your user ID from the `user` table]
107+
- `principal`: [some very large number, one hundred million should last basically indefinitely]
108+
- `balance`: [the same as `principal`]
109+
- `type`: admin
110+
- `priority`: 80
111+
112+
Now, you should be able to run the CLI commands locally from within the `codebuff` directory.
113+
114+
9. **Running in other directories**:
115+
116+
a. In order to run the CLI from other directories, you need to first publish the agents to the database.
117+
118+
First, create a publisher profile at http://localhost:3000/publishers. Make sure the `publisher_id` is `codebuff`.
119+
120+
Run:
121+
122+
```bash
123+
bun run start-bin publish base
124+
```
125+
126+
It will give you an error along the lines of `Invalid agent ID: [some agent ID]`, e.g. `Invalid agent ID: context-pruner`. You need to publish that agent at the same time, e.g.:
127+
128+
```bash
129+
bun run start-bin publish base context-pruner
130+
```
131+
132+
Repeat this until there are no more errors. As of the time of writing, the command required is:
133+
134+
```bash
135+
bun start-bin publish base context-pruner file-explorer file-picker researcher thinker reviewer
136+
```
137+
138+
b. Now, you can start the CLI in any directory by running:
139+
140+
```bash
141+
bun run start-bin --cwd [some/other/directory]
142+
```
143+
86144
## Understanding the Codebase
87145

88146
Codebuff is organized as a monorepo with these main packages:

0 commit comments

Comments
 (0)