Skip to content

Commit dc4f5b3

Browse files
committed
Configure a version of cli for freebuff. Compiles as new binary
1 parent fe91a99 commit dc4f5b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+980
-131
lines changed

.github/workflows/cli-release-staging.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,5 +231,3 @@ jobs:
231231
run: |
232232
cd cli/release-staging
233233
npm publish --access public
234-
env:
235-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/freebuff-release.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: FreeBuff Release
1+
name: Freebuff Release
22

33
on:
44
workflow_dispatch:
@@ -43,7 +43,7 @@ jobs:
4343
npm version ${{ inputs.version_type }} --no-git-tag-version
4444
NEW_VERSION=$(bun -e "console.log(require('./package.json').version)")
4545
46-
echo "New FreeBuff version: $NEW_VERSION"
46+
echo "New Freebuff version: $NEW_VERSION"
4747
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
4848
4949
- name: Configure git
@@ -57,7 +57,7 @@ jobs:
5757
git pull --rebase origin main
5858
git stash pop
5959
git add freebuff/cli/release/package.json
60-
git commit -m "Bump FreeBuff version to ${{ steps.bump_version.outputs.new_version }}"
60+
git commit -m "Bump Freebuff version to ${{ steps.bump_version.outputs.new_version }}"
6161
git push
6262
6363
- name: Create and push tag
@@ -103,10 +103,10 @@ jobs:
103103
uses: softprops/action-gh-release@v1
104104
with:
105105
tag_name: freebuff-v${{ needs.prepare-and-commit.outputs.new_version }}
106-
name: FreeBuff v${{ needs.prepare-and-commit.outputs.new_version }}
106+
name: Freebuff v${{ needs.prepare-and-commit.outputs.new_version }}
107107
prerelease: false
108108
body: |
109-
## FreeBuff v${{ needs.prepare-and-commit.outputs.new_version }}
109+
## Freebuff v${{ needs.prepare-and-commit.outputs.new_version }}
110110
111111
Free AI coding assistant — binary releases for all supported platforms.
112112
@@ -150,6 +150,4 @@ jobs:
150150
- name: Publish to npm
151151
run: |
152152
cd freebuff/cli/release
153-
npm publish --access public
154-
env:
155-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
153+
npm publish --access public --provenance

.github/workflows/npm-app-release-legacy.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,3 @@ jobs:
152152
run: |
153153
cd npm-app/release-legacy
154154
npm publish --access public --tag legacy
155-
env:
156-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/npm-app-release-prod.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,3 @@ jobs:
152152
run: |
153153
cd npm-app/release
154154
npm publish --access public
155-
env:
156-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

cli/scripts/build-binary.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ async function main() {
161161
'process.env.CODEBUFF_CLI_TARGET',
162162
`"${targetInfo.platform}-${targetInfo.arch}"`,
163163
],
164+
['process.env.FREEBUFF_MODE', `"${process.env.FREEBUFF_MODE ?? 'false'}"`],
164165
...nextPublicEnvVars,
165166
]
166167

