Skip to content

Commit 850f2c8

Browse files
committed
feat: align cli release artifacts with codecane
1 parent 8071c63 commit 850f2c8

File tree

8 files changed

+560
-26
lines changed

8 files changed

+560
-26
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ jobs:
210210
if [[ "${{ runner.os }}" == "Windows" ]]; then
211211
BINARY_FILE="${{ inputs.binary-name }}.exe"
212212
fi
213-
tar -czf codebuff-cli-${{ matrix.target }}.tar.gz -C cli/bin "$BINARY_FILE"
213+
tar -czf codecane-${{ matrix.target }}.tar.gz -C cli/bin "$BINARY_FILE"
214214
215215
- name: Upload binary artifact
216216
uses: actions/upload-artifact@v4
217217
with:
218-
name: codebuff-cli-${{ matrix.target }}
219-
path: codebuff-cli-${{ matrix.target }}.tar.gz
218+
name: codecane-${{ matrix.target }}
219+
path: codecane-${{ matrix.target }}.tar.gz
220220

221221
- name: Open debug shell on failure
222222
if: failure()

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

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414
jobs:
1515
prepare-and-commit-staging:
1616
runs-on: ubuntu-latest
17-
if: contains(github.event.pull_request.title, '[codebuff-cli]')
17+
if: contains(github.event.pull_request.title, '[codecane]')
1818
outputs:
1919
new_version: ${{ steps.bump_version.outputs.new_version }}
2020
steps:
@@ -110,7 +110,7 @@ jobs:
110110
- name: Commit staging release snapshot
111111
run: |
112112
git add -A
113-
git commit -m "Staging CLI Release v${{ steps.bump_version.outputs.new_version }} [codebuff-cli]
113+
git commit -m "Staging CLI Release v${{ steps.bump_version.outputs.new_version }} [codecane]
114114
115115
Captures the staged state for the CLI prerelease, including the version bump.
116116
@@ -132,7 +132,7 @@ jobs:
132132
needs: prepare-and-commit-staging
133133
uses: ./.github/workflows/cli-release-build.yml
134134
with:
135-
binary-name: codebuff-cli
135+
binary-name: codecane
136136
new-version: ${{ needs.prepare-and-commit-staging.outputs.new_version }}
137137
artifact-name: cli-staging-metadata
138138
checkout-ref: ${{ github.event.pull_request.head.sha }}
@@ -191,18 +191,18 @@ jobs:
191191
run: |
192192
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
193193
RELEASE_BODY=$(cat <<'EOF'
194-
## Codebuff CLI v${VERSION} (Staging)
194+
## Codecane v${VERSION} (Staging)
195195
196196
**⚠️ This is a staging build intended for internal testing.**
197197
198198
### Included Binaries
199-
- `codebuff-cli-linux-x64.tar.gz`
200-
- `codebuff-cli-linux-arm64.tar.gz`
201-
- `codebuff-cli-darwin-x64.tar.gz`
202-
- `codebuff-cli-darwin-arm64.tar.gz`
203-
- `codebuff-cli-win32-x64.tar.gz`
199+
- `codecane-linux-x64.tar.gz`
200+
- `codecane-linux-arm64.tar.gz`
201+
- `codecane-darwin-x64.tar.gz`
202+
- `codecane-darwin-arm64.tar.gz`
203+
- `codecane-win32-x64.tar.gz`
204204
205-
After downloading, extract the tarball, add the binary to your PATH, and run `codebuff-cli --help` for usage.
205+
After downloading, extract the tarball, add the binary to your PATH, and run `codecane --help` for usage.
206206
EOF
207207
)
208208
@@ -213,7 +213,7 @@ jobs:
213213
https://api.github.com/repos/CodebuffAI/codebuff/releases \
214214
-d "{
215215
\"tag_name\": \"v${VERSION}\",
216-
\"name\": \"Codebuff CLI v${VERSION} (Staging)\",
216+
\"name\": \"Codecane v${VERSION} (Staging)\",
217217
\"body\": \"${RELEASE_BODY//$'\n'/\\n}\",
218218
\"prerelease\": true,
219219
\"published_at\": \"$CURRENT_TIME\"
@@ -231,7 +231,7 @@ jobs:
231231
exit 1
232232
fi
233233
234-
for file in binaries/*/codebuff-cli-*; do
234+
for file in binaries/*/codecane-*; do
235235
if [ -f "$file" ]; then
236236
FILENAME=$(basename "$file")
237237
echo "Uploading $FILENAME"
@@ -242,3 +242,33 @@ jobs:
242242
"https://uploads.github.com/repos/CodebuffAI/codebuff/releases/$RELEASE_ID/assets?name=$FILENAME"
243243
fi
244244
done
245+
246+
publish-staging-npm:
247+
needs: [prepare-and-commit-staging, build-staging-binaries, create-staging-release]
248+
runs-on: ubuntu-latest
249+
permissions:
250+
contents: read
251+
id-token: write
252+
steps:
253+
- uses: actions/checkout@v4
254+
with:
255+
ref: ${{ github.event.pull_request.head.sha }}
256+
257+
- name: Download CLI staging package
258+
uses: actions/download-artifact@v4
259+
with:
260+
name: cli-staging-metadata
261+
path: cli/release-staging/
262+
263+
- name: Set up Node.js for npm publishing
264+
uses: actions/setup-node@v4
265+
with:
266+
node-version: 20
267+
registry-url: https://registry.npmjs.org/
268+
269+
- name: Publish codecane staging package to npm
270+
run: |
271+
cd cli/release-staging
272+
npm publish --access public
273+
env:
274+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"prebuild": "bun run build:sdk",
2020
"build": "bun build src/index.tsx --outdir dist --target node --format esm",
2121
"build:sdk": "cd ../sdk && bun run build",
22-
"build:binary": "bun ./scripts/build-binary.ts codebuff-cli $npm_package_version",
22+
"build:binary": "bun ./scripts/build-binary.ts codecane $npm_package_version",
2323
"start": "bun run dist/index.js",
2424
"pretypecheck": "bun run build:sdk",
2525
"typecheck": "tsc --noEmit -p ."

