You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+58Lines changed: 58 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ Before you begin, you'll need to install a few tools:
48
48
Follow the [Infisical Setup Guide](./INFISICAL_SETUP_GUIDE.md) for detailed setup instructions.
49
49
50
50
Load all environment variables at once:
51
+
51
52
```bash
52
53
infisical secrets set --file .env.example
53
54
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:
81
82
# Expected: Welcome to Codebuff! + agent list
82
83
```
83
84
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
+
84
87
**Note**: CLI requires both backend and web server running for authentication.
85
88
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
+
86
144
## Understanding the Codebase
87
145
88
146
Codebuff is organized as a monorepo with these main packages:
0 commit comments