cli/src/app.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { getProjectRoot } from './project-files'
1818
import { useChatHistoryStore } from './state/chat-history-store'
1919
import { useChatStore } from './state/chat-store'
2020
import type { TopBannerType } from './types/store'
21+
import { IS_FREEBUFF } from './utils/constants'
2122
import { findGitRoot } from './utils/git'
2223
import { openFileAtPath } from './utils/open-file'
2324
import { formatCwd } from './utils/path-helpers'
@@ -222,7 +223,7 @@ export const App = ({
222223
<text
223224
style={{ wrapMode: 'word', marginBottom: 1, fg: theme.foreground }}
224225
>
225-
Codebuff will run commands on your behalf to help you build.
226+
{IS_FREEBUFF ? 'Freebuff' : 'Codebuff'} will run commands on your behalf to help you build.
226227
</text>
227228
<text
228229
style={{ wrapMode: 'word', marginBottom: 1, fg: theme.foreground }}

cli/src/chat.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import { trackEvent } from './utils/analytics'
5959
import { getClaudeOAuthStatus } from './utils/claude-oauth'
6060
import { showClipboardMessage } from './utils/clipboard'
6161
import { readClipboardImage } from './utils/clipboard-image'
62+
import { IS_FREEBUFF } from './utils/constants'
6263
import { getInputModeConfig } from './utils/input-modes'
6364

6465
import {
@@ -170,7 +171,7 @@ export const Chat = ({
170171
})
171172
const hasSubscription = subscriptionData?.hasSubscription ?? false
172173

173-
const { ad } = useGravityAd({ enabled: !hasSubscription })
174+
const { ad } = useGravityAd({ enabled: IS_FREEBUFF || !hasSubscription })
174175
const [adsManuallyDisabled, setAdsManuallyDisabled] = useState(false)
175176

176177
const handleDisableAds = useCallback(() => {
@@ -1447,11 +1448,11 @@ export const Chat = ({
14471448
/>
14481449
)}
14491450

1450-
{ad && !adsManuallyDisabled && getAdsEnabled() && (
1451+
{ad && (IS_FREEBUFF || (!adsManuallyDisabled && getAdsEnabled())) && (
14511452
<AdBanner
14521453
ad={ad}
14531454
onDisableAds={handleDisableAds}
1454-
isFreeMode={agentMode === 'FREE'}
1455+
isFreeMode={IS_FREEBUFF || agentMode === 'FREE'}
14551456
/>
14561457
)}
14571458

cli/src/commands/ads.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useChatStore } from '../state/chat-store'
2+
import { IS_FREEBUFF } from '../utils/constants'
23
import { logger } from '../utils/logger'
34
import { getSystemMessage } from '../utils/message-history'
45
import { saveSettings, loadSettings } from '../utils/settings'
@@ -35,6 +36,8 @@ export const handleAdsDisable = (): {
3536
}
3637

3738
export const getAdsEnabled = (): boolean => {
39+
if (IS_FREEBUFF) return true
40+
3841
// If no mode provided, get it from the store
3942
const mode = useChatStore.getState().agentMode
4043

cli/src/commands/command-registry.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { WEBSITE_URL } from '../login/constants'
1414
import { useChatStore } from '../state/chat-store'
1515
import { useFeedbackStore } from '../state/feedback-store'
1616
import { useLoginStore } from '../state/login-store'
17-
import { AGENT_MODES } from '../utils/constants'
17+
import { AGENT_MODES, IS_FREEBUFF } from '../utils/constants'
1818
import { getSystemMessage, getUserMessage } from '../utils/message-history'
1919
import { capturePendingAttachments } from '../utils/pending-attachments'
2020
import { getSkillByName } from '../utils/skill-registry'
@@ -163,7 +163,20 @@ const clearInput = (params: RouterParams) => {
163163
params.setInputValue({ text: '', cursorPosition: 0, lastEditDueToNav: false })
164164
}
165165

166-
export const COMMAND_REGISTRY: CommandDefinition[] = [
166+
const FREEBUFF_REMOVED_COMMANDS = new Set([
167+
'ads:enable',
168+
'ads:disable',
169+
'refer-friends',
170+
'usage',
171+
'subscribe',
172+
'image',
173+
'publish',
174+
'gpt-5-agent',
175+
'connect:claude',
176+
'review',
177+
])
178+
179+
const ALL_COMMANDS: CommandDefinition[] = [
167180
defineCommand({
168181
name: 'ads:enable',
169182
handler: (params) => {
@@ -411,8 +424,8 @@ export const COMMAND_REGISTRY: CommandDefinition[] = [
411424
clearInput(params)
412425
},
413426
}),
414-
// Mode commands generated from AGENT_MODES
415-
...AGENT_MODES.map((mode) =>
427+
// Mode commands generated from AGENT_MODES (excluded in Freebuff)
428+
...(IS_FREEBUFF ? [] : AGENT_MODES).map((mode) =>
416429
defineCommandWithArgs({
417430
name: `mode:${mode.toLowerCase()}`,
418431
handler: (params, args) => {
@@ -542,6 +555,10 @@ export const COMMAND_REGISTRY: CommandDefinition[] = [
542555
}),
543556
]
544557

558+
export const COMMAND_REGISTRY: CommandDefinition[] = IS_FREEBUFF
559+
? ALL_COMMANDS.filter((cmd) => !FREEBUFF_REMOVED_COMMANDS.has(cmd.name))
560+
: ALL_COMMANDS
561+
545562
export function findCommand(cmd: string): CommandDefinition | undefined {
546563
const lowerCmd = cmd.toLowerCase()
547564

cli/src/commands/init.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ import toolsSource from '../../../common/src/templates/initial-agents-dir/types/
1212
import utilTypesSource from '../../../common/src/templates/initial-agents-dir/types/util-types' with { type: 'text' }
1313
import { getProjectRoot } from '../project-files'
1414
import { trackEvent } from '../utils/analytics'
15+
import { IS_FREEBUFF } from '../utils/constants'
1516
import { getSystemMessage } from '../utils/message-history'
1617

1718
import type { PostUserMessageFn } from '../types/contracts/send-message'
1819

20+
const brandName = IS_FREEBUFF ? 'Freebuff' : 'Codebuff'
21+
1922
const INITIAL_KNOWLEDGE_FILE = `# Project knowledge
2023
21-
This file gives Codebuff context about your project: goals, commands, conventions, and gotchas.
24+
This file gives ${brandName} context about your project: goals, commands, conventions, and gotchas.
2225
2326
## Quickstart
2427
- Setup:

0 commit comments

Comments
 (0)