cli/release-staging/README.md

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
1-
# Codebuff CLI Staging
1+
# 🚀 Codecane - The most powerful coding agent (STAGING)
22

3-
The staging workflow updates these files with the exact version being packaged. They are shipped as workflow artifacts so downstream jobs build and publish binaries from the same commit snapshot.
3+
**⚠️ This is a staging/beta release for testing purposes.**
4+
5+
Codecane is a CLI tool that writes code for you.
6+
7+
1. Run `codecane` from your project directory
8+
2. Tell it what to do
9+
3. It will read and write to files and run commands to produce the code you want
10+
11+
Note: Codecane will run commands in your terminal as it deems necessary to fulfill your request.
12+
13+
## Installation
14+
15+
To install Codecane (staging), run:
16+
17+
```bash
18+
npm install -g codecane@beta
19+
```
20+
21+
(Use `sudo` if you get a permission error.)
22+
23+
## Usage
24+
25+
After installation, you can start Codecane by running:
26+
27+
```bash
28+
codecane [project-directory]
29+
```
30+
31+
If no project directory is specified, Codecane will use the current directory.
32+
33+
Once running, simply chat with Codecane to say what coding task you want done.
34+
35+
## Features
36+
37+
- Understands your whole codebase
38+
- Creates and edits multiple files based on your request
39+
- Can run your tests or type checker or linter; can install packages
40+
- It's powerful: ask Codecane to keep working until it reaches a condition and it will.
41+
42+
Our users regularly use Codecane to implement new features, write unit tests, refactor code, write scripts, or give advice.
43+
44+
## Knowledge Files
45+
46+
To unlock the full benefits of modern LLMs, we recommend storing knowledge alongside your code. Add a `knowledge.md` file anywhere in your project to provide helpful context, guidance, and tips for the LLM as it performs tasks for you.
47+
48+
Codecane can fluently read and write files, so it will add knowledge as it goes. You don't need to write knowledge manually!
49+
50+
Some have said every change should be paired with a unit test. In 2024, every change should come with a knowledge update!
51+
52+
## Tips
53+
54+
1. Type '/help' or just '/' to see available commands.
55+
2. Create a `knowledge.md` file and collect specific points of advice. The assistant will use this knowledge to improve its responses.
56+
3. Type `undo` or `redo` to revert or reapply file changes from the conversation.
57+
4. Press `Esc` or `Ctrl+C` while Codecane is generating a response to stop it.
58+
59+
## Troubleshooting
60+
61+
If you are getting permission errors during installation, try using sudo:
62+
63+
```
64+
sudo npm install -g codecane@beta
65+
```
66+
67+
If you still have errors, it's a good idea to [reinstall Node](https://nodejs.org/en/download).
68+
69+
## Feedback
70+
71+
We value your input! Please email your feedback to `[email protected]`. Thank you for using Codecane!

0 commit comments

Comments
 (0)