mirror of
https://github.com/cline/cline.git
synced 2026-09-11 16:42:40 +08:00
Compare commits
46
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71da25835a | ||
|
|
8f79c7a714 | ||
|
|
db4bd8b24c | ||
|
|
1d8b99f900 | ||
|
|
b6e6d7afad | ||
|
|
a616b4c5f8 | ||
|
|
16774c7cd2 | ||
|
|
d5a577389d | ||
|
|
bba90e9af4 | ||
|
|
d566a79929 | ||
|
|
2484d24f97 | ||
|
|
7dfe88072e | ||
|
|
83a2824103 | ||
|
|
5198db81f7 | ||
|
|
576d126208 | ||
|
|
c878c663eb | ||
|
|
562b636481 | ||
|
|
82faedead3 | ||
|
|
770f3e0807 | ||
|
|
79c6381893 | ||
|
|
c9d051cc0b | ||
|
|
a5d6bcecea | ||
|
|
289ddd6922 | ||
|
|
65d93eedab | ||
|
|
2928f68fd0 | ||
|
|
c1e07f26a9 | ||
|
|
17018066a7 | ||
|
|
54fc8e2a7e | ||
|
|
af35bd28b2 | ||
|
|
bce75f9821 | ||
|
|
e272a8dfbb | ||
|
|
c516230809 | ||
|
|
50021c8c5a | ||
|
|
b953c3682a | ||
|
|
f3f5bdd902 | ||
|
|
1d91dbc894 | ||
|
|
401abd9434 | ||
|
|
79e99eb526 | ||
|
|
f1d2569931 | ||
|
|
efbacbbf33 | ||
|
|
69e6ab9069 | ||
|
|
cfc5abca02 | ||
|
|
4da5614863 | ||
|
|
cef0da35e2 | ||
|
|
62fa67d833 | ||
|
|
4a57450c07 |
@@ -0,0 +1,83 @@
|
||||
name: CLI TUI Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
cli-tui-tests:
|
||||
name: CLI TUI Tests
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build CLI
|
||||
run: npm run cli:build
|
||||
|
||||
- name: Run TUI Tests
|
||||
id: tui_tests
|
||||
run: |
|
||||
npm run test:e2e:cli:tui 2>&1 | tee tui-test-output.log
|
||||
exit_code=${PIPESTATUS[0]}
|
||||
echo "tui_exit_code=$exit_code" >> $GITHUB_OUTPUT
|
||||
exit $exit_code
|
||||
|
||||
- name: Write failure summary
|
||||
if: always() && steps.tui_tests.outcome != 'success' && steps.tui_tests.outcome != 'skipped'
|
||||
run: |
|
||||
echo "## ❌ CLI TUI Tests Failed" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Step outcome:** \`${{ steps.tui_tests.outcome }}\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "### Test Output" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
if [ -f tui-test-output.log ]; then
|
||||
cat tui-test-output.log >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "(no test output captured — process may have been killed before output was flushed)" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "### Debugging" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **TUI traces** are attached as artifacts below — download and inspect them to see terminal state at the point of failure." >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **To view a trace replay/Run a TUI Trace: ** run \`npx tui-test show-trace path/to/trace/file\` in your terminal" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Full test log** is also attached as an artifact." >> $GITHUB_STEP_SUMMARY
|
||||
echo "- Tests run with \`retries: 2\` so any failure shown is a consistent failure, not a flake." >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
- name: Upload TUI traces
|
||||
if: always() && steps.tui_tests.outcome != 'success' && steps.tui_tests.outcome != 'skipped'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tui-test-traces
|
||||
path: tests/e2e/cli/tui-traces/
|
||||
retention-days: 14
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Upload test log
|
||||
if: always() && steps.tui_tests.outcome != 'success' && steps.tui_tests.outcome != 'skipped'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tui-test-log
|
||||
path: tui-test-output.log
|
||||
retention-days: 14
|
||||
if-no-files-found: warn
|
||||
@@ -1,14 +1,21 @@
|
||||
name: Smoke Tests
|
||||
|
||||
# Temporarily disabled: this workflow built and linked the legacy CLI
|
||||
# (`cd cli && npm install && npm run build && npm link`) before running the
|
||||
# smoke-test scenarios. The legacy CLI publish chain has been retired in
|
||||
# favor of the SDK CLI at `sdk/apps/cli/`. The scenarios under
|
||||
# `evals/smoke-tests/scenarios/` are CLI-agnostic and should be re-enabled
|
||||
# once the build step is repointed at the new SDK CLI. Until then, only
|
||||
# manual `workflow_dispatch` runs are accepted (and will fail in their
|
||||
# current form).
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'src/core/**'
|
||||
- 'src/shared/**'
|
||||
- 'proto/**'
|
||||
- 'evals/**'
|
||||
- '.github/workflows/cline-evals-regression.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/core/**'
|
||||
- 'src/shared/**'
|
||||
- 'proto/**'
|
||||
- 'evals/**'
|
||||
- '.github/workflows/cline-evals-regression.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
name: Publish NPM Release
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
confirm_publish:
|
||||
description: 'Type "publish" to confirm you want to publish to NPM'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write # Required for pushing tags
|
||||
id-token: write # Required for npm trusted publishing (OIDC)
|
||||
checks: write # Required by test workflow
|
||||
pull-requests: write # Required by test workflow
|
||||
|
||||
jobs:
|
||||
test:
|
||||
uses: ./.github/workflows/test.yml
|
||||
|
||||
publish-npm-release:
|
||||
needs: test
|
||||
name: Publish Cline CLI to NPM
|
||||
if: github.repository == 'cline/cline' && github.ref == 'refs/heads/main' && inputs.confirm_publish == 'publish'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24.x"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Install root dependencies and CLI dependencies
|
||||
run: npm ci --include=optional # this will also install cli deps because "cli" in included in root package.json workspaces field
|
||||
|
||||
- name: Generate Protos
|
||||
run: npm run protos
|
||||
|
||||
- name: Read release version
|
||||
id: version
|
||||
run: |
|
||||
# Read version from cli/package.json
|
||||
VERSION=$(node -p "require('./cli/package.json').version")
|
||||
echo "Release version: $VERSION"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build standalone NPM package
|
||||
env:
|
||||
TELEMETRY_SERVICE_API_KEY: ${{ secrets.TELEMETRY_SERVICE_API_KEY }}
|
||||
ERROR_SERVICE_API_KEY: ${{ secrets.ERROR_SERVICE_API_KEY }}
|
||||
CLINE_ENVIRONMENT: production
|
||||
OTEL_TELEMETRY_ENABLED: "1"
|
||||
OTEL_METRICS_EXPORTER: otlp
|
||||
OTEL_LOGS_EXPORTER: otlp
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: ${{ secrets.OTEL_EXPORTER_OTLP_PROTOCOL }}
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }}
|
||||
OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }}
|
||||
run: node scripts/package-npm.mjs
|
||||
|
||||
- name: Verify build output
|
||||
run: |
|
||||
echo "Checking dist-standalone directory..."
|
||||
ls -la dist-standalone/
|
||||
|
||||
echo "Verifying CLI binaries..."
|
||||
ls -lh cli/bin/cline-* || echo "Warning: CLI binaries not found"
|
||||
|
||||
echo "Checking package.json in dist-standalone..."
|
||||
cat dist-standalone/package.json | grep version
|
||||
|
||||
- name: Publish to NPM with latest tag
|
||||
run: |
|
||||
echo "Publishing version ${{ steps.version.outputs.version }} to NPM with tag 'latest'..."
|
||||
cd dist-standalone
|
||||
npm publish --tag latest --access public
|
||||
|
||||
- name: Tag release
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git tag "v${{ steps.version.outputs.version }}-cli"
|
||||
git push origin "v${{ steps.version.outputs.version }}-cli"
|
||||
|
||||
- name: Summary
|
||||
run: |
|
||||
echo "✅ Successfully published cline@${{ steps.version.outputs.version }} to NPM with tag 'latest'"
|
||||
echo ""
|
||||
echo "📦 Install with: npm install -g cline"
|
||||
echo "🔗 NPM: https://www.npmjs.com/package/cline/v/${{ steps.version.outputs.version }}"
|
||||
|
||||
- name: Post release to Slack
|
||||
uses: slackapi/slack-github-action@v3.0.1
|
||||
with:
|
||||
method: chat.postMessage
|
||||
token: ${{ secrets.SLACK_RELEASE_BOT_TOKEN }}
|
||||
payload: |
|
||||
channel: "C0APVKGGZFC"
|
||||
text: "Cline CLI v${{ steps.version.outputs.version }}"
|
||||
blocks:
|
||||
- type: "section"
|
||||
text:
|
||||
type: "mrkdwn"
|
||||
text: "*Cline CLI v${{ steps.version.outputs.version }}*"
|
||||
- type: "context"
|
||||
elements:
|
||||
- type: "mrkdwn"
|
||||
text: "<https://www.npmjs.com/package/cline/v/${{ steps.version.outputs.version }}|View on npm>"
|
||||
@@ -0,0 +1,136 @@
|
||||
name: Publish NPM Nightly
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
force_publish:
|
||||
description: "Force publish even if there are no commits in the last 24 hours"
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write # Required for npm trusted publishing (OIDC)
|
||||
checks: write # Required by test workflow
|
||||
pull-requests: write # Required by test workflow
|
||||
|
||||
jobs:
|
||||
test:
|
||||
uses: ./.github/workflows/test.yml
|
||||
|
||||
publish-npm-nightly:
|
||||
needs: test
|
||||
name: Publish Cline CLI (Nightly) to NPM
|
||||
if: github.repository == 'cline/cline' && github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check for recent commits
|
||||
id: check_commits
|
||||
env:
|
||||
FORCE_PUBLISH: ${{ inputs.force_publish }}
|
||||
run: |
|
||||
if [ "$FORCE_PUBLISH" = "true" ]; then
|
||||
echo "force_publish enabled, proceeding with publish"
|
||||
echo "skip=false" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $(git rev-list --count HEAD --since="24 hours ago") -eq 0 ]; then
|
||||
echo "No commits in last 24 hours, skipping publish"
|
||||
echo "skip=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Found recent commits, proceeding with publish"
|
||||
echo "skip=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Setup Node.js
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24.x"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Install root dependencies and CLI dependencies
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: npm ci --include=optional # this will also install cli deps because "cli" in included in root package.json workspaces field
|
||||
|
||||
- name: Generate Protos
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: npm run protos
|
||||
|
||||
- name: Generate nightly version with timestamp
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
id: version
|
||||
run: |
|
||||
# Read base version from cli/package.json (e.g., "2.0.0")
|
||||
BASE_VERSION=$(node -p "require('./cli/package.json').version")
|
||||
|
||||
# Generate timestamp (Unix epoch seconds)
|
||||
TIMESTAMP=$(date +%s)
|
||||
|
||||
# Create unique nightly version: 1.0.9-nightly.1736365200
|
||||
VERSION="${BASE_VERSION}-nightly.${TIMESTAMP}"
|
||||
|
||||
echo "Base version: $BASE_VERSION"
|
||||
echo "Generated nightly version: $VERSION"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Update cli/package.json with nightly version
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: |
|
||||
# Update version with timestamp-based nightly version
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const pkg = JSON.parse(fs.readFileSync('cli/package.json', 'utf8'));
|
||||
pkg.version = '${{ steps.version.outputs.version }}';
|
||||
fs.writeFileSync('cli/package.json', JSON.stringify(pkg, null, '\t'));
|
||||
"
|
||||
|
||||
echo "Using version ${{ steps.version.outputs.version }} for build"
|
||||
cat cli/package.json | grep '"version"'
|
||||
|
||||
- name: Build and package CLI
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
env:
|
||||
TELEMETRY_SERVICE_API_KEY: ${{ secrets.TELEMETRY_SERVICE_API_KEY }}
|
||||
ERROR_SERVICE_API_KEY: ${{ secrets.ERROR_SERVICE_API_KEY }}
|
||||
CLINE_ENVIRONMENT: production
|
||||
OTEL_TELEMETRY_ENABLED: "1"
|
||||
OTEL_METRICS_EXPORTER: otlp
|
||||
OTEL_LOGS_EXPORTER: otlp
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: ${{ secrets.OTEL_EXPORTER_OTLP_PROTOCOL }}
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }}
|
||||
OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }}
|
||||
run: node scripts/package-npm.mjs
|
||||
|
||||
- name: Verify build output
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: |
|
||||
echo "Checking dist-standalone directory..."
|
||||
ls -la dist-standalone/
|
||||
|
||||
echo "Verifying CLI binaries..."
|
||||
ls -lh cli/bin/cline-* || echo "Warning: CLI binaries not found"
|
||||
|
||||
echo "Checking package.json in dist-standalone..."
|
||||
cat dist-standalone/package.json | grep version
|
||||
|
||||
- name: Publish to NPM with nightly tag
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: |
|
||||
echo "Publishing version ${{ steps.version.outputs.version }} to NPM with tag 'nightly'..."
|
||||
cd dist-standalone
|
||||
npm publish --tag nightly --access public
|
||||
|
||||
- name: Summary
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: |
|
||||
echo "✅ Successfully published cline@${{ steps.version.outputs.version }} to NPM with tag 'nightly'"
|
||||
echo ""
|
||||
echo "📦 Install with: npm install -g cline@nightly"
|
||||
echo "🔗 NPM: https://www.npmjs.com/package/cline/v/${{ steps.version.outputs.version }}"
|
||||
@@ -0,0 +1,215 @@
|
||||
# Build and Pack CLI
|
||||
#
|
||||
# Builds a CLI tarball from any branch/commit and publishes it as a GitHub Release.
|
||||
# Requires write access to the repository (maintainers/collaborators only).
|
||||
#
|
||||
# Security: Split into two jobs to isolate untrusted build code from write tokens.
|
||||
# The build job runs arbitrary ref code with zero permissions. The release job
|
||||
# only runs trusted GitHub Actions with write scope.
|
||||
#
|
||||
# Usage (helper script, auto-detects current branch):
|
||||
# ./scripts/build-cli-artifact.sh
|
||||
# ./scripts/build-cli-artifact.sh feature/my-changes
|
||||
# ./scripts/build-cli-artifact.sh feature/my-changes 1234 # comments on PR
|
||||
#
|
||||
# Usage (gh CLI directly):
|
||||
# gh workflow run pack-cli.yml -f ref=main
|
||||
# gh workflow run pack-cli.yml -f ref=abc123 -f pr_number=1234
|
||||
#
|
||||
# Install the built CLI (no auth required):
|
||||
# npm install -g https://github.com/cline/cline/releases/download/cli-build-<sha>/cline-<ver>.tgz
|
||||
#
|
||||
# Find releases:
|
||||
# gh release list --limit 10
|
||||
|
||||
name: Build and Pack CLI
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
description: 'Branch, tag, or commit SHA to build (leave empty for default branch)'
|
||||
required: false
|
||||
type: string
|
||||
pr_number:
|
||||
description: 'PR number to comment on with install instructions (optional)'
|
||||
required: false
|
||||
type: number
|
||||
|
||||
jobs:
|
||||
# ── Build job: runs untrusted ref code with ZERO permissions ──
|
||||
build:
|
||||
name: Build CLI
|
||||
runs-on: ubuntu-latest
|
||||
permissions: {}
|
||||
outputs:
|
||||
commit_sha: ${{ steps.commit.outputs.sha }}
|
||||
tarball: ${{ steps.pack.outputs.tarball }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.ref || github.ref }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Get commit SHA
|
||||
id: commit
|
||||
run: |
|
||||
COMMIT_SHA=$(git rev-parse --short HEAD)
|
||||
echo "sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
|
||||
echo "Building from commit: $COMMIT_SHA"
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20.x"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --include=optional
|
||||
|
||||
- name: Generate Protos
|
||||
run: npm run protos
|
||||
|
||||
- name: Build standalone package
|
||||
run: node scripts/package-npm.mjs
|
||||
|
||||
- name: Create Tarball
|
||||
id: pack
|
||||
run: |
|
||||
cd dist-standalone
|
||||
TARBALL=$(npm pack)
|
||||
echo "tarball=$TARBALL" >> $GITHUB_OUTPUT
|
||||
echo "Created tarball: $TARBALL"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cli-tarball
|
||||
path: dist-standalone/*.tgz
|
||||
|
||||
# ── Release job: only trusted Actions code, with write permissions ──
|
||||
release:
|
||||
name: Release CLI
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
issues: write
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: cli-tarball
|
||||
path: dist-standalone
|
||||
|
||||
- name: Create GitHub Release
|
||||
id: create_release
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const commit = '${{ needs.build.outputs.commit_sha }}';
|
||||
const tarball = '${{ needs.build.outputs.tarball }}';
|
||||
|
||||
// Delete existing release/tag if re-running for the same commit
|
||||
const tagName = `cli-build-${commit}`;
|
||||
try {
|
||||
const existing = await github.rest.repos.getReleaseByTag({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
tag: tagName
|
||||
});
|
||||
await github.rest.repos.deleteRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
release_id: existing.data.id
|
||||
});
|
||||
await github.rest.git.deleteRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: `tags/${tagName}`
|
||||
});
|
||||
core.info(`Deleted existing release for ${tagName}`);
|
||||
} catch (e) {
|
||||
// Release doesn't exist yet, that's fine
|
||||
}
|
||||
|
||||
// Create a release
|
||||
const release = await github.rest.repos.createRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
tag_name: tagName,
|
||||
name: `CLI Build (${commit})`,
|
||||
body: `Automated CLI build from commit ${commit}\n\nInstall with:\n\`\`\`bash\nnpm install -g https://github.com/${context.repo.owner}/${context.repo.repo}/releases/download/${tagName}/${tarball}\n\`\`\``,
|
||||
draft: false,
|
||||
prerelease: true
|
||||
});
|
||||
|
||||
// Upload the tarball as a release asset
|
||||
const tarballPath = path.join('dist-standalone', tarball);
|
||||
const tarballData = fs.readFileSync(tarballPath);
|
||||
|
||||
await github.rest.repos.uploadReleaseAsset({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
release_id: release.data.id,
|
||||
name: tarball,
|
||||
data: tarballData
|
||||
});
|
||||
|
||||
const downloadUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/releases/download/${tagName}/${tarball}`;
|
||||
core.setOutput('release_url', release.data.html_url);
|
||||
core.setOutput('download_url', downloadUrl);
|
||||
|
||||
- name: Comment on PR with download instructions
|
||||
if: inputs.pr_number != ''
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const commit = '${{ needs.build.outputs.commit_sha }}';
|
||||
const releaseUrl = '${{ steps.create_release.outputs.release_url }}';
|
||||
const downloadUrl = '${{ steps.create_release.outputs.download_url }}';
|
||||
const prNumber = ${{ inputs.pr_number || 0 }};
|
||||
if (!prNumber) return;
|
||||
|
||||
const comment = `## 📦 CLI Build Ready
|
||||
|
||||
A CLI build has been created for commit \`${commit}\`.
|
||||
|
||||
### Install Directly from URL (No Authentication Required!)
|
||||
|
||||
\`\`\`bash
|
||||
npm install -g ${downloadUrl}
|
||||
\`\`\`
|
||||
|
||||
### Alternative: Download and Install
|
||||
|
||||
\`\`\`bash
|
||||
curl -L ${downloadUrl} -o cline.tgz
|
||||
npm install -g ./cline.tgz
|
||||
\`\`\`
|
||||
|
||||
📦 [View Release](${releaseUrl})
|
||||
`;
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
issue_number: prNumber,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: comment
|
||||
});
|
||||
|
||||
- name: Summary
|
||||
run: |
|
||||
echo "✅ CLI build complete!"
|
||||
echo ""
|
||||
echo "📦 Release: ${{ steps.create_release.outputs.release_url }}"
|
||||
echo "🔗 Download URL: ${{ steps.create_release.outputs.download_url }}"
|
||||
echo ""
|
||||
echo "Install from anywhere (no authentication required):"
|
||||
echo " npm install -g ${{ steps.create_release.outputs.download_url }}"
|
||||
@@ -0,0 +1,60 @@
|
||||
name: Publish CLI (Trusted)
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 12 * * *" # 4 AM PST (UTC-8) = 12 UTC
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
publish_target:
|
||||
description: "Which publish flow to run"
|
||||
required: true
|
||||
default: "main"
|
||||
type: choice
|
||||
options:
|
||||
- main
|
||||
- nightly
|
||||
confirm_publish:
|
||||
description: 'Required when publish_target=main. Type "publish" to confirm release publish.'
|
||||
required: false
|
||||
type: string
|
||||
force_nightly_publish:
|
||||
description: "Force nightly publish even with no commits in last 24h"
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
id-token: write # Required for npm trusted publishing (OIDC)
|
||||
contents: write # Required because npm-main creates/pushes git tags
|
||||
checks: write # Required by nested reusable test workflow
|
||||
pull-requests: write # Required by nested reusable test workflow
|
||||
|
||||
jobs:
|
||||
cli-tui-tests:
|
||||
uses: ./.github/workflows/cli-tui-tests.yml
|
||||
|
||||
publish-main:
|
||||
needs: cli-tui-tests
|
||||
if: |
|
||||
github.repository == 'cline/cline' && (
|
||||
github.event_name == 'workflow_dispatch' &&
|
||||
github.event.inputs.publish_target == 'main' &&
|
||||
github.event.inputs.confirm_publish == 'publish' &&
|
||||
!endsWith(github.actor, '[bot]')
|
||||
)
|
||||
uses: ./.github/workflows/npm-main.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
confirm_publish: ${{ github.event.inputs.confirm_publish }}
|
||||
|
||||
publish-nightly:
|
||||
needs: cli-tui-tests
|
||||
if: |
|
||||
github.repository == 'cline/cline' && (
|
||||
github.event_name == 'schedule' ||
|
||||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish_target == 'nightly')
|
||||
)
|
||||
uses: ./.github/workflows/npm-nightly.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
force_publish: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.force_nightly_publish == 'true' }}
|
||||
@@ -1,394 +0,0 @@
|
||||
name: Publish CLI to NPM
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 12 * * *"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
publish_target:
|
||||
description: "Which publish flow to run"
|
||||
required: true
|
||||
default: "main"
|
||||
type: choice
|
||||
options:
|
||||
- main
|
||||
- nightly
|
||||
git_tag:
|
||||
description: "Existing release tag to publish when publish_target=main, for example cli-v0.1.0"
|
||||
required: false
|
||||
type: string
|
||||
confirm_publish:
|
||||
description: 'Required when publish_target=main. Type "publish" to confirm release publish.'
|
||||
required: false
|
||||
type: string
|
||||
force_nightly_publish:
|
||||
description: "Force nightly publish even with no commits in last 24h"
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: sdk
|
||||
|
||||
jobs:
|
||||
publish-main:
|
||||
name: Publish cline
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
if: |
|
||||
github.repository == 'cline/cline' &&
|
||||
github.ref == 'refs/heads/main' &&
|
||||
github.event_name == 'workflow_dispatch' &&
|
||||
github.event.inputs.publish_target == 'main' &&
|
||||
github.event.inputs.confirm_publish == 'publish' &&
|
||||
!endsWith(github.actor, '[bot]')
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.inputs.git_tag }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: "1.3.13"
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24.x"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Verify publish tooling
|
||||
run: |
|
||||
NPM_VERSION=$(npm --version)
|
||||
echo "npm ${NPM_VERSION}"
|
||||
IFS=. read -r major minor patch <<EOF
|
||||
${NPM_VERSION}
|
||||
EOF
|
||||
if [ "$major" -lt 11 ] || { [ "$major" -eq 11 ] && [ "$minor" -lt 5 ]; } || { [ "$major" -eq 11 ] && [ "$minor" -eq 5 ] && [ "$patch" -lt 1 ]; }; then
|
||||
echo "npm 11.5.1 or newer is required for trusted publishing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Validate release tag
|
||||
id: version
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.git_tag }}"
|
||||
|
||||
if [ -z "$TAG" ]; then
|
||||
echo "git_tag is required when publish_target=main"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! printf "%s\n" "$TAG" | grep -Eq '^cli-v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then
|
||||
echo "git_tag must look like cli-vX.Y.Z, got: ${TAG}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION="${TAG#cli-v}"
|
||||
PACKAGE_VERSION=$(node -p "require('./apps/cli/package.json').version")
|
||||
|
||||
if [ "$PACKAGE_VERSION" != "$VERSION" ]; then
|
||||
echo "sdk/apps/cli/package.json version ${PACKAGE_VERSION} does not match ${TAG}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! printf "%s\n" "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then
|
||||
echo "sdk/apps/cli/package.json has invalid version: ${VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TAG_COMMIT=$(git rev-parse "${TAG}^{commit}")
|
||||
HEAD_COMMIT=$(git rev-parse HEAD)
|
||||
if [ "$TAG_COMMIT" != "$HEAD_COMMIT" ]; then
|
||||
echo "${TAG} does not point at the checked out commit"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git fetch origin +main:refs/remotes/origin/main
|
||||
if ! git merge-base --is-ancestor "$HEAD_COMMIT" origin/main; then
|
||||
echo "${TAG} is not reachable from origin/main"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build SDK packages
|
||||
run: bun run build:sdk
|
||||
|
||||
- name: Run tests
|
||||
run: bun run test
|
||||
|
||||
- name: Build platform binaries
|
||||
run: bun script/build.ts --install-native-variants --skip-sdk-build
|
||||
working-directory: sdk/apps/cli
|
||||
|
||||
- name: Verify build output
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
EXPECTED=(
|
||||
"@cline/cli-darwin-arm64"
|
||||
"@cline/cli-darwin-x64"
|
||||
"@cline/cli-linux-arm64"
|
||||
"@cline/cli-linux-x64"
|
||||
"@cline/cli-windows-arm64"
|
||||
"@cline/cli-windows-x64"
|
||||
)
|
||||
|
||||
for package_name in "${EXPECTED[@]}"; do
|
||||
dir="apps/cli/dist/${package_name#@cline/}"
|
||||
if [ ! -f "$dir/package.json" ]; then
|
||||
echo "Missing package manifest: $dir/package.json"
|
||||
exit 1
|
||||
fi
|
||||
actual_name=$(node -p "require('./$dir/package.json').name")
|
||||
actual_version=$(node -p "require('./$dir/package.json').version")
|
||||
if [ "$actual_name" != "$package_name" ]; then
|
||||
echo "Expected $package_name, got $actual_name"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$actual_version" != "$VERSION" ]; then
|
||||
echo "Expected $package_name@$VERSION, got $actual_version"
|
||||
exit 1
|
||||
fi
|
||||
ls -lh "$dir/bin/"
|
||||
done
|
||||
|
||||
- name: Publish to NPM with latest tag
|
||||
env:
|
||||
NPM_CONFIG_PROVENANCE: "true"
|
||||
run: bun script/publish-npm.ts --tag latest
|
||||
working-directory: sdk/apps/cli
|
||||
|
||||
- name: Get Previous CLI Tag
|
||||
id: prev_tag
|
||||
run: |
|
||||
CURRENT_TAG="${{ steps.version.outputs.tag }}"
|
||||
PREV_TAG=$(git describe --tags --abbrev=0 --match 'cli-v*' "$CURRENT_TAG^" 2>/dev/null || echo "")
|
||||
echo "prev_tag=$PREV_TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get Changelog Entry
|
||||
id: changelog
|
||||
run: |
|
||||
# Grab content between the first "## " header and the next one in apps/cli/CHANGELOG.md
|
||||
CONTENT=$(awk '/^## [0-9]/{if(found) exit; found=1; next} found{print}' apps/cli/CHANGELOG.md)
|
||||
echo "content<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "$CONTENT" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: ${{ steps.version.outputs.tag }}
|
||||
name: "CLI v${{ steps.version.outputs.version }}"
|
||||
body: |
|
||||
${{ steps.changelog.outputs.content }}
|
||||
${{ steps.prev_tag.outputs.prev_tag != '' && format('Full Changelog: https://github.com/{0}/compare/{1}...{2}', github.repository, steps.prev_tag.outputs.prev_tag, steps.version.outputs.tag) || '' }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Summary
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
echo "Published cline@${VERSION} to npm with dist-tag 'latest'"
|
||||
echo "Install with: npm install -g cline"
|
||||
|
||||
- name: Post release to Slack
|
||||
uses: slackapi/slack-github-action@v3.0.1
|
||||
with:
|
||||
method: chat.postMessage
|
||||
token: ${{ secrets.SLACK_RELEASE_BOT_TOKEN }}
|
||||
payload: |
|
||||
channel: "C0APVKGGZFC"
|
||||
text: "Cline CLI v${{ steps.version.outputs.version }}"
|
||||
blocks:
|
||||
- type: "section"
|
||||
text:
|
||||
type: "mrkdwn"
|
||||
text: "Cline CLI v${{ steps.version.outputs.version }}"
|
||||
- type: "section"
|
||||
text:
|
||||
type: "mrkdwn"
|
||||
text: ${{ toJSON(steps.changelog.outputs.content) }}
|
||||
- type: "context"
|
||||
elements:
|
||||
- type: "mrkdwn"
|
||||
text: "<https://www.npmjs.com/package/cline/v/${{ steps.version.outputs.version }}|View on npm>${{ steps.prev_tag.outputs.prev_tag != '' && format(' | Full Changelog: https://github.com/{0}/compare/{1}...{2}', github.repository, steps.prev_tag.outputs.prev_tag, steps.version.outputs.tag) || '' }}"
|
||||
|
||||
publish-nightly:
|
||||
name: Publish cline nightly
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
if: |
|
||||
github.repository == 'cline/cline' &&
|
||||
github.ref == 'refs/heads/main' &&
|
||||
(
|
||||
github.event_name == 'schedule' ||
|
||||
(
|
||||
github.event_name == 'workflow_dispatch' &&
|
||||
github.event.inputs.publish_target == 'nightly'
|
||||
)
|
||||
)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check for recent commits
|
||||
id: check_commits
|
||||
env:
|
||||
FORCE_PUBLISH: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.force_nightly_publish == 'true' }}
|
||||
run: |
|
||||
if [ "$FORCE_PUBLISH" = "true" ]; then
|
||||
echo "force_nightly_publish enabled, proceeding with publish"
|
||||
echo "skip=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$(git rev-list --count HEAD --since='24 hours ago')" -eq 0 ]; then
|
||||
echo "No commits in last 24 hours, skipping publish"
|
||||
echo "skip=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Found recent commits, proceeding with publish"
|
||||
echo "skip=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Setup Bun
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: "1.3.13"
|
||||
|
||||
- name: Setup Node.js
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24.x"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Verify publish tooling
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: |
|
||||
NPM_VERSION=$(npm --version)
|
||||
echo "npm ${NPM_VERSION}"
|
||||
IFS=. read -r major minor patch <<EOF
|
||||
${NPM_VERSION}
|
||||
EOF
|
||||
if [ "$major" -lt 11 ] || { [ "$major" -eq 11 ] && [ "$minor" -lt 5 ]; } || { [ "$major" -eq 11 ] && [ "$minor" -eq 5 ] && [ "$patch" -lt 1 ]; }; then
|
||||
echo "npm 11.5.1 or newer is required for trusted publishing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: bun install
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build SDK packages
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: bun run build:sdk
|
||||
|
||||
- name: Run tests
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: bun run test
|
||||
|
||||
- name: Generate nightly version
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
id: version
|
||||
run: |
|
||||
BASE_VERSION=$(node -p "require('./apps/cli/package.json').version")
|
||||
TIMESTAMP=$(date +%s)
|
||||
VERSION="${BASE_VERSION}-nightly.${TIMESTAMP}"
|
||||
|
||||
echo "Base version: ${BASE_VERSION}"
|
||||
echo "Generated nightly version: ${VERSION}"
|
||||
echo "base_version=${BASE_VERSION}" >> "$GITHUB_OUTPUT"
|
||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Update nightly package version
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
node -e '
|
||||
const fs = require("node:fs");
|
||||
const path = "apps/cli/package.json";
|
||||
const pkg = JSON.parse(fs.readFileSync(path, "utf8"));
|
||||
pkg.version = process.env.VERSION;
|
||||
fs.writeFileSync(path, `${JSON.stringify(pkg, null, "\t")}\n`);
|
||||
'
|
||||
cat apps/cli/package.json | grep '"version"'
|
||||
env:
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
|
||||
- name: Build platform binaries
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: bun script/build.ts --install-native-variants --skip-sdk-build
|
||||
working-directory: sdk/apps/cli
|
||||
|
||||
- name: Verify build output
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
EXPECTED=(
|
||||
"@cline/cli-darwin-arm64"
|
||||
"@cline/cli-darwin-x64"
|
||||
"@cline/cli-linux-arm64"
|
||||
"@cline/cli-linux-x64"
|
||||
"@cline/cli-windows-arm64"
|
||||
"@cline/cli-windows-x64"
|
||||
)
|
||||
|
||||
for package_name in "${EXPECTED[@]}"; do
|
||||
dir="apps/cli/dist/${package_name#@cline/}"
|
||||
if [ ! -f "$dir/package.json" ]; then
|
||||
echo "Missing package manifest: $dir/package.json"
|
||||
exit 1
|
||||
fi
|
||||
actual_name=$(node -p "require('./$dir/package.json').name")
|
||||
actual_version=$(node -p "require('./$dir/package.json').version")
|
||||
if [ "$actual_name" != "$package_name" ]; then
|
||||
echo "Expected $package_name, got $actual_name"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$actual_version" != "$VERSION" ]; then
|
||||
echo "Expected $package_name@$VERSION, got $actual_version"
|
||||
exit 1
|
||||
fi
|
||||
ls -lh "$dir/bin/"
|
||||
done
|
||||
|
||||
- name: Publish to NPM with nightly tag
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
env:
|
||||
NPM_CONFIG_PROVENANCE: "true"
|
||||
run: bun script/publish-npm.ts --tag nightly
|
||||
working-directory: sdk/apps/cli
|
||||
|
||||
- name: Summary
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
echo "Published cline@${VERSION} to npm with dist-tag 'nightly'"
|
||||
echo "Install with: npm install -g cline@nightly"
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
name: "Publish New SDK Extension Nightly"
|
||||
name: "Publish SDK Nightly Release"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
@@ -17,7 +17,7 @@ env:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish Cline New SDK Extension Nightly
|
||||
name: Publish Cline (Nightly SDK) Extension
|
||||
if: github.repository == 'cline/cline' && github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
environment: PublishNightly
|
||||
@@ -3,103 +3,73 @@ name: "Publish Nightly Release"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
run-name: "Publish Nightly from ${{ github.ref_name }} @ ${{ github.sha }}"
|
||||
|
||||
# Prevent concurrent publish runs on the same branch. The nightly publish script
|
||||
# generates the extension version from a seconds-resolution timestamp, so parallel
|
||||
# runs on the same ref can collide on the same version and cause publish failures
|
||||
# or inconsistent tagging. Runs on different branches proceed independently.
|
||||
concurrency:
|
||||
group: publish-nightly-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions: {}
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
checks: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
test:
|
||||
if: github.repository == 'cline/cline' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dpc/sdk-migration-simpler-login')
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/test.yml
|
||||
test:
|
||||
uses: ./.github/workflows/test.yml
|
||||
|
||||
publish:
|
||||
needs: test
|
||||
permissions:
|
||||
contents: write
|
||||
name: Publish Cline (Nightly) Extension
|
||||
if: github.repository == 'cline/cline' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dpc/sdk-migration-simpler-login')
|
||||
runs-on: ubuntu-latest
|
||||
environment: PublishNightly
|
||||
publish:
|
||||
needs: test
|
||||
name: Publish Cline (Nightly) Extension
|
||||
if: github.repository == 'cline/cline'
|
||||
runs-on: ubuntu-latest
|
||||
environment: PublishNightly
|
||||
|
||||
steps:
|
||||
- name: Checkout selected branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.sha }}
|
||||
lfs: true
|
||||
persist-credentials: false
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- name: Show build source
|
||||
run: |
|
||||
echo "Building ref: $GITHUB_REF"
|
||||
echo "Building sha: $GITHUB_SHA"
|
||||
git --no-pager log -1 --oneline
|
||||
- name: Check for recent commits
|
||||
run: |
|
||||
if [ $(git rev-list --count HEAD --since="24 hours ago") -eq 0 ]; then
|
||||
echo "No commits in last 24 hours, exiting"
|
||||
exit 0
|
||||
fi
|
||||
echo "Found recent commits, proceeding with build"
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
# Keep publish environment aligned with test workflow/tooling lockfile expectations.
|
||||
# Newer LTS (Node 24 / npm 11) can make `npm list` fail with ELSPROBLEMS during vsce packaging.
|
||||
node-version: 22
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
# Keep publish environment aligned with test workflow/tooling lockfile expectations.
|
||||
# Newer LTS (Node 24 / npm 11) can make `npm list` fail with ELSPROBLEMS during vsce packaging.
|
||||
node-version: 22
|
||||
- name: Install root dependencies
|
||||
run: npm ci --include=optional
|
||||
|
||||
- name: Install root dependencies
|
||||
run: npm ci --include=optional
|
||||
- name: Install webview-ui dependencies
|
||||
run: cd webview-ui && npm ci --include=optional
|
||||
|
||||
- name: Install webview-ui dependencies
|
||||
run: cd webview-ui && npm ci --include=optional
|
||||
- name: Install Publishing Tools
|
||||
run: npm install -g @vscode/vsce ovsx
|
||||
|
||||
- name: Install Publishing Tools
|
||||
run: npm install -g @vscode/vsce ovsx
|
||||
- name: Verify LFS media assets are resolved
|
||||
run: |
|
||||
for FILE in webview-ui/src/assets/cline_kanban_demo.mp4 webview-ui/src/assets/cline_kanban_demo.webm; do
|
||||
if grep -q "git-lfs.github.com/spec/v1" "$FILE"; then
|
||||
echo "Error: $FILE is still a Git LFS pointer in CI checkout"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Verify LFS media assets are resolved
|
||||
run: |
|
||||
for FILE in webview-ui/src/assets/cline_kanban_demo.mp4 webview-ui/src/assets/cline_kanban_demo.webm; do
|
||||
if grep -q "git-lfs.github.com/spec/v1" "$FILE"; then
|
||||
echo "Error: $FILE is still a Git LFS pointer in CI checkout"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Publish Nightly Extension
|
||||
env:
|
||||
VSCE_PAT: ${{ secrets.VSCE_PAT }}
|
||||
OVSX_PAT: ${{ secrets.OVSX_PAT }}
|
||||
TELEMETRY_SERVICE_API_KEY: ${{ secrets.TELEMETRY_SERVICE_API_KEY }}
|
||||
ERROR_SERVICE_API_KEY: ${{ secrets.ERROR_SERVICE_API_KEY }}
|
||||
CLINE_ENVIRONMENT: production
|
||||
# OpenTelemetry production defaults (can be overridden at runtime)
|
||||
OTEL_TELEMETRY_ENABLED: ${{ secrets.OTEL_TELEMETRY_ENABLED }}
|
||||
OTEL_LOGS_EXPORTER: otlp
|
||||
OTEL_METRICS_EXPORTER: otlp
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: ${{ secrets.OTEL_EXPORTER_OTLP_PROTOCOL }}
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }}
|
||||
OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }}
|
||||
run: npm run publish:marketplace:nightly
|
||||
|
||||
- name: Tag published commit
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
SAFE_REF=$(echo "$GITHUB_REF_NAME" | tr '/[:upper:]' '-[:lower:]' | tr -cd 'a-z0-9._-')
|
||||
SHORT_SHA=$(git rev-parse --short=12 HEAD)
|
||||
TIMESTAMP=$(date -u +"%Y%m%d%H%M%S")
|
||||
TAG="nightly-${SAFE_REF}-${TIMESTAMP}-${SHORT_SHA}"
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git tag -a "$TAG" -m "Cline Nightly published from ${GITHUB_REF_NAME} at ${GITHUB_SHA}"
|
||||
# Use an explicit HTTPS remote with GH_TOKEN because checkout was run with
|
||||
# persist-credentials: false, so actions/checkout did not persist a git credential helper.
|
||||
git push "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "refs/tags/${TAG}"
|
||||
|
||||
echo "Tagged published commit: $TAG"
|
||||
- name: Publish Nightly Extension
|
||||
env:
|
||||
VSCE_PAT: ${{ secrets.VSCE_PAT }}
|
||||
OVSX_PAT: ${{ secrets.OVSX_PAT }}
|
||||
TELEMETRY_SERVICE_API_KEY: ${{ secrets.TELEMETRY_SERVICE_API_KEY }}
|
||||
ERROR_SERVICE_API_KEY: ${{ secrets.ERROR_SERVICE_API_KEY }}
|
||||
CLINE_ENVIRONMENT: production
|
||||
# OpenTelemetry production defaults (can be overridden at runtime)
|
||||
OTEL_TELEMETRY_ENABLED: ${{ secrets.OTEL_TELEMETRY_ENABLED }}
|
||||
OTEL_LOGS_EXPORTER: otlp
|
||||
OTEL_METRICS_EXPORTER: otlp
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: ${{ secrets.OTEL_EXPORTER_OTLP_PROTOCOL }}
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }}
|
||||
OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }}
|
||||
run: npm run publish:marketplace:nightly
|
||||
|
||||
@@ -1,269 +0,0 @@
|
||||
name: Publish Main SDK Packages
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
channel:
|
||||
description: "Publish channel"
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- nightly
|
||||
- latest
|
||||
default: nightly
|
||||
force_publish:
|
||||
description: "Force publish even if there are no commits in the last 24 hours"
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
confirm_publish:
|
||||
description: 'Required when channel=latest. Type "publish" to confirm release publish.'
|
||||
required: false
|
||||
type: string
|
||||
schedule:
|
||||
# Run nightly at 2:00 AM UTC
|
||||
- cron: "0 2 * * *"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: sdk
|
||||
|
||||
jobs:
|
||||
test:
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/sdk-test.yml
|
||||
|
||||
publish-sdk:
|
||||
needs: test
|
||||
name: Publish SDK Packages
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
if: |
|
||||
github.repository == 'cline/cline' &&
|
||||
github.ref == 'refs/heads/main' &&
|
||||
(
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
inputs.channel != 'latest' ||
|
||||
(
|
||||
inputs.confirm_publish == 'publish' &&
|
||||
!endsWith(github.actor, '[bot]')
|
||||
)
|
||||
)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Determine publish channel
|
||||
id: channel
|
||||
run: |
|
||||
# Default to nightly for scheduled runs
|
||||
if [ "${{ github.event_name }}" = "schedule" ]; then
|
||||
echo "channel=nightly" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "channel=${{ inputs.channel }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Check for recent commits
|
||||
id: check_commits
|
||||
run: |
|
||||
CHANNEL="${{ steps.channel.outputs.channel }}"
|
||||
|
||||
# Always publish for latest (production) releases
|
||||
if [ "$CHANNEL" = "latest" ]; then
|
||||
echo "Production release requested, proceeding with publish"
|
||||
echo "skip=false" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${{ inputs.force_publish }}" = "true" ]; then
|
||||
echo "force_publish enabled, proceeding with publish"
|
||||
echo "skip=false" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$(git rev-list --count HEAD --since="24 hours ago")" -eq 0 ]; then
|
||||
echo "No commits in last 24 hours, skipping publish"
|
||||
echo "skip=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Found recent commits, proceeding with publish"
|
||||
echo "skip=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Verify trusted publishing context
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: |
|
||||
if [ -z "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ] || [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ]; then
|
||||
echo "GitHub OIDC request environment is unavailable. Ensure this job has id-token: write for npm trusted publishing."
|
||||
exit 1
|
||||
fi
|
||||
echo "GitHub OIDC request environment is available for npm trusted publishing."
|
||||
|
||||
- name: Setup Bun
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: "1.3.13"
|
||||
|
||||
- name: Setup Node.js
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24.x"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Verify publish tooling
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: |
|
||||
NPM_VERSION=$(npm --version)
|
||||
echo "npm ${NPM_VERSION}"
|
||||
IFS=. read -r major minor patch <<EOF
|
||||
${NPM_VERSION}
|
||||
EOF
|
||||
if [ "$major" -lt 11 ] || { [ "$major" -eq 11 ] && [ "$minor" -lt 5 ]; } || { [ "$major" -eq 11 ] && [ "$minor" -eq 5 ] && [ "$patch" -lt 1 ]; }; then
|
||||
echo "npm 11.5.1 or newer is required for trusted publishing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: bun install
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build SDK
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: bun run build:sdk
|
||||
|
||||
- name: Generate shared version
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
id: version
|
||||
run: |
|
||||
CHANNEL="${{ steps.channel.outputs.channel }}"
|
||||
BASE_VERSION=$(node -p "require('./packages/llms/package.json').version")
|
||||
|
||||
if [ "$CHANNEL" = "nightly" ]; then
|
||||
TIMESTAMP=$(date +%s)
|
||||
VERSION="${BASE_VERSION}-nightly.${TIMESTAMP}"
|
||||
else
|
||||
VERSION="$BASE_VERSION"
|
||||
fi
|
||||
|
||||
echo "Base version: $BASE_VERSION"
|
||||
echo "Channel: $CHANNEL"
|
||||
echo "Publish version: $VERSION"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Update all package versions and lockfile
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: bun scripts/version.ts "${{ steps.version.outputs.version }}"
|
||||
|
||||
- name: Verify publishability
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: bun scripts/check-publish.ts
|
||||
|
||||
- name: Prepare package tarball directory
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: mkdir -p "$RUNNER_TEMP/sdk-npm-packs"
|
||||
|
||||
# Pack with Bun so workspace/catalog protocols are resolved in the tarball,
|
||||
# then publish that tarball with npm so npm trusted publishing can use GitHub OIDC.
|
||||
# Publish sequentially in dependency order: shared → llms → agents → core → sdk
|
||||
- name: Publish @cline/shared
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
env:
|
||||
NPM_CONFIG_PROVENANCE: "true"
|
||||
run: |
|
||||
CHANNEL="${{ steps.channel.outputs.channel }}"
|
||||
echo "Publishing @cline/shared@${{ steps.version.outputs.version }} with tag '${CHANNEL}'..."
|
||||
cd packages/shared
|
||||
TARBALL=$(bun pm pack --destination "$RUNNER_TEMP/sdk-npm-packs" --quiet)
|
||||
npm publish "$RUNNER_TEMP/sdk-npm-packs/$(basename "$TARBALL")" --tag "$CHANNEL" --access public
|
||||
|
||||
- name: Publish @cline/llms
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
env:
|
||||
NPM_CONFIG_PROVENANCE: "true"
|
||||
run: |
|
||||
CHANNEL="${{ steps.channel.outputs.channel }}"
|
||||
echo "Publishing @cline/llms@${{ steps.version.outputs.version }} with tag '${CHANNEL}'..."
|
||||
cd packages/llms
|
||||
TARBALL=$(bun pm pack --destination "$RUNNER_TEMP/sdk-npm-packs" --quiet)
|
||||
npm publish "$RUNNER_TEMP/sdk-npm-packs/$(basename "$TARBALL")" --tag "$CHANNEL" --access public
|
||||
|
||||
- name: Publish @cline/agents
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
env:
|
||||
NPM_CONFIG_PROVENANCE: "true"
|
||||
run: |
|
||||
CHANNEL="${{ steps.channel.outputs.channel }}"
|
||||
echo "Publishing @cline/agents@${{ steps.version.outputs.version }} with tag '${CHANNEL}'..."
|
||||
cd packages/agents
|
||||
TARBALL=$(bun pm pack --destination "$RUNNER_TEMP/sdk-npm-packs" --quiet)
|
||||
npm publish "$RUNNER_TEMP/sdk-npm-packs/$(basename "$TARBALL")" --tag "$CHANNEL" --access public
|
||||
|
||||
- name: Publish @cline/core
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
env:
|
||||
NPM_CONFIG_PROVENANCE: "true"
|
||||
run: |
|
||||
CHANNEL="${{ steps.channel.outputs.channel }}"
|
||||
echo "Publishing @cline/core@${{ steps.version.outputs.version }} with tag '${CHANNEL}'..."
|
||||
cd packages/core
|
||||
TARBALL=$(bun pm pack --destination "$RUNNER_TEMP/sdk-npm-packs" --quiet)
|
||||
npm publish "$RUNNER_TEMP/sdk-npm-packs/$(basename "$TARBALL")" --tag "$CHANNEL" --access public
|
||||
|
||||
- name: Publish @cline/sdk
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
env:
|
||||
NPM_CONFIG_PROVENANCE: "true"
|
||||
run: |
|
||||
CHANNEL="${{ steps.channel.outputs.channel }}"
|
||||
echo "Publishing @cline/sdk@${{ steps.version.outputs.version }} with tag '${CHANNEL}'..."
|
||||
cd packages/sdk
|
||||
TARBALL=$(bun pm pack --destination "$RUNNER_TEMP/sdk-npm-packs" --quiet)
|
||||
npm publish "$RUNNER_TEMP/sdk-npm-packs/$(basename "$TARBALL")" --tag "$CHANNEL" --access public
|
||||
|
||||
- name: Create package tags for production publish
|
||||
if: steps.check_commits.outputs.skip != 'true' && steps.channel.outputs.channel == 'latest'
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
for PKG in shared llms agents core sdk; do
|
||||
TAG="sdk/${PKG}/v${VERSION}"
|
||||
if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null; then
|
||||
echo "Tag already exists locally: ${TAG}"
|
||||
else
|
||||
git tag -a "${TAG}" -m "@cline/${PKG}@${VERSION}"
|
||||
echo "Created tag: ${TAG}"
|
||||
fi
|
||||
|
||||
# Ensure remote has the tag; this is idempotent if tag already exists remotely.
|
||||
git push origin "refs/tags/${TAG}"
|
||||
done
|
||||
|
||||
- name: Summary
|
||||
if: steps.check_commits.outputs.skip != 'true'
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
CHANNEL="${{ steps.channel.outputs.channel }}"
|
||||
echo "Published SDK packages with tag '${CHANNEL}':"
|
||||
echo " - @cline/shared@${VERSION}"
|
||||
echo " - @cline/llms@${VERSION}"
|
||||
echo " - @cline/agents@${VERSION}"
|
||||
echo " - @cline/core@${VERSION}"
|
||||
echo " - @cline/sdk@${VERSION}"
|
||||
if [ "$CHANNEL" = "latest" ]; then
|
||||
echo "Created git tags:"
|
||||
echo " - sdk/shared/v${VERSION}"
|
||||
echo " - sdk/llms/v${VERSION}"
|
||||
echo " - sdk/agents/v${VERSION}"
|
||||
echo " - sdk/core/v${VERSION}"
|
||||
echo " - sdk/sdk/v${VERSION}"
|
||||
fi
|
||||
@@ -160,13 +160,6 @@ jobs:
|
||||
OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }}
|
||||
RELEASE_TYPE: ${{ github.event.inputs.release-type }}
|
||||
run: |
|
||||
# Swap README.marketplace.md into README.md so both the GitHub
|
||||
# release artifact (vsce package below) and the marketplace
|
||||
# publish (npm run publish:marketplace below, which swaps
|
||||
# internally as an idempotent no-op) ship the same README.
|
||||
node scripts/marketplace-readme.mjs swap-in
|
||||
trap 'node scripts/marketplace-readme.mjs restore' EXIT
|
||||
|
||||
# Required to generate the .vsix
|
||||
vsce package --allow-package-secrets sendgrid --out "cline-${{ steps.get_version.outputs.version }}.vsix"
|
||||
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
name: SDK Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "sdk/**"
|
||||
- ".github/workflows/sdk-test.yml"
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "sdk/**"
|
||||
- ".github/workflows/sdk-test.yml"
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: sdk
|
||||
|
||||
jobs:
|
||||
quality-checks:
|
||||
runs-on: ubuntu-latest
|
||||
name: Quality Checks
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: "1.3.13"
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Typecheck
|
||||
run: |
|
||||
bun run build:sdk
|
||||
bun run -F @cline/cli build
|
||||
bun run types
|
||||
|
||||
- name: Lint & Format
|
||||
run: bun run lint
|
||||
|
||||
test:
|
||||
needs: quality-checks
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
node-version: "24.x"
|
||||
- os: windows-latest
|
||||
node-version: "24.x"
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: Test (${{ matrix.os }}, Node ${{ matrix.node-version }})
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: "1.3.13"
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build SDK
|
||||
id: build_sdk_step
|
||||
run: bun run build:sdk
|
||||
|
||||
- name: Build CLI
|
||||
id: build_cli_step
|
||||
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' }}
|
||||
run: bun -F @cline/cli build
|
||||
|
||||
- name: Run Tests
|
||||
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' && steps.build_cli_step.outcome == 'success' && matrix.os != 'windows-latest' }}
|
||||
run: bun run test
|
||||
|
||||
- name: Run SDK Tests (Windows)
|
||||
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' && steps.build_cli_step.outcome == 'success' && matrix.os == 'windows-latest' }}
|
||||
run: bun -F './packages/**' test
|
||||
|
||||
- name: Smoke test SQLite under Node
|
||||
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' && matrix.os != 'windows-latest' }}
|
||||
timeout-minutes: 10
|
||||
run: bun scripts/ci-node-smoke.ts
|
||||
|
||||
- name: Run TUI e2e tests
|
||||
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' && steps.build_cli_step.outcome == 'success' && matrix.os == 'ubuntu-latest' && matrix.node-version == '24.x' }}
|
||||
run: bun -F @cline/cli test:e2e:cli:tui
|
||||
|
||||
- name: Verify packages are publishable
|
||||
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' && steps.build_cli_step.outcome == 'success' && matrix.os == 'ubuntu-latest' && matrix.node-version == '24.x' }}
|
||||
run: bun scripts/check-publish.ts
|
||||
@@ -13,6 +13,8 @@ on:
|
||||
# Set default permissions for all jobs
|
||||
permissions:
|
||||
contents: read # Needed to check out code
|
||||
checks: write # Needed to report test results
|
||||
pull-requests: write # Needed to add comments/annotations to PRs
|
||||
|
||||
jobs:
|
||||
quality-checks:
|
||||
|
||||
@@ -56,7 +56,3 @@ evals/smoke-tests/results/
|
||||
secrets.json
|
||||
tui-traces
|
||||
tests/**/cache
|
||||
|
||||
# Backup created by scripts/marketplace-readme.mjs while publishing.
|
||||
# Should never be committed: only exists if a publish aborts mid-swap.
|
||||
.README.github.bak
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { defineConfig } from "@vscode/test-cli"
|
||||
import path from "path"
|
||||
|
||||
const vscodeTestVersion = process.env.VSCODE_TEST_VERSION ?? "stable"
|
||||
|
||||
export default defineConfig({
|
||||
|
||||
@@ -25,15 +25,6 @@ eslint-rules/**
|
||||
# cli
|
||||
cli/**
|
||||
|
||||
# sdk (separate monorepo with its own build/release pipeline)
|
||||
sdk/**
|
||||
|
||||
# Source-of-truth for the marketplace README (the .vsix only ever sees the
|
||||
# README.md that scripts/marketplace-readme.mjs swaps into place). The backup
|
||||
# only exists if a publish aborts mid-swap; neither should ship in the .vsix.
|
||||
README.marketplace.md
|
||||
.README.github.bak
|
||||
|
||||
# Custom
|
||||
**/demo.gif
|
||||
.nvmrc
|
||||
|
||||
+6
-5
@@ -42,14 +42,15 @@ We also welcome contributions to our [documentation](https://github.com/cline/cl
|
||||
```bash
|
||||
code cline
|
||||
```
|
||||
3. Install [bun](https://bun.com)
|
||||
4. Install the necessary dependencies for the extension and webview-gui:
|
||||
3. Install the necessary dependencies for the extension and webview-gui:
|
||||
```bash
|
||||
npm run install:all
|
||||
cd sdk && bun run build && cd ..
|
||||
```
|
||||
5. Generate Protocol Buffer files (required before first build):
|
||||
6. Launch by pressing `F5` (or `Run`->`Start Debugging`) to open a new VSCode window with the extension loaded. (You may need to install the [esbuild problem matchers extension](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers) if you run into issues building the project.)
|
||||
4. Generate Protocol Buffer files (required before first build):
|
||||
```bash
|
||||
npm run protos
|
||||
```
|
||||
5. Launch by pressing `F5` (or `Run`->`Start Debugging`) to open a new VSCode window with the extension loaded. (You may need to install the [esbuild problem matchers extension](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers) if you run into issues building the project.)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
<div align="center"><sub>
|
||||
English | <a href="https://github.com/cline/cline/blob/main/locales/es/README.md" target="_blank">Español</a> | <a href="https://github.com/cline/cline/blob/main/locales/de/README.md" target="_blank">Deutsch</a> | <a href="https://github.com/cline/cline/blob/main/locales/ja/README.md" target="_blank">日本語</a> | <a href="https://github.com/cline/cline/blob/main/locales/zh-cn/README.md" target="_blank">简体中文</a> | <a href="https://github.com/cline/cline/blob/main/locales/zh-tw/README.md" target="_blank">繁體中文</a> | <a href="https://github.com/cline/cline/blob/main/locales/ko/README.md" target="_blank">한국어</a>
|
||||
</sub></div>
|
||||
|
||||
# Cline
|
||||
<div align="center">
|
||||
<table>
|
||||
<tbody>
|
||||
<td align="center">
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev" target="_blank"><strong>Download on VS Marketplace</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://discord.gg/cline" target="_blank"><strong>Discord</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://www.reddit.com/r/cline/" target="_blank"><strong>r/cline</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop" target="_blank"><strong>Feature Requests</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://docs.cline.bot/getting-started/for-new-coders" target="_blank"><strong>Getting Started</strong></a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Meet Cline, an AI assistant that can use your **CLI** a**N**d **E**ditor.
|
||||
|
||||
Thanks to [Claude Sonnet's agentic coding capabilities](https://www.anthropic.com/claude/sonnet), Cline can handle complex software development tasks step-by-step. With tools that let him create & edit files, explore large projects, use the browser, and execute terminal commands (after you grant permission), he can assist you in ways that go beyond code completion or tech support. Cline can even use the Model Context Protocol (MCP) to create new tools and extend his own capabilities. While autonomous AI scripts traditionally run in sandboxed environments, this extension provides a human-in-the-loop GUI to approve every file change and terminal command, providing a safe and accessible way to explore the potential of agentic AI.
|
||||
|
||||
1. Enter your task and add images to convert mockups into functional apps or fix bugs with screenshots.
|
||||
2. Cline starts by analyzing your file structure & source code ASTs, running regex searches, and reading relevant files to get up to speed in existing projects. By carefully managing what information is added to context, Cline can provide valuable assistance even for large, complex projects without overwhelming the context window.
|
||||
3. Once Cline has the information he needs, he can:
|
||||
- Create and edit files + monitor linter/compiler errors along the way, letting him proactively fix issues like missing imports and syntax errors on his own.
|
||||
- Execute commands directly in your terminal and monitor their output as he works, letting him e.g., react to dev server issues after editing a file.
|
||||
- For web development tasks, Cline can launch the site in a headless browser, click, type, scroll, and capture screenshots + console logs, allowing him to fix runtime errors and visual bugs.
|
||||
4. When a task is completed, Cline will present the result to you with a terminal command like `open -a "Google Chrome" index.html`, which you run with a click of a button.
|
||||
|
||||
> [!TIP]
|
||||
> Follow [this guide](https://docs.cline.bot/features/customization/opening-cline-in-sidebar) to open Cline on the right side of your editor. This lets you use Cline side-by-side with your file explorer, and see how he changes your workspace more clearly.
|
||||
|
||||
---
|
||||
|
||||
<img align="right" width="340" src="https://github.com/user-attachments/assets/3cf21e04-7ce9-4d22-a7b9-ba2c595e88a4">
|
||||
|
||||
### Use any API and Model
|
||||
|
||||
Cline supports API providers like OpenRouter, Anthropic, OpenAI, Google Gemini, AWS Bedrock, Azure, GCP Vertex, Cerebras and Groq. You can also configure any OpenAI compatible API, or use a local model through LM Studio/Ollama. If you're using OpenRouter, the extension fetches their latest model list, allowing you to use the newest models as soon as they're available.
|
||||
|
||||
The extension also keeps track of total tokens and API usage cost for the entire task loop and individual requests, keeping you informed of spend every step of the way.
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/81be79a8-1fdb-4028-9129-5fe055e01e76">
|
||||
|
||||
### Run Commands in Terminal
|
||||
|
||||
Thanks to the new [shell integration updates in VSCode v1.93](https://code.visualstudio.com/updates/v1_93#_terminal-shell-integration-api), Cline can execute commands directly in your terminal and receive the output. This allows him to perform a wide range of tasks, from installing packages and running build scripts to deploying applications, managing databases, and executing tests, all while adapting to your dev environment & toolchain to get the job done right.
|
||||
|
||||
For long running processes like dev servers, use the "Proceed While Running" button to let Cline continue in the task while the command runs in the background. As Cline works he’ll be notified of any new terminal output along the way, letting him react to issues that may come up, such as compile-time errors when editing files.
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="400" src="https://github.com/user-attachments/assets/c5977833-d9b8-491e-90f9-05f9cd38c588">
|
||||
|
||||
### Create and Edit Files
|
||||
|
||||
Cline can create and edit files directly in your editor, presenting you a diff view of the changes. You can edit or revert Cline's changes directly in the diff view editor, or provide feedback in chat until you're satisfied with the result. Cline also monitors linter/compiler errors (missing imports, syntax errors, etc.) so he can fix issues that come up along the way on his own.
|
||||
|
||||
All changes made by Cline are recorded in your file's Timeline, providing an easy way to track and revert modifications if needed.
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/bc2e85ba-dfeb-4fe6-9942-7cfc4703cbe5">
|
||||
|
||||
### Use the Browser
|
||||
|
||||
With Claude Sonnet's new [Computer Use](https://www.anthropic.com/news/3-5-models-and-computer-use) capability, Cline can launch a browser, click elements, type text, and scroll, capturing screenshots and console logs at each step. This allows for interactive debugging, end-to-end testing, and even general web use! This gives him autonomy to fixing visual bugs and runtime issues without you needing to handhold and copy-pasting error logs yourself.
|
||||
|
||||
Try asking Cline to "test the app", and watch as he runs a command like `npm run dev`, launches your locally running dev server in a browser, and performs a series of tests to confirm that everything works. [See a demo here.](https://x.com/sdrzn/status/1850880547825823989)
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/ac0efa14-5c1f-4c26-a42d-9d7c56f5fadd">
|
||||
|
||||
### "add a tool that..."
|
||||
|
||||
Thanks to the [Model Context Protocol](https://github.com/modelcontextprotocol), Cline can extend his capabilities through custom tools. While you can use [community-made servers](https://github.com/modelcontextprotocol/servers), Cline can instead create and install tools tailored to your specific workflow. Just ask Cline to "add a tool" and he will handle everything, from creating a new MCP server to installing it into the extension. These custom tools then become part of Cline's toolkit, ready to use in future tasks.
|
||||
|
||||
- "add a tool that fetches Jira tickets": Retrieve ticket ACs and put Cline to work
|
||||
- "add a tool that manages AWS EC2s": Check server metrics and scale instances up or down
|
||||
- "add a tool that pulls the latest PagerDuty incidents": Fetch details and ask Cline to fix bugs
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="360" src="https://github.com/user-attachments/assets/7fdf41e6-281a-4b4b-ac19-020b838b6970">
|
||||
|
||||
### Add Context
|
||||
|
||||
**`@url`:** Paste in a URL for the extension to fetch and convert to markdown, useful when you want to give Cline the latest docs
|
||||
|
||||
**`@problems`:** Add workspace errors and warnings ('Problems' panel) for Cline to fix
|
||||
|
||||
**`@file`:** Adds a file's contents so you don't have to waste API requests approving read file (+ type to search files)
|
||||
|
||||
**`@folder`:** Adds folder's files all at once to speed up your workflow even more
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/140c8606-d3bf-41b9-9a1f-4dbf0d4c90cb">
|
||||
|
||||
### Checkpoints: Compare and Restore
|
||||
|
||||
As Cline works through a task, the extension takes a snapshot of your workspace at each step. You can use the 'Compare' button to see a diff between the snapshot and your current workspace, and the 'Restore' button to roll back to that point.
|
||||
|
||||
For example, when working with a local web server, you can use 'Restore Workspace Only' to quickly test different versions of your app, then use 'Restore Task and Workspace' when you find the version you want to continue building from. This lets you safely explore different approaches without losing progress.
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
## Contributing
|
||||
|
||||
To contribute to the project, start with our [Contributing Guide](CONTRIBUTING.md) to learn the basics. You can also join our [Discord](https://discord.gg/cline) to chat with other contributors in the `#contributors` channel. If you're looking for full-time work, check out our open positions on our [careers page](https://cline.bot/join-us)!
|
||||
|
||||
## Enterprise
|
||||
|
||||
Get the same Cline experience with enterprise-grade controls: SSO (SAML/OIDC), global policies and configuration, observability with audit trails, private networking (VPC/private link), and self-hosted or on-prem deployments, and enterprise support. Learn more at our [enterprise page](https://cline.bot/enterprise) or [talk to us](https://cline.bot/contact-sales).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
[Apache 2.0 © 2026 Cline Bot Inc.](./LICENSE)
|
||||
@@ -1,218 +1,145 @@
|
||||
<p align="center">
|
||||
<img src="assets/icons/icon.png" width="80" alt="Cline" />
|
||||
</p>
|
||||
|
||||
<h1 align="center">Cline</h1>
|
||||
|
||||
<p align="center">
|
||||
Autonomous AI coding agents for your IDE, terminal, and applications.
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Discord](https://discord.gg/cline) | [Documentation](https://docs.cline.bot) | [Reddit](https://www.reddit.com/r/cline/) | [Feature Requests](https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop) | [Careers](https://cline.bot/join-us)
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div align="center"><sub>
|
||||
English | <a href="https://github.com/cline/cline/blob/main/locales/es/README.md" target="_blank">Español</a> | <a href="https://github.com/cline/cline/blob/main/locales/de/README.md" target="_blank">Deutsch</a> | <a href="https://github.com/cline/cline/blob/main/locales/ja/README.md" target="_blank">日本語</a> | <a href="https://github.com/cline/cline/blob/main/locales/zh-cn/README.md" target="_blank">简体中文</a> | <a href="https://github.com/cline/cline/blob/main/locales/zh-tw/README.md" target="_blank">繁體中文</a> | <a href="https://github.com/cline/cline/blob/main/locales/ko/README.md" target="_blank">한국어</a>
|
||||
</sub></div>
|
||||
|
||||
# Cline
|
||||
<div align="center">
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center" width="50%">
|
||||
|
||||
### CLI
|
||||
|
||||
Run Cline in your terminal.
|
||||
Interactive chat or fully headless
|
||||
for CI/CD and scripting.
|
||||
|
||||
```
|
||||
npm i -g cline
|
||||
```
|
||||
|
||||
<a href="./sdk/apps/cli/README.md">Learn more</a>
|
||||
<br><br>
|
||||
|
||||
</td>
|
||||
<td align="center" width="50%">
|
||||
|
||||
### Kanban
|
||||
|
||||
Run many agents in parallel from a
|
||||
web-based task board. Each card gets its own
|
||||
worktree, auto-commit, and dependency chains.
|
||||
|
||||
```
|
||||
npx kanban
|
||||
```
|
||||
|
||||
<a href="https://github.com/cline/kanban">Learn more</a>
|
||||
<br><br>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" width="50%">
|
||||
|
||||
### VS Code Extension
|
||||
|
||||
AI coding assistant in your editor.
|
||||
Create files, run commands, browse the web,
|
||||
and use tools with human-in-the-loop approval.
|
||||
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev">Install from VS Marketplace</a>
|
||||
<br><br>
|
||||
|
||||
</td>
|
||||
<td align="center" width="50%">
|
||||
|
||||
### JetBrains Plugin
|
||||
|
||||
The same Cline experience in IntelliJ IDEA,
|
||||
PyCharm, WebStorm, GoLand, and the rest of
|
||||
the JetBrains family.
|
||||
|
||||
<a href="https://plugins.jetbrains.com/plugin/28247-cline">Install from JetBrains Marketplace</a>
|
||||
<br><br>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
<table>
|
||||
<tr>
|
||||
<tbody>
|
||||
<td align="center">
|
||||
|
||||
### SDK
|
||||
|
||||
Build your own AI agents and integrations powered by the same engine that runs the CLI, Kanban, VS Code extension, and JetBrains plugin. Custom tools, multi-agent teams, connectors, scheduled automations, and more.
|
||||
|
||||
```
|
||||
npm install @cline/sdk
|
||||
```
|
||||
|
||||
<a href="https://docs.cline.bot/cline-sdk/overview">Documentation</a>
|
||||
<br><br>
|
||||
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev" target="_blank"><strong>Download on VS Marketplace</strong></a>
|
||||
</td>
|
||||
</tr>
|
||||
<td align="center">
|
||||
<a href="https://discord.gg/cline" target="_blank"><strong>Discord</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://www.reddit.com/r/cline/" target="_blank"><strong>r/cline</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop" target="_blank"><strong>Feature Requests</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://docs.cline.bot/getting-started/for-new-coders" target="_blank"><strong>Getting Started</strong></a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Meet Cline, an AI assistant that can use your **CLI** a**N**d **E**ditor.
|
||||
|
||||
Thanks to [Claude Sonnet's agentic coding capabilities](https://www.anthropic.com/claude/sonnet), Cline can handle complex software development tasks step-by-step. With tools that let him create & edit files, explore large projects, use the browser, and execute terminal commands (after you grant permission), he can assist you in ways that go beyond code completion or tech support. Cline can even use the Model Context Protocol (MCP) to create new tools and extend his own capabilities. While autonomous AI scripts traditionally run in sandboxed environments, this extension provides a human-in-the-loop GUI to approve every file change and terminal command, providing a safe and accessible way to explore the potential of agentic AI.
|
||||
|
||||
1. Enter your task and add images to convert mockups into functional apps or fix bugs with screenshots.
|
||||
2. Cline starts by analyzing your file structure & source code ASTs, running regex searches, and reading relevant files to get up to speed in existing projects. By carefully managing what information is added to context, Cline can provide valuable assistance even for large, complex projects without overwhelming the context window.
|
||||
3. Once Cline has the information he needs, he can:
|
||||
- Create and edit files + monitor linter/compiler errors along the way, letting him proactively fix issues like missing imports and syntax errors on his own.
|
||||
- Execute commands directly in your terminal and monitor their output as he works, letting him e.g., react to dev server issues after editing a file.
|
||||
- For web development tasks, Cline can launch the site in a headless browser, click, type, scroll, and capture screenshots + console logs, allowing him to fix runtime errors and visual bugs.
|
||||
4. When a task is completed, Cline will present the result to you with a terminal command like `open -a "Google Chrome" index.html`, which you run with a click of a button.
|
||||
|
||||
> [!TIP]
|
||||
> Follow [this guide](https://docs.cline.bot/features/customization/opening-cline-in-sidebar) to open Cline on the right side of your editor. This lets you use Cline side-by-side with your file explorer, and see how he changes your workspace more clearly.
|
||||
|
||||
---
|
||||
|
||||
## Repository Map
|
||||
<img align="right" width="340" src="https://github.com/user-attachments/assets/3cf21e04-7ce9-4d22-a7b9-ba2c595e88a4">
|
||||
|
||||
Cline ships across multiple surfaces. When you are reading about a feature below, use the applicability notes to know where it is available and these paths to find the implementation.
|
||||
### Use any API and Model
|
||||
|
||||
| Surface | What it is | Pointers |
|
||||
|---------|------------|--------------|
|
||||
| **SDK** | Node.js programmatic agent API and extension exports. | [`./sdk/`](https://github.com/cline/cline/tree/main/sdk) |
|
||||
| **CLI** | Terminal UI, headless mode, shell commands, and CLI-specific flows. | [`./sdk/apps/cli/`](https://github.com/cline/cline/tree/main/sdk/apps/cli) |
|
||||
| **VS Code Extension** | The Marketplace extension and extension host integration. | [`./`](https://github.com/cline/cline/tree/main) (WIP migrating) |
|
||||
| **JetBrains Plugin** | JetBrains-hosted client that talks to the shared agent core. | Currently we are not open-sourcing JetBrains plugins |
|
||||
| **Kanban** | Web-based multi-agent task board. | Kanban app code lives in [`cline/kanban`](https://github.com/cline/kanban). |
|
||||
| **Docs site** | Public documentation pages. | `docs/` |
|
||||
Cline supports API providers like OpenRouter, Anthropic, OpenAI, Google Gemini, AWS Bedrock, Azure, GCP Vertex, Cerebras and Groq. You can also configure any OpenAI compatible API, or use a local model through LM Studio/Ollama. If you're using OpenRouter, the extension fetches their latest model list, allowing you to use the newest models as soon as they're available.
|
||||
|
||||
## Edit Code Across All Your Codebases
|
||||
The extension also keeps track of total tokens and API usage cost for the entire task loop and individual requests, keeping you informed of spend every step of the way.
|
||||
|
||||
Cline reads your project structure, understands the relationships between files, and makes coordinated changes across your codebase. It monitors linter and compiler errors as it works, fixing issues like missing imports, type mismatches, and syntax errors before you even see them. In VS Code and JetBrains, every edit shows up as a diff you can review, modify, or revert. All changes are tracked in your file timeline.
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
## Run Commands and Act to Output
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
Cline executes commands directly in your terminal and watches the output in real time. Install packages, run build scripts, execute tests, deploy applications, manage databases. For long-running processes like dev servers, Cline continues working in the background and reacts to new output as it appears, catching compile errors, test failures, and server crashes as they happen.
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/81be79a8-1fdb-4028-9129-5fe055e01e76">
|
||||
|
||||
## Plan and Act
|
||||
### Run Commands in Terminal
|
||||
|
||||
Toggle between Plan mode and Act mode. In Plan mode, Cline explores your codebase, asks clarifying questions, and lays out a strategy. Once you're aligned, switch to Act mode and Cline executes the plan. Every file edit and terminal command requires your approval, so you stay in control of what actually changes. Or toggle auto-approve and let Cline run autonomously.
|
||||
Thanks to the new [shell integration updates in VSCode v1.93](https://code.visualstudio.com/updates/v1_93#_terminal-shell-integration-api), Cline can execute commands directly in your terminal and receive the output. This allows him to perform a wide range of tasks, from installing packages and running build scripts to deploying applications, managing databases, and executing tests, all while adapting to your dev environment & toolchain to get the job done right.
|
||||
|
||||
## Rules and Configuration
|
||||
For long running processes like dev servers, use the "Proceed While Running" button to let Cline continue in the task while the command runs in the background. As Cline works he’ll be notified of any new terminal output along the way, letting him react to issues that may come up, such as compile-time errors when editing files.
|
||||
|
||||
Define project-specific rules in `.clinerules` files that guide how Cline works in your codebase: coding standards, architecture conventions, deployment procedures, testing requirements. Rules are picked up automatically by the CLI, VS Code extension, and JetBrains plugin. Import rules from Cursor or Windsurf formats.
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
## Works With Every Major Model
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
Cline is not locked to a single AI provider. Use whichever model fits your workflow:
|
||||
<img align="right" width="400" src="https://github.com/user-attachments/assets/c5977833-d9b8-491e-90f9-05f9cd38c588">
|
||||
|
||||
| Provider | Models |
|
||||
|----------|--------|
|
||||
| Anthropic | Claude Opus, Sonnet, Haiku |
|
||||
| OpenAI | GPT series model |
|
||||
| Google | Gemini series model |
|
||||
| OpenRouter | 200+ models from any provider |
|
||||
| Vercel AI Gateway | Models through Vercel AI Gateway |
|
||||
| AWS Bedrock | Claude, Llama, and more |
|
||||
| Azure / GCP Vertex | All hosted models |
|
||||
| Cerebras / Groq | Fast inference models |
|
||||
| Ollama / LM Studio | Run local models on your machine |
|
||||
| Any OpenAI-compatible API | Self-hosted or third-party endpoints |
|
||||
### Create and Edit Files
|
||||
|
||||
## Extend With MCP Servers and Plugins
|
||||
Cline can create and edit files directly in your editor, presenting you a diff view of the changes. You can edit or revert Cline's changes directly in the diff view editor, or provide feedback in chat until you're satisfied with the result. Cline also monitors linter/compiler errors (missing imports, syntax errors, etc.) so he can fix issues that come up along the way on his own.
|
||||
|
||||
Cline's capabilities are extensible.
|
||||
1. MCP: Use [MCP servers](https://github.com/modelcontextprotocol) to connect to databases, query APIs, manage cloud infrastructure, and interact with external systems. Use [community-built servers](https://github.com/modelcontextprotocol/servers) or ask Cline to create custom tools on the fly. In the CLI, manage servers with `cline mcp`.
|
||||
2. Plugins: With the SDK, register tools and lifecycle hooks programmatically through the plugin system for logging, auditing, policy enforcement, or adding domain-specific capabilities. Simple plugin example below.
|
||||
All changes made by Cline are recorded in your file's Timeline, providing an easy way to track and revert modifications if needed.
|
||||
|
||||
```typescript
|
||||
import { Agent, createTool } from "@cline/sdk"
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
const deployTool = createTool({
|
||||
name: "deploy",
|
||||
description: "Deploy the current branch to staging.",
|
||||
inputSchema: { type: "object", properties: { env: { type: "string" } }, required: ["env"] },
|
||||
execute: async (input) => {
|
||||
// your deployment logic
|
||||
},
|
||||
})
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
const agent = new Agent({ tools: [deployTool], /* ... */ })
|
||||
```
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/bc2e85ba-dfeb-4fe6-9942-7cfc4703cbe5">
|
||||
|
||||
## Multi-Agent Teams for Cline SDK and Cline CLI
|
||||
### Use the Browser
|
||||
|
||||
Coordinate multiple agents working together on complex tasks. A coordinator agent breaks the work into subtasks and delegates to specialist agents, each with their own tools and context. Team state persists across sessions so you can pick up where you left off.
|
||||
With Claude Sonnet's new [Computer Use](https://www.anthropic.com/news/3-5-models-and-computer-use) capability, Cline can launch a browser, click elements, type text, and scroll, capturing screenshots and console logs at each step. This allows for interactive debugging, end-to-end testing, and even general web use! This gives him autonomy to fixing visual bugs and runtime issues without you needing to handhold and copy-pasting error logs yourself.
|
||||
|
||||
```bash
|
||||
cline --team-name auth-sprint "Plan and implement user authentication with tests"
|
||||
```
|
||||
## Scheduled Agents for Cline SDK and Cline CLI
|
||||
Try asking Cline to "test the app", and watch as he runs a command like `npm run dev`, launches your locally running dev server in a browser, and performs a series of tests to confirm that everything works. [See a demo here.](https://x.com/sdrzn/status/1850880547825823989)
|
||||
|
||||
Run agents on cron schedules for recurring automations. Daily PR summaries, weekly dependency checks, codebase health reports. Schedules persist across restarts and run independently of any terminal session.
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
```bash
|
||||
cline schedule create "PR summary" \
|
||||
--cron "0 9 * * MON-FRI" \
|
||||
--prompt "List all open PRs and their review status" \
|
||||
--workspace /path/to/repo
|
||||
```
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
## Connect to Slack, Telegram, Discord, and More with Cline CLI
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/ac0efa14-5c1f-4c26-a42d-9d7c56f5fadd">
|
||||
|
||||
Chat with your agent from any messaging platform. Each conversation thread maps to an agent session with full context. Set up access control to restrict who can interact with your agent.
|
||||
### "add a tool that..."
|
||||
|
||||
```bash
|
||||
cline connect telegram -m my_bot -k $BOT_TOKEN
|
||||
cline connect slack --token $SLACK_TOKEN --signing-secret $SECRET --base-url $URL
|
||||
```
|
||||
Thanks to the [Model Context Protocol](https://github.com/modelcontextprotocol), Cline can extend his capabilities through custom tools. While you can use [community-made servers](https://github.com/modelcontextprotocol/servers), Cline can instead create and install tools tailored to your specific workflow. Just ask Cline to "add a tool" and he will handle everything, from creating a new MCP server to installing it into the extension. These custom tools then become part of Cline's toolkit, ready to use in future tasks.
|
||||
|
||||
Supported platforms: Telegram, Slack, Discord, Google Chat, WhatsApp, and Linear.
|
||||
- "add a tool that fetches Jira tickets": Retrieve ticket ACs and put Cline to work
|
||||
- "add a tool that manages AWS EC2s": Check server metrics and scale instances up or down
|
||||
- "add a tool that pulls the latest PagerDuty incidents": Fetch details and ask Cline to fix bugs
|
||||
|
||||
## Headless Mode for CI/CD with Cline CLI
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
Run Cline with zero interaction for scripting and automation. Pipe input, get JSON output, chain commands, integrate into CI/CD pipelines.
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
```bash
|
||||
cline "Run tests and fix any failures"
|
||||
git diff origin/main | cline "Review these changes for issues"
|
||||
cline --json "List all TODO comments" | jq -r 'select(.type == "agent_event" and .event.text) | .event.text'
|
||||
```
|
||||
<img align="left" width="360" src="https://github.com/user-attachments/assets/7fdf41e6-281a-4b4b-ac19-020b838b6970">
|
||||
|
||||
### Add Context
|
||||
|
||||
**`@url`:** Paste in a URL for the extension to fetch and convert to markdown, useful when you want to give Cline the latest docs
|
||||
|
||||
**`@problems`:** Add workspace errors and warnings ('Problems' panel) for Cline to fix
|
||||
|
||||
**`@file`:** Adds a file's contents so you don't have to waste API requests approving read file (+ type to search files)
|
||||
|
||||
**`@folder`:** Adds folder's files all at once to speed up your workflow even more
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/140c8606-d3bf-41b9-9a1f-4dbf0d4c90cb">
|
||||
|
||||
### Checkpoints: Compare and Restore
|
||||
|
||||
As Cline works through a task, the extension takes a snapshot of your workspace at each step. You can use the 'Compare' button to see a diff between the snapshot and your current workspace, and the 'Restore' button to roll back to that point.
|
||||
|
||||
For example, when working with a local web server, you can use 'Restore Workspace Only' to quickly test different versions of your app, then use 'Restore Task and Workspace' when you find the version you want to continue building from. This lets you safely explore different approaches without losing progress.
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
## Contributing
|
||||
|
||||
Start with the [Contributing Guide](CONTRIBUTING.md). Join our [Discord](https://discord.gg/cline) and head to the `#contributors` channel to connect with other contributors. Check our [careers page](https://cline.bot/join-us) for full-time roles.
|
||||
To contribute to the project, start with our [Contributing Guide](CONTRIBUTING.md) to learn the basics. You can also join our [Discord](https://discord.gg/cline) to chat with other contributors in the `#contributors` channel. If you're looking for full-time work, check out our open positions on our [careers page](https://cline.bot/join-us)!
|
||||
|
||||
## Enterprise
|
||||
|
||||
Get the same Cline experience with enterprise-grade controls: SSO (SAML/OIDC), global policies and configuration, observability with audit trails, private networking (VPC/private link), and self-hosted or on-prem deployments, and enterprise support. Learn more at our [enterprise page](https://cline.bot/enterprise) or [talk to us](https://cline.bot/contact-sales).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -369,12 +369,6 @@ class ACPWorkspaceServiceClient implements WorkspaceServiceClientInterface {
|
||||
Logger.debug("[ACPWorkspaceServiceClient] openFolder called (stub)", { path: request.path })
|
||||
return proto.host.OpenFolderResponse.create({ success: true })
|
||||
}
|
||||
|
||||
async searchWorkspaceItems(
|
||||
_request: proto.host.SearchWorkspaceItemsRequest,
|
||||
): Promise<proto.host.SearchWorkspaceItemsResponse> {
|
||||
throw new Error("searchWorkspaceItems is not implemented on the ACP host")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -183,7 +183,6 @@ vi.mock("@shared/getApiMetrics", () => ({
|
||||
|
||||
vi.mock("child_process", () => ({
|
||||
exec: vi.fn(),
|
||||
execFile: vi.fn(),
|
||||
execSync: vi.fn(() => "main"),
|
||||
}))
|
||||
|
||||
|
||||
@@ -296,12 +296,6 @@ export class CliWorkspaceServiceClient implements WorkspaceServiceClientInterfac
|
||||
printInfo(`📂 Opening folder: ${path}`)
|
||||
return proto.host.OpenFolderResponse.create({ success: true })
|
||||
}
|
||||
|
||||
async searchWorkspaceItems(
|
||||
_request: proto.host.SearchWorkspaceItemsRequest,
|
||||
): Promise<proto.host.SearchWorkspaceItemsResponse> {
|
||||
throw new Error("searchWorkspaceItems is not implemented on the CLI host")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -94,7 +94,7 @@ The `cline.plugins` array accepts:
|
||||
| Object with `paths` array | `{ "paths": ["./src/plugin.ts"], "capabilities": ["tools"] }` |
|
||||
| Plain string | `"./index.ts"` |
|
||||
|
||||
Each path should point to a `.ts` or `.js` file that exports an `AgentPlugin` (either as the default export or a named export).
|
||||
Each path should point to a `.ts` or `.js` file that exports an `AgentExtension` (either as the default export or a named export).
|
||||
|
||||
If no `cline.plugins` field is present, the installer falls back to auto-discovery: it looks for standard entry points, then recursively scans for `.ts` and `.js` files (skipping `node_modules` and `.git`).
|
||||
|
||||
|
||||
+18
-178
@@ -185,6 +185,16 @@
|
||||
{
|
||||
"group": "Concepts",
|
||||
"pages": [
|
||||
"sdk/runtime",
|
||||
"sdk/model-providers",
|
||||
{
|
||||
"group": "Tools",
|
||||
"pages": [
|
||||
"sdk/tools",
|
||||
"sdk/guides/creating-custom-tools"
|
||||
]
|
||||
},
|
||||
"sdk/events",
|
||||
{
|
||||
"group": "Plugins",
|
||||
"pages": [
|
||||
@@ -194,17 +204,7 @@
|
||||
"sdk/plugin-examples"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Tools",
|
||||
"pages": [
|
||||
"sdk/tools",
|
||||
"sdk/guides/creating-custom-tools"
|
||||
]
|
||||
},
|
||||
"sdk/guides/scheduled-agents",
|
||||
"sdk/events",
|
||||
"sdk/model-providers",
|
||||
"sdk/runtime"
|
||||
"sdk/guides/scheduled-agents"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -458,7 +458,7 @@
|
||||
},
|
||||
{
|
||||
"source": "/getting-started/your-first-task",
|
||||
"destination": "/usage/ide"
|
||||
"destination": "/getting-started/your-first-project"
|
||||
},
|
||||
{
|
||||
"source": "/features/hooks/real-world-examples",
|
||||
@@ -626,15 +626,15 @@
|
||||
},
|
||||
{
|
||||
"source": "/model-config/model-comparison",
|
||||
"destination": "/getting-started/cline-provider"
|
||||
"destination": "/core-features/model-selection-guide"
|
||||
},
|
||||
{
|
||||
"source": "/troubleshooting/terminal-integration-guide",
|
||||
"destination": "/core-workflows/using-commands"
|
||||
"destination": "/troubleshooting/terminal-quick-fixes"
|
||||
},
|
||||
{
|
||||
"source": "/features/slash-commands/deep-planning",
|
||||
"destination": "/core-workflows/using-commands#deep-planning"
|
||||
"destination": "/features/deep-planning"
|
||||
},
|
||||
{
|
||||
"source": "/features/slash-commands/smol",
|
||||
@@ -654,7 +654,7 @@
|
||||
},
|
||||
{
|
||||
"source": "/features/focus-chain",
|
||||
"destination": "/core-workflows/using-commands#deep-planning"
|
||||
"destination": "/features/deep-planning"
|
||||
},
|
||||
{
|
||||
"source": "/features/skills",
|
||||
@@ -778,11 +778,11 @@
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/quickstart",
|
||||
"destination": "/sdk/guides/building-an-agent"
|
||||
"destination": "/sdk/examples"
|
||||
},
|
||||
{
|
||||
"source": "/sdk/quickstart",
|
||||
"destination": "/sdk/guides/building-an-agent"
|
||||
"destination": "/sdk/examples"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/examples",
|
||||
@@ -943,166 +943,6 @@
|
||||
{
|
||||
"source": "/sdk/examples",
|
||||
"destination": "/sdk/guides/building-an-agent"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/interactive-mode",
|
||||
"destination": "/usage/cli-overview"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/overview",
|
||||
"destination": "/usage/cli-overview"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/samples/overview",
|
||||
"destination": "/usage/cli-overview"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/samples/worktree-workflows",
|
||||
"destination": "/usage/cli-overview"
|
||||
},
|
||||
{
|
||||
"source": "/contributing/doc-templates",
|
||||
"destination": "/cline-overview"
|
||||
},
|
||||
{
|
||||
"source": "/contributing/documentation-guide",
|
||||
"destination": "/cline-overview"
|
||||
},
|
||||
{
|
||||
"source": "/customization/workflows",
|
||||
"destination": "/customization/cline-rules"
|
||||
},
|
||||
{
|
||||
"source": "/features/web-tools",
|
||||
"destination": "/tools-reference/all-cline-tools"
|
||||
},
|
||||
{
|
||||
"source": "/getting-started/quick-start",
|
||||
"destination": "/cline-overview"
|
||||
},
|
||||
{
|
||||
"source": "/getting-started/what-is-cline",
|
||||
"destination": "/cline-overview"
|
||||
},
|
||||
{
|
||||
"source": "/home",
|
||||
"destination": "/cline-overview"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/aihubmix",
|
||||
"destination": "/provider-config/other-30-plus-providers#aihubmix"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/asksage",
|
||||
"destination": "/provider-config/other-30-plus-providers#asksage"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/baseten",
|
||||
"destination": "/provider-config/other-30-plus-providers#baseten"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/cerebras",
|
||||
"destination": "/provider-config/other-30-plus-providers#cerebras"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/dify",
|
||||
"destination": "/provider-config/other-30-plus-providers#difyai"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/doubao",
|
||||
"destination": "/provider-config/other-30-plus-providers#doubao"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/fireworks",
|
||||
"destination": "/provider-config/other-30-plus-providers#fireworks-ai"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/gcp-vertex-ai",
|
||||
"destination": "/provider-config/other-30-plus-providers#gcp-vertex-ai"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/groq",
|
||||
"destination": "/provider-config/other-30-plus-providers#groq"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/hicap",
|
||||
"destination": "/provider-config/other-30-plus-providers#hicap"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/huawei-cloud-maas",
|
||||
"destination": "/provider-config/other-30-plus-providers#huawei-cloud-maas"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/huggingface",
|
||||
"destination": "/provider-config/other-30-plus-providers#hugging-face"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/litellm-and-cline-using-codestral",
|
||||
"destination": "/provider-config/openai-compatible"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/mistral-ai",
|
||||
"destination": "/provider-config/other-30-plus-providers#mistral"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/moonshot",
|
||||
"destination": "/provider-config/other-30-plus-providers#moonshot"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/nebius",
|
||||
"destination": "/provider-config/other-30-plus-providers#nebius-ai-studio"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/nousresearch",
|
||||
"destination": "/provider-config/other-30-plus-providers#nous-research"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/oracle-code-assist",
|
||||
"destination": "/provider-config/other-30-plus-providers#oracle-code-assist"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/qwen-code",
|
||||
"destination": "/provider-config/other-30-plus-providers#qwen-code"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/requesty",
|
||||
"destination": "/provider-config/other-30-plus-providers#requesty"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/sambanova",
|
||||
"destination": "/provider-config/other-30-plus-providers#sambanova"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/sap-aicore",
|
||||
"destination": "/provider-config/other-30-plus-providers#sap-ai-core"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/together",
|
||||
"destination": "/provider-config/other-30-plus-providers#together"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/vercel-ai-gateway",
|
||||
"destination": "/provider-config/other-30-plus-providers#vercel-ai-gateway"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/vscode-language-model-api",
|
||||
"destination": "/provider-config/other-30-plus-providers#vs-code-language-model-api"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/xai-grok",
|
||||
"destination": "/provider-config/other-30-plus-providers#xai-grok"
|
||||
},
|
||||
{
|
||||
"source": "/tools-reference/browser-automation",
|
||||
"destination": "/tools-reference/all-cline-tools"
|
||||
},
|
||||
{
|
||||
"source": "/troubleshooting/task-history-recovery",
|
||||
"destination": "/core-workflows/task-management"
|
||||
},
|
||||
{
|
||||
"source": "/troubleshooting/terminal-quick-fixes",
|
||||
"destination": "/core-workflows/using-commands"
|
||||
}
|
||||
],
|
||||
"search": {
|
||||
|
||||
@@ -297,7 +297,7 @@ Now that you understand member management, proceed with configuring your organiz
|
||||
<Card
|
||||
title="Configure Providers"
|
||||
icon="plug"
|
||||
href="/enterprise-solutions/configuration/remote-configuration/overview"
|
||||
href="/enterprise-solutions/configuration/choosing-your-deployment"
|
||||
>
|
||||
Set up API providers for your team to use
|
||||
</Card>
|
||||
|
||||
@@ -135,5 +135,5 @@ Start here: [SDK Examples](/sdk/examples)
|
||||
|
||||
## Need Help?
|
||||
|
||||
- [Troubleshooting](/troubleshooting/networking-and-proxies)
|
||||
- [Discord community](https://discord.gg/cline)
|
||||
- [Troubleshooting](/troubleshooting/terminal-quick-fixes)
|
||||
- [Discord community](https://discord.gg/cline)
|
||||
@@ -66,4 +66,5 @@ For comprehensive details on how extended thinking works, including API examples
|
||||
- **Prompt Caching:** Claude 3 models support [prompt caching](https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching), which can significantly reduce costs and latency for repeated prompts.
|
||||
- **Context Window:** Claude models have large context windows (200,000 tokens), allowing you to include a significant amount of code and context in your prompts.
|
||||
- **Pricing:** Refer to the [Anthropic Pricing](https://www.anthropic.com/pricing) page for the latest pricing information.
|
||||
- **Rate Limits:** Anthropic has strict rate limits based on [usage tiers](https://docs.anthropic.com/en/api/rate-limits#requirements-to-advance-tier). If you're repeatedly hitting rate limits, consider contacting Anthropic sales or accessing Claude through a different provider like [OpenRouter](/provider-config/openrouter) or [Requesty](/provider-config/other-30-plus-providers#requesty).
|
||||
- **Rate Limits:** Anthropic has strict rate limits based on [usage tiers](https://docs.anthropic.com/en/api/rate-limits#requirements-to-advance-tier). If you're repeatedly hitting rate limits, consider contacting Anthropic sales or accessing Claude through a different provider like [OpenRouter](/provider-config/openrouter) or [Requesty](/provider-config/requesty).
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Your application / CLI / VS Code / JetBrains
|
||||
Sessions, storage, built-in tools, hub, automation, telemetry
|
||||
│
|
||||
├── @cline/agents
|
||||
│ Browser-compatible AgentRuntime / Agent loop
|
||||
│ Browser-safe AgentRuntime / Agent loop
|
||||
│
|
||||
├── @cline/llms
|
||||
│ Provider handlers, gateway, model catalogs
|
||||
@@ -27,53 +27,24 @@ Sessions, storage, built-in tools, hub, automation, telemetry
|
||||
|
||||
## Packages
|
||||
|
||||
### @cline/core
|
||||
### @cline/shared
|
||||
|
||||
Node runtime/orchestration layer.
|
||||
Foundation package for shared contracts and utilities.
|
||||
|
||||
Key exports include:
|
||||
|
||||
| Export | Description |
|
||||
|--------|-------------|
|
||||
| `ClineCore` | Main runtime entry point |
|
||||
| `ClineCoreOptions` | Constructor options |
|
||||
| `ClineCoreStartInput` | Session start input |
|
||||
| `CoreSessionConfig` | Session configuration |
|
||||
| `SessionRecord` | Persisted session metadata |
|
||||
| `AgentPlugin` | Public plugin type |
|
||||
| `createTool` | Re-export from shared |
|
||||
| `createTool` | Helper for creating typed tools |
|
||||
| `Tool`, `ToolContext`, `ToolPolicy` | Tool interfaces |
|
||||
| `AgentEvent`, `AgentResult`, `AgentConfig` | Host-facing agent types |
|
||||
| `AgentRuntimeEvent`, `AgentRunResult` | Runtime-facing agent types |
|
||||
| `HookEngine`, `HookStage`, `HookPolicies` | Hook contracts and engine |
|
||||
| `ContributionRegistry`, `AgentExtensionApi` | Extension registration contracts |
|
||||
| `ModelInfo`, `Message`, `ContentBlock` | Model/message types |
|
||||
| `BasicLogger`, `noopBasicLogger` | Logging contracts |
|
||||
|
||||
Capabilities include:
|
||||
|
||||
- local/hub/remote runtime backends
|
||||
- session manifests and message artifacts
|
||||
- built-in tools
|
||||
- tool approvals
|
||||
- automation/scheduling services
|
||||
- telemetry hooks
|
||||
- plugin/extension loading
|
||||
- team/sub-agent tools
|
||||
|
||||
Depends on: `@cline/shared`, `@cline/llms`, `@cline/agents`.
|
||||
|
||||
### @cline/agents
|
||||
|
||||
Browser-compatible agent execution loop.
|
||||
|
||||
Key exports include:
|
||||
|
||||
| Export | Description |
|
||||
|--------|-------------|
|
||||
| `AgentRuntime` | Core runtime class |
|
||||
| `Agent` | Alias for `AgentRuntime` |
|
||||
| `createAgentRuntime`, `createAgent` | Factory functions |
|
||||
| `AgentRuntimeConfig` | Constructor config union |
|
||||
| `AgentRunInput`, `AgentEventListener` | Runtime helper types |
|
||||
| `createTool` | Re-export from `@cline/shared` |
|
||||
|
||||
Methods on `AgentRuntime` include `run`, `continue`, `abort`, `subscribe`, `restore`, and `snapshot`.
|
||||
|
||||
Depends on: `@cline/shared`, `@cline/llms`.
|
||||
No higher-layer dependencies.
|
||||
|
||||
### @cline/llms
|
||||
|
||||
@@ -91,24 +62,53 @@ Key exports include:
|
||||
|
||||
Depends on: `@cline/shared`.
|
||||
|
||||
### @cline/shared
|
||||
### @cline/agents
|
||||
|
||||
Foundation package for shared contracts and utilities.
|
||||
Browser-safe agent execution loop.
|
||||
|
||||
Key exports include:
|
||||
|
||||
| Export | Description |
|
||||
|--------|-------------|
|
||||
| `createTool` | Helper for creating typed tools |
|
||||
| `AgentTool`, `AgentToolContext`, `ToolPolicy` | Tool interfaces |
|
||||
| `AgentEvent`, `AgentResult`, `AgentConfig` | Host-facing agent types |
|
||||
| `AgentRuntimeEvent`, `AgentRunResult` | Runtime-facing agent types |
|
||||
| `HookEngine`, `HookStage`, `HookPolicies` | Hook contracts and engine |
|
||||
| `ContributionRegistry`, `AgentExtensionApi` | Extension registration contracts |
|
||||
| `ModelInfo`, `Message`, `ContentBlock` | Model/message types |
|
||||
| `BasicLogger`, `noopBasicLogger` | Logging contracts |
|
||||
| `AgentRuntime` | Core runtime class |
|
||||
| `Agent` | Alias for `AgentRuntime` |
|
||||
| `createAgentRuntime`, `createAgent` | Factory functions |
|
||||
| `AgentRuntimeConfig` | Constructor config union |
|
||||
| `AgentRunInput`, `AgentEventListener` | Runtime helper types |
|
||||
| `createTool` | Re-export from `@cline/shared` |
|
||||
|
||||
No higher-layer dependencies.
|
||||
Methods on `AgentRuntime` include `run`, `continue`, `abort`, `subscribe`, `restore`, and `snapshot`.
|
||||
|
||||
Depends on: `@cline/shared`, `@cline/llms`.
|
||||
|
||||
### @cline/core
|
||||
|
||||
Node runtime/orchestration layer.
|
||||
|
||||
Key exports include:
|
||||
|
||||
| Export | Description |
|
||||
|--------|-------------|
|
||||
| `ClineCore` | Main runtime entry point |
|
||||
| `ClineCoreOptions` | Constructor options |
|
||||
| `ClineCoreStartInput` | Session start input |
|
||||
| `CoreSessionConfig` | Session configuration |
|
||||
| `SessionRecord` | Persisted session metadata |
|
||||
| `AgentPlugin` | Public alias for `AgentExtension` |
|
||||
| `createTool` | Re-export from shared |
|
||||
|
||||
Capabilities include:
|
||||
|
||||
- local/hub/remote runtime backends
|
||||
- session manifests and message artifacts
|
||||
- built-in tools
|
||||
- tool approvals
|
||||
- automation/scheduling services
|
||||
- telemetry hooks
|
||||
- plugin/extension loading
|
||||
- team/sub-agent tools
|
||||
|
||||
Depends on: `@cline/shared`, `@cline/llms`, `@cline/agents`.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -124,9 +124,9 @@ npm install @cline/sdk
|
||||
|
||||
Dependencies flow downward only. Lower layers stay embeddable without pulling in the full runtime.
|
||||
|
||||
### Browser-compatible agent loop
|
||||
### Browser-safe agent loop
|
||||
|
||||
`@cline/agents` exposes a browser-compatible runtime. It does not own session storage, built-in file/shell tools, hub transports, or Node-specific orchestration.
|
||||
`@cline/agents` exposes a browser-safe runtime. It does not own session storage, built-in file/shell tools, hub transports, or Node-specific orchestration.
|
||||
|
||||
### Core as orchestration layer
|
||||
|
||||
|
||||
+4
-4
@@ -16,7 +16,7 @@ Use this page for event handling patterns. For event shapes, see [Events referen
|
||||
```typescript
|
||||
const unsubscribe = agent.subscribe((event) => {
|
||||
if (event.type === "assistant-text-delta") {
|
||||
process.stdout.write(event.text ?? "")
|
||||
process.stdout.write(event.text)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -24,7 +24,7 @@ await agent.run("Explain this codebase")
|
||||
unsubscribe()
|
||||
```
|
||||
|
||||
`AgentRuntimeEvent` is the low-level event stream from the browser-compatible runtime.
|
||||
`AgentRuntimeEvent` is the low-level event stream from the browser-safe runtime.
|
||||
|
||||
## Core / Host-Facing Agent Events
|
||||
|
||||
@@ -67,7 +67,7 @@ Subscribe to events to build real-time UIs:
|
||||
agent.subscribe((event) => {
|
||||
switch (event.type) {
|
||||
case "assistant-text-delta":
|
||||
onUpdate({ type: "text", content: event.text ?? "" })
|
||||
onUpdate({ type: "text", content: event.text })
|
||||
break
|
||||
case "tool-started":
|
||||
onUpdate({ type: "tool_start", content: event.toolCall.toolName })
|
||||
@@ -82,7 +82,7 @@ agent.subscribe((event) => {
|
||||
})
|
||||
```
|
||||
|
||||
For a complete working example of streaming agent events to a browser via SSE, see the [multi-agent example](https://github.com/cline/cline/tree/main/sdk/apps/examples/multi-agent). It spawns multiple agents in parallel and streams each agent's events to separate UI cards.
|
||||
For a complete working example of streaming agent events to a browser via SSE, see the [multi-agent example](https://github.com/cline/sdk/tree/main/apps/examples/multi-agent). It spawns multiple agents in parallel and streams each agent's events to separate UI cards.
|
||||
|
||||
## Usage Tracking Pattern
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ sidebarTitle: "Examples"
|
||||
description: "Explore complete, runnable SDK examples organized by difficulty."
|
||||
---
|
||||
|
||||
Working examples are available in the [SDK repository](https://github.com/cline/cline/tree/main/sdk/apps/examples), organized by difficulty:
|
||||
Working examples are available in the [SDK repository](https://github.com/cline/sdk/tree/main/apps/examples), organized by difficulty:
|
||||
|
||||
| Example | Difficulty | Description |
|
||||
|---------|------------|-------------|
|
||||
| [quickstart](https://github.com/cline/cline/tree/main/sdk/apps/examples/quickstart) | Beginner | Send one prompt, stream the response (~15 lines) |
|
||||
| [cli-agent](https://github.com/cline/cline/tree/main/sdk/apps/examples/cli-agent) | Beginner | Interactive terminal chat with a shell tool |
|
||||
| [code-review-bot](https://github.com/cline/cline/tree/main/sdk/apps/examples/code-review-bot) | Intermediate | AI code reviewer with custom tools and structured output |
|
||||
| [multi-agent](https://github.com/cline/cline/tree/main/sdk/apps/examples/multi-agent) | Advanced | Parallel agents with streaming web UI |
|
||||
| [desktop-app](https://github.com/cline/cline/tree/main/sdk/apps/examples/desktop-app) | Advanced | Full Tauri + Next.js desktop app |
|
||||
| [quickstart](https://github.com/cline/sdk/tree/main/apps/examples/quickstart) | Beginner | Send one prompt, stream the response (~15 lines) |
|
||||
| [cli-agent](https://github.com/cline/sdk/tree/main/apps/examples/cli-agent) | Beginner | Interactive terminal chat with a shell tool |
|
||||
| [code-review-bot](https://github.com/cline/sdk/tree/main/apps/examples/code-review-bot) | Intermediate | AI code reviewer with custom tools and structured output |
|
||||
| [multi-agent](https://github.com/cline/sdk/tree/main/apps/examples/multi-agent) | Advanced | Parallel agents with streaming web UI |
|
||||
| [desktop-app](https://github.com/cline/sdk/tree/main/apps/examples/desktop-app) | Advanced | Full Tauri + Next.js desktop app |
|
||||
|
||||
@@ -4,7 +4,7 @@ sidebarTitle: "Building an Agent"
|
||||
description: "Walk through a complete code review bot that reads diffs, analyzes code, and produces structured feedback."
|
||||
---
|
||||
|
||||
This tutorial walks through the [code-review-bot example](https://github.com/cline/cline/tree/main/sdk/apps/examples/code-review-bot) from the SDK repository. By the end, you'll understand how to combine custom tools, system prompts, completion lifecycle, and event streaming into a real application.
|
||||
This tutorial walks through the [code-review-bot example](https://github.com/cline/sdk/tree/main/apps/examples/code-review-bot) from the SDK repository. By the end, you'll understand how to combine custom tools, system prompts, completion lifecycle, and event streaming into a real application.
|
||||
|
||||
## What It Builds
|
||||
|
||||
@@ -23,12 +23,12 @@ A code review agent that:
|
||||
## Get the Code
|
||||
|
||||
```bash
|
||||
git clone https://github.com/cline/cline.git
|
||||
cd cline/sdk/apps/examples/code-review-bot
|
||||
git clone https://github.com/cline/sdk.git
|
||||
cd sdk/apps/examples/code-review-bot
|
||||
bun install
|
||||
```
|
||||
|
||||
Or read along with the [source on GitHub](https://github.com/cline/cline/blob/main/sdk/apps/examples/code-review-bot/src/index.ts).
|
||||
Or read along with the [source on GitHub](https://github.com/cline/sdk/blob/main/apps/examples/code-review-bot/src/index.ts).
|
||||
|
||||
## How It Works
|
||||
|
||||
@@ -106,7 +106,7 @@ The bot subscribes to events to show progress as the agent works:
|
||||
agent.subscribe((event) => {
|
||||
switch (event.type) {
|
||||
case "assistant-text-delta":
|
||||
process.stdout.write(event.text ?? "")
|
||||
process.stdout.write(event.text)
|
||||
break
|
||||
case "tool-started":
|
||||
if (event.toolCall.toolName === "add_review_comment") {
|
||||
@@ -153,10 +153,10 @@ From here, you could:
|
||||
## More Examples
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="CLI Agent" icon="terminal" href="https://github.com/cline/cline/tree/main/sdk/apps/examples/cli-agent">
|
||||
<Card title="CLI Agent" icon="terminal" href="https://github.com/cline/sdk/tree/main/apps/examples/cli-agent">
|
||||
Interactive terminal chat with tools and multi-turn conversation.
|
||||
</Card>
|
||||
<Card title="Multi-Agent" icon="users" href="https://github.com/cline/cline/tree/main/sdk/apps/examples/multi-agent">
|
||||
<Card title="Multi-Agent" icon="users" href="https://github.com/cline/sdk/tree/main/apps/examples/multi-agent">
|
||||
Parallel agents streaming to a web UI.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -34,7 +34,7 @@ const getCurrentTime = createTool({
|
||||
|
||||
The SDK converts the zod schema to JSON Schema automatically. Input is fully typed in the `execute` function.
|
||||
|
||||
For working examples of tools in real agents, see the [cli-agent](https://github.com/cline/cline/tree/main/sdk/apps/examples/cli-agent) (shell tool with zod) and [code-review-bot](https://github.com/cline/cline/tree/main/sdk/apps/examples/code-review-bot) (multiple tools with completion lifecycle).
|
||||
For working examples of tools in real agents, see the [cli-agent](https://github.com/cline/sdk/tree/main/apps/examples/cli-agent) (shell tool with zod) and [code-review-bot](https://github.com/cline/sdk/tree/main/apps/examples/code-review-bot) (multiple tools with completion lifecycle).
|
||||
|
||||
## Anatomy of a Tool
|
||||
|
||||
@@ -86,7 +86,7 @@ inputSchema: z.object({
|
||||
|
||||
Use `z.enum` for fields with a fixed set of values. This dramatically improves accuracy.
|
||||
|
||||
## Using AgentToolContext
|
||||
## Using ToolContext
|
||||
|
||||
The `execute` function receives a context object with execution metadata:
|
||||
|
||||
@@ -166,7 +166,7 @@ const submitResult = createTool({
|
||||
})
|
||||
```
|
||||
|
||||
See the [code-review-bot example](https://github.com/cline/cline/tree/main/sdk/apps/examples/code-review-bot) for this pattern in a complete application.
|
||||
See the [code-review-bot example](https://github.com/cline/sdk/tree/main/apps/examples/code-review-bot) for this pattern in a complete application.
|
||||
|
||||
## Testing Tools
|
||||
|
||||
@@ -197,18 +197,7 @@ describe("get_current_time", () => {
|
||||
## Registering Tools
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Cline Core">
|
||||
```typescript
|
||||
await cline.start({
|
||||
prompt: "Get the current time",
|
||||
config: {
|
||||
// ...
|
||||
extraTools: [getCurrentTime],
|
||||
},
|
||||
})
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="Agent">
|
||||
<Tab title="Direct">
|
||||
```typescript
|
||||
const agent = new Agent({
|
||||
tools: [searchDatabase, getCurrentTime],
|
||||
@@ -216,9 +205,9 @@ describe("get_current_time", () => {
|
||||
})
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="Via Plugin">
|
||||
<Tab title="Via Extension">
|
||||
```typescript
|
||||
const myPlugin: AgentPlugin = {
|
||||
const myPlugin: AgentExtension = {
|
||||
name: "my-tools",
|
||||
manifest: { capabilities: ["tools"] },
|
||||
setup(api) {
|
||||
@@ -229,14 +218,3 @@ describe("get_current_time", () => {
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Tool Design Rules
|
||||
|
||||
Good tools are specific and predictable.
|
||||
|
||||
- Use action-oriented names: `get_pull_request`, `search_database`, `deploy_service`.
|
||||
- Describe what the tool does, when to use it, and what it returns.
|
||||
- Put constraints in the description: rate limits, read-only behavior, required permissions.
|
||||
- Add descriptions for every input property.
|
||||
- Return structured JSON instead of prose when possible.
|
||||
- Respect `context.abortSignal` in long-running tools.
|
||||
|
||||
@@ -77,7 +77,7 @@ Events emitted include:
|
||||
### Custom Metrics via Plugins
|
||||
|
||||
```typescript
|
||||
const productionMetrics: AgentPlugin = {
|
||||
const productionMetrics: AgentExtension = {
|
||||
name: "production-metrics",
|
||||
manifest: { capabilities: ["hooks"] },
|
||||
|
||||
@@ -145,41 +145,18 @@ const agent = new Agent({
|
||||
### Track Spending
|
||||
|
||||
```typescript
|
||||
type ModelPricing = {
|
||||
inputPerMillion: number
|
||||
outputPerMillion: number
|
||||
}
|
||||
|
||||
function estimateCost(
|
||||
usage: { inputTokens: number; outputTokens: number; totalCost?: number },
|
||||
pricing: ModelPricing,
|
||||
) {
|
||||
if (usage.totalCost != null) {
|
||||
return usage.totalCost
|
||||
}
|
||||
|
||||
return (
|
||||
(usage.inputTokens / 1_000_000) * pricing.inputPerMillion +
|
||||
(usage.outputTokens / 1_000_000) * pricing.outputPerMillion
|
||||
)
|
||||
}
|
||||
|
||||
let sessionCost = 0
|
||||
|
||||
const providerId = "anthropic"
|
||||
const modelId = "claude-sonnet-4-6"
|
||||
// Load current USD-per-million-token pricing from configuration or a pricing service.
|
||||
const pricing = loadModelPricing(providerId, modelId)
|
||||
|
||||
const agent = new Agent({
|
||||
providerId,
|
||||
modelId,
|
||||
// ...
|
||||
// ...config
|
||||
})
|
||||
|
||||
agent.subscribe((event) => {
|
||||
if (event.type === "usage-updated") {
|
||||
sessionCost = estimateCost(event.usage, pricing)
|
||||
const turnCost =
|
||||
(event.usage.inputTokens * 3) / 1_000_000 +
|
||||
(event.usage.outputTokens * 15) / 1_000_000
|
||||
sessionCost = turnCost
|
||||
|
||||
if (sessionCost > 1.0) {
|
||||
agent.abort("Cost limit exceeded ($1.00)")
|
||||
|
||||
@@ -23,7 +23,6 @@ const session = await cline.start({
|
||||
apiKey: process.env.ANTHROPIC_API_KEY,
|
||||
systemPrompt: "You are a coordinator for a multi-agent coding team.",
|
||||
cwd: "/path/to/project",
|
||||
workspaceRoot: "/path/to/project",
|
||||
enableTools: true,
|
||||
enableSpawnAgent: true,
|
||||
enableAgentTeams: true,
|
||||
|
||||
@@ -61,9 +61,7 @@ const session = await cline.start({
|
||||
search_codebase: { autoApprove: true },
|
||||
fetch_web_content: { autoApprove: true },
|
||||
},
|
||||
capabilities: {
|
||||
requestToolApproval: async () => ({ approved: true }),
|
||||
},
|
||||
requestToolApproval: async () => ({ approved: true }),
|
||||
// ...
|
||||
})
|
||||
```
|
||||
@@ -85,14 +83,12 @@ const ask = (q: string) => new Promise<string>((res) => rl.question(q, res))
|
||||
|
||||
const cline = await ClineCore.create({
|
||||
clientName: "interactive-app",
|
||||
capabilities: {
|
||||
requestToolApproval: async (request) => {
|
||||
console.log(`\nTool: ${request.toolName}`)
|
||||
console.log(`Input: ${JSON.stringify(request.input, null, 2)}`)
|
||||
requestToolApproval: async (request) => {
|
||||
console.log(`\nTool: ${request.toolName}`)
|
||||
console.log(`Input: ${JSON.stringify(request.input, null, 2)}`)
|
||||
|
||||
const answer = await ask("Approve? (y/n): ")
|
||||
return { approved: answer.toLowerCase() === "y" }
|
||||
},
|
||||
const answer = await ask("Approve? (y/n): ")
|
||||
return { approved: answer.toLowerCase() === "y" }
|
||||
},
|
||||
})
|
||||
```
|
||||
@@ -122,30 +118,28 @@ Approve based on what the tool is actually doing, not just which tool it is:
|
||||
```typescript
|
||||
const cline = await ClineCore.create({
|
||||
clientName: "smart-approval",
|
||||
capabilities: {
|
||||
requestToolApproval: async (request) => {
|
||||
// Auto-approve non-destructive shell commands
|
||||
if (request.toolName === "run_commands") {
|
||||
const cmd = JSON.stringify(request.input)
|
||||
const safeCommands = ["ls", "cat", "grep", "find", "git status", "git log", "git diff"]
|
||||
if (safeCommands.some((safe) => cmd.startsWith(safe))) {
|
||||
return { approved: true }
|
||||
}
|
||||
requestToolApproval: async (request) => {
|
||||
// Auto-approve non-destructive shell commands
|
||||
if (request.toolName === "run_commands") {
|
||||
const cmd = JSON.stringify(request.input)
|
||||
const safeCommands = ["ls", "cat", "grep", "find", "git status", "git log", "git diff"]
|
||||
if (safeCommands.some((safe) => cmd.startsWith(safe))) {
|
||||
return { approved: true }
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-approve reads to specific directories
|
||||
if (request.toolName === "read_files") {
|
||||
const path = request.input.path as string
|
||||
if (path.startsWith("/src/") || path.startsWith("/tests/")) {
|
||||
return { approved: true }
|
||||
}
|
||||
// Auto-approve reads to specific directories
|
||||
if (request.toolName === "read_files") {
|
||||
const path = request.input.path as string
|
||||
if (path.startsWith("/src/") || path.startsWith("/tests/")) {
|
||||
return { approved: true }
|
||||
}
|
||||
}
|
||||
|
||||
// Everything else requires manual approval
|
||||
console.log(`Approval needed: ${request.toolName}`)
|
||||
console.log(`Input: ${JSON.stringify(request.input)}`)
|
||||
return { approved: false }
|
||||
},
|
||||
// Everything else requires manual approval
|
||||
console.log(`Approval needed: ${request.toolName}`)
|
||||
console.log(`Input: ${JSON.stringify(request.input)}`)
|
||||
return { approved: false }
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
@@ -4,35 +4,20 @@ sidebarTitle: "Scheduled Agents"
|
||||
description: "Run agents on cron schedules for recurring automations like daily summaries, code reviews, and maintenance tasks."
|
||||
---
|
||||
|
||||
The SDK supports running agents on cron schedules. Scheduled agents persist across process restarts and run independently of any client application.
|
||||
The SDK supports running agents on cron schedules through the hub. Scheduled agents persist across process restarts and run independently of any client application.
|
||||
|
||||
## How Scheduling Works
|
||||
|
||||
Scheduled agents rely on the [hub-spoke architecture](/sdk/architecture/hub-spoke):
|
||||
|
||||
1. You define a schedule (cron expression + prompt + config)
|
||||
2. The SDK stores the schedule and manages execution
|
||||
3. At each trigger time a new session is created and the agent is run
|
||||
2. The hub stores the schedule and manages execution
|
||||
3. At each trigger time, the hub creates a new session and runs the agent
|
||||
4. Results are stored and can be routed to connectors (Slack, email, etc.)
|
||||
|
||||
Scheduled agents rely on the [hub-spoke architecture](/sdk/architecture/hub-spoke) that is part of `ClineCore`. The hub runs as a background process on your machine. It starts automatically when needed and persists schedules across restarts.
|
||||
The hub runs as a background process on your machine. It starts automatically when needed and persists schedules across restarts.
|
||||
|
||||
## Creating Schedules Programmatically with Cline SDK
|
||||
|
||||
```typescript
|
||||
import { ClineCore } from "@cline/sdk"
|
||||
|
||||
const cline = await ClineCore.create({
|
||||
clientName: "scheduler",
|
||||
automation: true,
|
||||
})
|
||||
|
||||
await cline.automation.start()
|
||||
|
||||
// Use cline.automation to reconcile specs, ingest events, and list runs.
|
||||
```
|
||||
|
||||
## Schedule Wizard with Cline CLI
|
||||
|
||||
An easy way to schedule task is to use Cline CLI for scheduling task, if you've already installed via `npm i -g cline`
|
||||
## Schedule Wizard
|
||||
|
||||
Run `cline schedule` to open an interactive menu for creating and managing schedules, browsing execution history, and viewing performance statistics.
|
||||
|
||||
@@ -80,6 +65,21 @@ cline schedule delete <schedule-id>
|
||||
cline schedule executions <schedule-id>
|
||||
```
|
||||
|
||||
## Creating Schedules Programmatically
|
||||
|
||||
```typescript
|
||||
import { ClineCore } from "@cline/sdk"
|
||||
|
||||
const cline = await ClineCore.create({
|
||||
clientName: "scheduler",
|
||||
automation: true,
|
||||
})
|
||||
|
||||
await cline.automation.start()
|
||||
|
||||
// Use cline.automation to reconcile specs, ingest events, and list runs.
|
||||
```
|
||||
|
||||
## Cron Expression Reference
|
||||
|
||||
| Expression | Schedule |
|
||||
@@ -130,7 +130,7 @@ The scheduler enforces limits to prevent resource exhaustion:
|
||||
|
||||
## Routing Results
|
||||
|
||||
Combine scheduled agents with [connectors](/cli/connectors) in CLI to route results to messaging platforms:
|
||||
Combine scheduled agents with [connectors](/cli/connectors) to route results to messaging platforms:
|
||||
|
||||
```bash
|
||||
# Start a Telegram connector
|
||||
|
||||
@@ -17,7 +17,7 @@ A GitHub integration plugin that:
|
||||
|
||||
```typescript
|
||||
// github-plugin.ts
|
||||
import { type AgentPlugin } from "@cline/sdk"
|
||||
import { type AgentExtension } from "@cline/sdk"
|
||||
import { createTool } from "@cline/sdk"
|
||||
|
||||
interface GitHubConfig {
|
||||
@@ -26,7 +26,7 @@ interface GitHubConfig {
|
||||
repo: string
|
||||
}
|
||||
|
||||
export function createGitHubPlugin(config: GitHubConfig): AgentPlugin {
|
||||
export function createGitHubPlugin(config: GitHubConfig): AgentExtension {
|
||||
let totalTokens = 0
|
||||
|
||||
return {
|
||||
@@ -215,9 +215,9 @@ To load this plugin from a file in ClineCore, pass its path in `pluginPaths`:
|
||||
|
||||
```typescript
|
||||
// /absolute/path/to/github.ts
|
||||
import { type AgentPlugin, createTool } from "@cline/sdk"
|
||||
import { type AgentExtension, createTool } from "@cline/sdk"
|
||||
|
||||
const plugin: AgentPlugin = {
|
||||
const plugin: AgentExtension = {
|
||||
name: "github",
|
||||
manifest: { capabilities: ["tools"] },
|
||||
setup(api, ctx) {
|
||||
@@ -269,7 +269,7 @@ Users can then install from git, npm, or a local path:
|
||||
cline plugin install https://github.com/your-org/cline-github-plugin.git
|
||||
```
|
||||
|
||||
See [Plugins](/customization/plugins) for the full manifest format, directory layout, and the [typescript-lsp-plugin](https://github.com/cline/typescript-lsp-plugin) for a complete working example.
|
||||
See [Plugins](/customization/plugins) for the full manifest format and directory layout, and [Plugin Examples](/sdk/plugin-examples) for complete working plugins you can clone and install.
|
||||
|
||||
## Plugin Design Guidelines
|
||||
|
||||
|
||||
+16
-20
@@ -39,7 +39,7 @@ const agent = new Agent({
|
||||
|
||||
agent.subscribe((event) => {
|
||||
if (event.type === "assistant-text-delta") {
|
||||
process.stdout.write(event.text ?? "")
|
||||
process.stdout.write(event.text)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -47,42 +47,38 @@ const result = await agent.run("Explain what an SDK is in two sentences.")
|
||||
```
|
||||
|
||||
<Note>
|
||||
Here is a complete [quickstart example](https://github.com/cline/cline/tree/main/sdk/apps/examples/quickstart). Clone it and run `bun dev` to try it.
|
||||
This is the complete [quickstart example](https://github.com/cline/sdk/tree/main/apps/examples/quickstart). Clone it and run `bun dev` to try it.
|
||||
</Note>
|
||||
|
||||
## Runtime Choices
|
||||
|
||||
| Runtime | Use when |
|
||||
|---------|----------|
|
||||
| `Agent` / `AgentRuntime` | You want a browser-safe, stateless in-process loop and provide your own tools/persistence |
|
||||
| `ClineCore` | You want sessions, built-in tools, approvals, config discovery, scheduling, or hub support |
|
||||
|
||||
See [Agent vs ClineCore](/sdk/runtime).
|
||||
|
||||
## Packages
|
||||
|
||||
| Package | Purpose |
|
||||
|---------|---------|
|
||||
| `@cline/sdk` | Public SDK surface (re-exports `@cline/core`) |
|
||||
| `@cline/core` | Node runtime for sessions, built-in tools, persistence, hub support, automation |
|
||||
| `@cline/agents` | Browser-compatible stateless agent execution loop |
|
||||
| `@cline/llms` | Provider gateway and model catalogs |
|
||||
| `@cline/shared` | Types, schemas, tool helpers, hooks, storage helpers |
|
||||
|
||||
|
||||
|
||||
| `@cline/llms` | Provider gateway and model catalogs |
|
||||
| `@cline/agents` | Browser-safe stateless agent execution loop |
|
||||
| `@cline/core` | Node runtime for sessions, built-in tools, persistence, hub support, automation |
|
||||
|
||||
See [Packages](/sdk/architecture/overview) for package boundaries and exports.
|
||||
|
||||
## Runtime Choices
|
||||
|
||||
| Runtime | Use when |
|
||||
|---------|----------|
|
||||
| `ClineCore` | The fully featured Cline agent that you can customize and build upon. Includes session management, built-in tools, approvals, config discovery, channels, and scheduling |
|
||||
| `Agent` / `AgentRuntime` | A stateless in-process loop that offers even more control. ClineCore depends on the Agents package. Build with Agents directly if you want to control tools, session persistence, and configuration directly |
|
||||
|
||||
|
||||
See [Agent vs ClineCore](/sdk/runtime).
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Examples" icon="rocket" href="/sdk/examples">
|
||||
Browse complete, runnable SDK examples.
|
||||
</Card>
|
||||
<Card title="Plugins" icon="diagram-project" href="/sdk/plugins">
|
||||
Extend Cline's functionality.
|
||||
<Card title="Agent vs ClineCore" icon="diagram-project" href="/sdk/runtime">
|
||||
Pick the right runtime layer.
|
||||
</Card>
|
||||
<Card title="Tools" icon="wrench" href="/sdk/tools">
|
||||
Add actions the model can call.
|
||||
|
||||
@@ -4,25 +4,11 @@ sidebarTitle: "Plugin Examples"
|
||||
description: "Explore ready-to-run plugin examples from the Cline SDK repository."
|
||||
---
|
||||
|
||||
The [SDK repository](https://github.com/cline/cline/tree/main/sdk) includes ready-to-run plugin examples under [`examples/plugins/`](https://github.com/cline/cline/tree/main/sdk/examples/plugins). Use them as starting points for tools, lifecycle hooks, message rewriting, policy enforcement, background jobs, and multi-agent workflows.
|
||||
The [SDK repository](https://github.com/cline/sdk) includes ready-to-run plugin examples under [`examples/plugins/`](https://github.com/cline/sdk/tree/main/examples/plugins). Use them as starting points for tools, lifecycle hooks, message rewriting, policy enforcement, background jobs, and multi-agent workflows.
|
||||
|
||||
## Examples
|
||||
## Getting Started
|
||||
|
||||
| Example | What it shows |
|
||||
|---------|---------------|
|
||||
| [`weather-metrics.ts`](https://github.com/cline/cline/blob/main/sdk/examples/plugins/weather-metrics.ts) | Tool registration plus lifecycle metrics hooks. Best starting point. |
|
||||
| [`mac-notify.ts`](https://github.com/cline/cline/blob/main/sdk/examples/plugins/mac-notify.ts) | macOS Notification Center alert from an `afterRun` hook. |
|
||||
| [`custom-compaction.ts`](https://github.com/cline/cline/blob/main/sdk/examples/plugins/custom-compaction.ts) | Provider-message compaction with `registerMessageBuilder`. |
|
||||
| [`background-terminal.ts`](https://github.com/cline/cline/blob/main/sdk/examples/plugins/background-terminal.ts) | Detached shell jobs with persisted logs and optional session steering. |
|
||||
| [`automation-events.ts`](https://github.com/cline/cline/blob/main/sdk/examples/plugins/automation-events.ts) | Plugin-emitted automation events. |
|
||||
| [`gitignore-read-files-guard.ts`](https://github.com/cline/cline/blob/main/sdk/examples/plugins/gitignore-read-files-guard.ts) | Runtime hook policy that blocks file access outside workspace `.gitignore` boundaries. |
|
||||
| [`web-search.ts`](https://github.com/cline/cline/blob/main/sdk/examples/plugins/web-search.ts) | `web_search` tool backed by an Exa API key. |
|
||||
| [`typescript-lsp/`](https://github.com/cline/cline/tree/main/sdk/examples/plugins/typescript-lsp) | `goto_definition` tool powered by the TypeScript Language Service. |
|
||||
| [`agents-squad/`](https://github.com/cline/cline/tree/main/sdk/examples/plugins/agents-squad) | Multi-agent team with subagents that have their own models and personalities. |
|
||||
|
||||
## Try a File Plugin with the CLI
|
||||
|
||||
The CLI auto-discovers plugins from `.cline/plugins` in the workspace, `~/.cline/plugins`, and the system plugins folder.
|
||||
The CLI auto-discovers plugins from `.cline/plugins` in the workspace, `~/.cline/plugins`, and the system plugins folder. Drop a single-file plugin in and the CLI picks it up:
|
||||
|
||||
```sh
|
||||
mkdir -p .cline/plugins
|
||||
@@ -30,9 +16,59 @@ cp examples/plugins/weather-metrics.ts .cline/plugins/
|
||||
cline -i "What's the weather like in Tokyo and Paris?"
|
||||
```
|
||||
|
||||
Swap `weather-metrics.ts` for any other single-file plugin example.
|
||||
For directory plugins (with their own `package.json` and `cline.plugins` manifest), use `cline plugin install`:
|
||||
|
||||
## Block Ignored File Access
|
||||
```sh
|
||||
cline plugin install ./examples/plugins/agents-squad
|
||||
```
|
||||
|
||||
See [Installing Plugins](/sdk/plugin-install) for more install options.
|
||||
|
||||
<Tip>
|
||||
[`weather-metrics.ts`](https://github.com/cline/sdk/blob/main/examples/plugins/weather-metrics.ts) is the recommended starting point. It covers the full plugin shape (`setup`, tool registration, lifecycle hooks) in one short file.
|
||||
</Tip>
|
||||
|
||||
## Examples
|
||||
|
||||
### [weather-metrics.ts](https://github.com/cline/sdk/blob/main/examples/plugins/weather-metrics.ts)
|
||||
|
||||
The Swiss army knife example. Reads `ctx.workspaceInfo` in `setup()` to embed the workspace root and git branch into the tool description, then implements all four lifecycle hooks (`beforeRun`, `beforeTool`, `afterTool`, `afterRun`) for per-run metrics. Also shows policy enforcement in `beforeTool`: returns `{ stop: true, reason }` to block `git push` when the active branch is `main` or `master`. If you read one example, read this one.
|
||||
|
||||
### [mac-notify.ts](https://github.com/cline/sdk/blob/main/examples/plugins/mac-notify.ts)
|
||||
|
||||
A complete plugin in ~60 lines, hooks-only, no tools. Listens for `afterRun` with `result.status === "completed"` and shells out to `osascript` to post a macOS Notification Center alert with the run summary. Useful when you want long agent runs to ping you when they finish.
|
||||
|
||||
### [custom-compaction.ts](https://github.com/cline/sdk/blob/main/examples/plugins/custom-compaction.ts)
|
||||
|
||||
A real token-budget-aware compaction strategy implemented as a `registerMessageBuilder`. Estimates tokens per message, preserves the first user message plus the most recent ~24k tokens of working context, and replaces the middle of the conversation with a single structured summary (role counts, tool activity, files touched, last few highlights). Builders run before core's built-in API-safety pass, so provider-safe truncation is still the final word.
|
||||
|
||||
### [background-terminal.ts](https://github.com/cline/sdk/blob/main/examples/plugins/background-terminal.ts)
|
||||
|
||||
Three tools (`start_background_command`, `get_background_command`, `delete_background_command`) for detached shell jobs. Spawns commands with `detached: true`, persists stdout and stderr under `~/.cline/data/plugins/background-shell/jobs/`, and returns a job ID immediately so the agent can keep working. When the process exits, the plugin uses `globalThis.__clinePluginHost.emitEvent("steer_message", ...)` to push the completion summary back into the active session, so the agent can react to long-running work without blocking on it.
|
||||
|
||||
### [automation-events.ts](https://github.com/cline/sdk/blob/main/examples/plugins/automation-events.ts)
|
||||
|
||||
How a plugin declares its own automation event types and ingests events into the runtime. Calls `api.registerAutomationEventType` with a schema and examples, then drives a session-scoped `setInterval` that pushes events through `ctx.automation.ingestEvent()` (with a `dedupeKey` for idempotency). The pattern lets a plugin act as a custom event source without touching cron internals.
|
||||
|
||||
### [gitignore-read-files-guard.ts](https://github.com/cline/sdk/blob/main/examples/plugins/gitignore-read-files-guard.ts)
|
||||
|
||||
A policy plugin that intercepts `read_files`, `editor`, and `apply_patch` in `beforeTool`. Extracts target paths from each tool input (including paths parsed out of `*** Add File` / `*** Update File` headers inside apply_patch diffs), runs `git check-ignore --stdin -z -v -n --no-index` against the workspace, and returns `{ skip: true, reason }` for any match against a workspace `.gitignore`. The host turns the skip into a clean policy-error tool result instead of letting the read happen.
|
||||
|
||||
### [web-search.ts](https://github.com/cline/sdk/blob/main/examples/plugins/web-search.ts)
|
||||
|
||||
Registers `web_search` backed by Exa. Validates and clamps input (limit between 1 and 10, normalized domain list, `recencyDays` mapped to an ISO `startPublishedDate`), reads `EXA_API_KEY` from the host environment, and returns a typed result with title, URL, snippet, publish date, author, and score. Uses `retryable: true, maxRetries: 1` on the tool definition to let the runtime retry transient failures. Good template for any plugin that wraps a third-party API.
|
||||
|
||||
### [typescript-lsp/](https://github.com/cline/sdk/tree/main/examples/plugins/typescript-lsp)
|
||||
|
||||
A directory plugin that registers one tool, `goto_definition(file, line)`, powered by the TypeScript Language Service. Walks up from the target file to find the nearest `tsconfig.json`, resolves `typescript` from the target project's own `node_modules` via `createRequire` (so the plugin has zero TS dependencies and tracks whatever version the project uses), caches the Language Service per tsconfig, then AST-walks to find identifiers on the requested line and resolves each one via `getDefinitionAtPosition`. Resolves symbols through imports, re-exports, type aliases, and declaration merging, the same way your IDE does.
|
||||
|
||||
### [agents-squad/](https://github.com/cline/sdk/tree/main/examples/plugins/agents-squad)
|
||||
|
||||
A directory plugin with its own `package.json` and `cline.plugins` manifest, demonstrating how to ship a richer plugin. Registers a multi-agent toolkit: `start_subagent`, `message_subagent`, `get_subagent`, `list_agent_presets`, `list_skills` / `get_skill`, and `save_handoff` / `read_handoff`. Ships four bundled subagent presets (`phantom` for recon, `oracle` for planning, `anvil` for implementation, `inquisitor` for review), and supports custom agents and skills via Markdown + YAML frontmatter files with bundled → global → project precedence. The handoff store is a small file-backed key/value scoped to the conversation, so subagents can pass artifacts to each other.
|
||||
|
||||
## Usage Walkthroughs
|
||||
|
||||
### Block Ignored File Access
|
||||
|
||||
Use `gitignore-read-files-guard.ts` to block tools from reading or editing files ignored by workspace `.gitignore` files:
|
||||
|
||||
@@ -44,17 +80,7 @@ cline -i "Read the ignored .env file"
|
||||
|
||||
The guard uses the `beforeTool` runtime hook. When a `read_files`, `editor`, or `apply_patch` call targets an ignored workspace file, the hook returns `{ skip: true }`, so the tool records a policy error and does not access the file.
|
||||
|
||||
## Install a Directory Plugin
|
||||
|
||||
For a plugin that lives in a directory with its own `package.json`, use `cline plugin install`:
|
||||
|
||||
```sh
|
||||
cline plugin install ./examples/plugins/agents-squad
|
||||
```
|
||||
|
||||
See [Installing Plugins](/sdk/plugin-install) for more install options.
|
||||
|
||||
## Add Web Search
|
||||
### Add Web Search
|
||||
|
||||
The `web-search.ts` plugin registers a `web_search` tool backed by Exa. Use `web_search` to discover relevant URLs, then use `fetch_web_content` when the agent needs to inspect a specific page.
|
||||
|
||||
@@ -71,18 +97,18 @@ cline -P openrouter -m anthropic/claude-sonnet-4.6 "Search the web for recent Bu
|
||||
|
||||
`EXA_API_KEY` authenticates the search backend. The CLI still needs a normal model provider key or saved provider auth for inference.
|
||||
|
||||
## Custom Message Compaction
|
||||
### Custom Message Compaction
|
||||
|
||||
Use `registerMessageBuilder` when a plugin needs to rewrite the provider-bound message list before the model call.
|
||||
|
||||
| Example | Extension point | Best for |
|
||||
|---------|-----------------|----------|
|
||||
| [`custom-compaction.ts`](https://github.com/cline/cline/blob/main/sdk/examples/plugins/custom-compaction.ts) | `api.registerMessageBuilder()` | Reusable, plugin-owned compaction policies. |
|
||||
| [`custom-compaction-hook.example.ts`](https://github.com/cline/cline/blob/main/sdk/examples/hooks/custom-compaction-hook.example.ts) | `hooks.beforeModel` | Runtime hook logic that needs runtime hook context or direct request mutation. |
|
||||
| [`custom-compaction.ts`](https://github.com/cline/sdk/blob/main/examples/plugins/custom-compaction.ts) | `api.registerMessageBuilder()` | Reusable, plugin-owned compaction policies. |
|
||||
| [`custom-compaction-hook.example.ts`](https://github.com/cline/sdk/blob/main/examples/hooks/custom-compaction-hook.example.ts) | `hooks.beforeModel` | Runtime hook logic that needs runtime hook context or direct request mutation. |
|
||||
|
||||
Prefer the message-builder version for normal compaction. It runs in the core message pipeline before the built-in safety builder, multiple builders run in registration order, and the final pass enforces provider-safe truncation.
|
||||
|
||||
## Background Terminal Plugin
|
||||
### Background Shell Jobs
|
||||
|
||||
`background-terminal.ts` registers three tools for long-running shell jobs:
|
||||
|
||||
@@ -92,4 +118,21 @@ Prefer the message-builder version for normal compaction. It runs in the core me
|
||||
| `get_background_command` | Reads job status plus recent stdout/stderr tails. |
|
||||
| `delete_background_command` | Deletes saved job metadata and optionally deletes captured logs. |
|
||||
|
||||
When `notifyParent` is true, the plugin emits a `steer_message` after the command exits, pushing a completion summary back into the active session so the agent can react to long-running commands without blocking the original tool call.
|
||||
When `notifyParent` is true, the plugin emits a `steer_message` after the command exits, pushing a completion summary back into the active session so the agent can react to long-running commands without blocking the original tool call.
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Plugins Overview" icon="puzzle-piece" href="/sdk/plugins">
|
||||
Understand what plugins are and the extension points they expose.
|
||||
</Card>
|
||||
<Card title="Writing Plugins" icon="code" href="/sdk/guides/writing-plugins">
|
||||
Build a plugin from scratch.
|
||||
</Card>
|
||||
<Card title="Installing Plugins" icon="download" href="/sdk/plugin-install">
|
||||
Install from npm, git, or local paths.
|
||||
</Card>
|
||||
<Card title="Creating Custom Tools" icon="wrench" href="/sdk/guides/creating-custom-tools">
|
||||
Define the tools your plugin will register.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -99,7 +99,7 @@ await cline.start({
|
||||
})
|
||||
```
|
||||
|
||||
Plugin files must export an `AgentPlugin` as the default export.
|
||||
Plugin files must export an `AgentExtension` as the default export.
|
||||
|
||||
### Using `plugins` (Agent Runtime)
|
||||
|
||||
|
||||
+35
-36
@@ -6,45 +6,14 @@ description: "Learn what plugins are, their benefits, and how they extend agent
|
||||
|
||||
Plugins are packages of reusable agent capabilities. They let you bundle tools, lifecycle hooks, commands, and configuration into a single module that can be shared across projects or published for others to use.
|
||||
|
||||
## Benefits of Plugins
|
||||
|
||||
| Benefit | Description |
|
||||
|---------|-------------|
|
||||
| **Modularity** | Encapsulate related tools and hooks in a single unit. No more scattered logic. |
|
||||
| **Reusability** | Share plugins across agents, projects, or teams. Publish to npm or distribute via git. |
|
||||
| **Packaging** | Bundle tools, hooks, commands, message builders, and providers together. |
|
||||
| **Observability** | Hook into every stage of the agent lifecycle — run start/end, model calls, tool calls, errors. |
|
||||
| **Composability** | Combine multiple plugins in a single agent. Each plugin handles its own domain. |
|
||||
|
||||
## Extension Glossary
|
||||
|
||||
| Extension point | What it does |
|
||||
|-----------------|--------------|
|
||||
| **Tool** | Lets the model call an action (query a DB, call an API, etc.) |
|
||||
| **Command** | Register slash commands to allow actions to be manually triggered |
|
||||
| **Hook** | Runs lifecycle logic or policy checks at specific stages |
|
||||
| **Rules** | Prompts that steer the agent and will be included in every session |
|
||||
| **Events** | Register external events that will trigger agent actions |
|
||||
| **Plugin** | Packages tools, hooks, commands, rules, and automation events together |
|
||||
|
||||
| If you need to... | Use a... |
|
||||
|-------------------|----------|
|
||||
| Allow the model to query a database, call an API, run a domain action | **Tool** |
|
||||
| Register a user triggered action (slash command) | **Command** |
|
||||
| Log runs, collect metrics, enforce policy | **Hook** handler |
|
||||
| Block dangerous tool calls | **Hook** or approval policy |
|
||||
| Provide consistent guidance to the model via prompts | **Rule** |
|
||||
| Trigger agent action on an external event (new PR, Slack message, etc) | **Event** |
|
||||
| Bundle several tools into a reusable module | **Plugin** |
|
||||
|
||||
## What is a Plugin?
|
||||
|
||||
A plugin is an `AgentPlugin` — an object that implements the SDK's extension interface. It can register tools, hook into agent lifecycle events, and provide configuration defaults.
|
||||
A plugin is an `AgentExtension` — an object that implements the SDK's extension interface. It can register tools, hook into agent lifecycle events, and provide configuration defaults.
|
||||
|
||||
```typescript
|
||||
import { type AgentPlugin } from "@cline/sdk"
|
||||
import { type AgentExtension } from "@cline/sdk"
|
||||
|
||||
const myPlugin: AgentPlugin = {
|
||||
const myPlugin: AgentExtension = {
|
||||
name: "my-plugin",
|
||||
manifest: {
|
||||
capabilities: ["tools", "hooks"],
|
||||
@@ -65,6 +34,36 @@ const myPlugin: AgentPlugin = {
|
||||
|
||||
Hooks are defined inside the `hooks` object, not directly on the extension. The available lifecycle hooks are `beforeRun`, `afterRun`, `beforeModel`, `afterModel`, `beforeTool`, `afterTool`, and `onEvent`.
|
||||
|
||||
## Benefits of Plugins
|
||||
|
||||
| Benefit | Description |
|
||||
|---------|-------------|
|
||||
| **Modularity** | Encapsulate related tools and hooks in a single unit. No more scattered logic. |
|
||||
| **Reusability** | Share plugins across agents, projects, or teams. Publish to npm or distribute via git. |
|
||||
| **Packaging** | Bundle tools, hooks, commands, message builders, and providers together. |
|
||||
| **Observability** | Hook into every stage of the agent lifecycle — run start/end, model calls, tool calls, errors. |
|
||||
| **Composability** | Combine multiple plugins in a single agent. Each plugin handles its own domain. |
|
||||
|
||||
|
||||
## Tools vs Plugins vs Hooks
|
||||
|
||||
| Extension point | What it does |
|
||||
|-----------------|--------------|
|
||||
| **Tool** | Lets the model call an action (query a DB, call an API, etc.) |
|
||||
| **Plugin** | Packages tools, hooks, commands, providers, and automation events together |
|
||||
| **Hook** | Runs lifecycle logic or policy checks at specific stages |
|
||||
|
||||
|
||||
| If you need to... | Use a... |
|
||||
|-------------------|----------|
|
||||
| Query a database, call an API, run a domain action | **Tool** |
|
||||
| Bundle several tools into a reusable module | **Plugin** |
|
||||
| Log runs, collect metrics, enforce policy | **Hook** handler |
|
||||
| Block dangerous tool calls | **Hook** or approval policy |
|
||||
| Register slash commands or providers | **Plugin** |
|
||||
|
||||
For tool definitions, see [Tools](/sdk/tools).
|
||||
|
||||
|
||||
## Next Steps
|
||||
|
||||
@@ -94,7 +93,7 @@ await cline.start({
|
||||
})
|
||||
```
|
||||
|
||||
Plugin files export an `AgentPlugin`.
|
||||
Plugin files export an `AgentExtension`.
|
||||
|
||||
## Installing Plugins via CLI
|
||||
|
||||
@@ -155,6 +154,6 @@ For a step-by-step plugin tutorial, see [Writing Plugins](/sdk/guides/writing-pl
|
||||
|
||||
## SDK Examples
|
||||
|
||||
The [SDK repository](https://github.com/cline/cline/tree/main/sdk) includes ready-to-run plugin examples under [`examples/plugins/`](https://github.com/cline/cline/tree/main/sdk/examples/plugins), including tool registration, lifecycle metrics, notifications, custom compaction, policy guards, web search, background jobs, TypeScript LSP tools, and multi-agent teams.
|
||||
The [SDK repository](https://github.com/cline/sdk) includes ready-to-run plugin examples under [`examples/plugins/`](https://github.com/cline/sdk/tree/main/examples/plugins), including tool registration, lifecycle metrics, notifications, custom compaction, policy guards, web search, background jobs, TypeScript LSP tools, and multi-agent teams.
|
||||
|
||||
See [Plugin Examples](/sdk/plugin-examples) for the full list and usage commands.
|
||||
|
||||
@@ -30,7 +30,7 @@ Common fields:
|
||||
| `apiKey` | `string` | No | Provider API key |
|
||||
| `baseUrl` | `string` | No | Custom provider base URL |
|
||||
| `systemPrompt` | `string` | No | System instructions |
|
||||
| `tools` | `AgentTool[]` | No | Tools available to the runtime |
|
||||
| `tools` | `AgentTool[]` / `Tool[]` | No | Tools available to the runtime |
|
||||
| `initialMessages` | `AgentMessage[]` | No | Preloaded conversation |
|
||||
| `toolPolicies` | `Record<string, ToolPolicy>` | No | Per-tool enablement/approval |
|
||||
| `hooks` | `AgentRuntimeHooks` | No | Runtime lifecycle hooks |
|
||||
|
||||
@@ -26,8 +26,8 @@ Common options:
|
||||
| `backendMode` | `"auto" \| "local" \| "hub" \| "remote"` | Runtime backend selection |
|
||||
| `hub` | `HubOptions` | Local hub connection options |
|
||||
| `remote` | `RemoteOptions` | Remote hub options |
|
||||
| `capabilities` | `RuntimeCapabilities` | Client-owned tool executors and approval callbacks |
|
||||
| `toolPolicies` | `Record<string, ToolPolicy>` | Default tool approval policies |
|
||||
| `requestToolApproval` | `(request) => Promise<ToolApprovalResult>` | Approval callback |
|
||||
| `automation` | `boolean \| ClineCoreAutomationOptions` | Enable automation APIs |
|
||||
| `fetch` | `typeof fetch` | Custom fetch for local provider calls |
|
||||
|
||||
@@ -42,7 +42,6 @@ const session = await cline.start({
|
||||
apiKey: process.env.ANTHROPIC_API_KEY,
|
||||
systemPrompt: "You are a helpful coding assistant.",
|
||||
cwd: process.cwd(),
|
||||
workspaceRoot: process.cwd(),
|
||||
enableTools: true,
|
||||
enableSpawnAgent: false,
|
||||
enableAgentTeams: false,
|
||||
@@ -61,7 +60,7 @@ const session = await cline.start({
|
||||
| `sessionMetadata` | `Record<string, unknown>` | No | Metadata persisted with session |
|
||||
| `initialMessages` | `Message[]` | No | Preloaded messages |
|
||||
| `toolPolicies` | `Record<string, ToolPolicy>` | No | Per-session tool policies |
|
||||
| `capabilities` | `RuntimeCapabilities` | No | Per-session tool executors and approval callbacks |
|
||||
| `requestToolApproval` | function | No | Per-session approval callback |
|
||||
|
||||
### StartSessionResult
|
||||
|
||||
|
||||
@@ -25,14 +25,14 @@ const tool = createTool({
|
||||
|
||||
`inputSchema` can be either JSON Schema or a Zod schema.
|
||||
|
||||
## AgentTool
|
||||
## Tool
|
||||
|
||||
```typescript
|
||||
interface AgentTool<TInput = unknown, TOutput = unknown> {
|
||||
interface Tool<TInput = unknown, TOutput = unknown> {
|
||||
name: string
|
||||
description: string
|
||||
inputSchema: Record<string, unknown>
|
||||
execute: (input: TInput, context: AgentToolContext, onChange?: (update: unknown) => void) => Promise<TOutput>
|
||||
execute: (input: TInput, context: ToolContext, onChange?: (update: unknown) => void) => Promise<TOutput>
|
||||
timeoutMs?: number
|
||||
retryable?: boolean
|
||||
maxRetries?: number
|
||||
@@ -45,12 +45,12 @@ Defaults from `createTool`:
|
||||
|-------|---------|
|
||||
| `timeoutMs` | `30000` |
|
||||
| `retryable` | `true` |
|
||||
| `maxRetries` | `3` |
|
||||
| `maxRetries` | `2` |
|
||||
|
||||
## AgentToolContext
|
||||
## ToolContext
|
||||
|
||||
```typescript
|
||||
interface AgentToolContext {
|
||||
interface ToolContext {
|
||||
agentId: string
|
||||
conversationId: string
|
||||
iteration: number
|
||||
|
||||
@@ -42,9 +42,9 @@ import type {
|
||||
AgentConfig,
|
||||
AgentEvent,
|
||||
AgentResult,
|
||||
AgentPlugin,
|
||||
AgentTool,
|
||||
AgentToolContext,
|
||||
AgentExtension,
|
||||
Tool,
|
||||
ToolContext,
|
||||
ToolPolicy,
|
||||
} from "@cline/sdk"
|
||||
```
|
||||
|
||||
@@ -6,8 +6,8 @@ description: "Choose between the stateless AgentRuntime loop and the full ClineC
|
||||
|
||||
The SDK has two main runtime entry points:
|
||||
|
||||
- `Agent` / `AgentRuntime` from `@cline/agents`: browser-safe, stateless, in-process execution. You provide tools, persistence, and lifecycle management.
|
||||
- `ClineCore` from `@cline/core`: Node runtime with sessions, persistence, built-in tools, approvals, automation, and hub support.
|
||||
- `Agent` / `AgentRuntime` from `@cline/agents`: browser-compatible, stateless, in-process execution. You provide tools, persistence, and lifecycle management.
|
||||
|
||||
`Agent` is an alias for `AgentRuntime`. Use `Agent` when constructing from provider/model IDs. Use `AgentRuntime` when supplying a pre-built `AgentModel`.
|
||||
|
||||
@@ -15,7 +15,7 @@ The SDK has two main runtime entry points:
|
||||
|
||||
| Need | Use |
|
||||
|------|-----|
|
||||
| Browser-compatible or lightweight in-process agent | `Agent` / `AgentRuntime` |
|
||||
| Browser-safe or lightweight in-process agent | `Agent` / `AgentRuntime` |
|
||||
| Custom tools only | `Agent` / `AgentRuntime` |
|
||||
| Manual control over persistence | `Agent` / `AgentRuntime` |
|
||||
| Built-in tools for files, shell, search, web fetch | `ClineCore` |
|
||||
@@ -49,7 +49,7 @@ const agent = new Agent({
|
||||
|
||||
agent.subscribe((event) => {
|
||||
if (event.type === "assistant-text-delta") {
|
||||
process.stdout.write(event.text ?? "")
|
||||
process.stdout.write(event.text)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -108,7 +108,6 @@ const session = await cline.start({
|
||||
apiKey: process.env.ANTHROPIC_API_KEY,
|
||||
systemPrompt: "You are a helpful coding assistant.",
|
||||
cwd: "/path/to/project",
|
||||
workspaceRoot: "/path/to/project",
|
||||
enableTools: true,
|
||||
enableSpawnAgent: false,
|
||||
enableAgentTeams: false,
|
||||
@@ -174,7 +173,6 @@ await cline.start({
|
||||
apiKey: process.env.ANTHROPIC_API_KEY,
|
||||
systemPrompt: "You are a helpful coding assistant.",
|
||||
cwd: process.cwd(),
|
||||
workspaceRoot: process.cwd(),
|
||||
enableTools: true,
|
||||
enableSpawnAgent: false,
|
||||
enableAgentTeams: false,
|
||||
@@ -193,10 +191,8 @@ Use `requestToolApproval` when your application needs to decide dynamically:
|
||||
```typescript
|
||||
const cline = await ClineCore.create({
|
||||
clientName: "my-app",
|
||||
capabilities: {
|
||||
requestToolApproval: async (request) => {
|
||||
return { approved: request.toolName !== "run_commands" }
|
||||
},
|
||||
requestToolApproval: async (request) => {
|
||||
return { approved: request.toolName !== "run_commands" }
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
+30
-24
@@ -4,7 +4,7 @@ sidebarTitle: "Tools"
|
||||
description: "Tools let agents read, write, search, call APIs, and run domain-specific actions."
|
||||
---
|
||||
|
||||
Tools are functions the model can call during execution. Tools consist of a name, description, and schema which the SDK sends to the model. Then the model can direct the SDK to execute tool functions and send results back into the conversation.
|
||||
Tools are functions the model can call during execution. The SDK sends tool schemas to the model, executes requested calls, then returns results back into the conversation.
|
||||
|
||||
## Built-In Tools
|
||||
|
||||
@@ -22,16 +22,10 @@ Tools are functions the model can call during execution. Tools consist of a name
|
||||
| `ask_question` | Ask the user for input |
|
||||
| `submit_and_exit` | Submit a final answer and stop |
|
||||
|
||||
<Note>
|
||||
If you need more control you can use the `Agents` package directly. This does not include built-in tools. You pass in only the tools you want when constructing the agent.
|
||||
</Note>
|
||||
`Agent` does not include built-in tools. Pass tools explicitly when constructing the agent.
|
||||
|
||||
## Custom Tools with createTool
|
||||
|
||||
One of the most powerful features of the SDK is the ability to create and register custom tools. This allows you to add and share capabilities that are context efficient and behave deterministically because they are implemented in code rather than prompts.
|
||||
|
||||
### Quick Example
|
||||
|
||||
Use `createTool` with a zod schema for type-safe tools:
|
||||
|
||||
```typescript
|
||||
@@ -72,11 +66,20 @@ const searchDatabase = createTool({
|
||||
})
|
||||
```
|
||||
|
||||
For complete examples of tools in action, see the [cli-agent](https://github.com/cline/cline/tree/main/sdk/apps/examples/cli-agent) (shell tool) and [code-review-bot](https://github.com/cline/cline/tree/main/sdk/apps/examples/code-review-bot) (multiple tools with completion lifecycle).
|
||||
For complete examples of tools in action, see the [cli-agent](https://github.com/cline/sdk/tree/main/apps/examples/cli-agent) (shell tool) and [code-review-bot](https://github.com/cline/sdk/tree/main/apps/examples/code-review-bot) (multiple tools with completion lifecycle).
|
||||
|
||||
For a full tutorial, see [Creating Custom Tools](/sdk/guides/creating-custom-tools). For exact types, see [Tools API](/sdk/reference/tools-api).
|
||||
|
||||
## Registering Tools
|
||||
## Register Tools
|
||||
|
||||
With `Agent`:
|
||||
|
||||
```typescript
|
||||
const agent = new Agent({
|
||||
tools: [searchDatabase, myOtherTool],
|
||||
// ...
|
||||
})
|
||||
```
|
||||
|
||||
With `ClineCore`, custom tools are passed as `extraTools` in session config:
|
||||
|
||||
@@ -90,19 +93,10 @@ await cline.start({
|
||||
})
|
||||
```
|
||||
|
||||
With `Agent`, you pass all tools into the constructor:
|
||||
Via extension/plugin:
|
||||
|
||||
```typescript
|
||||
const agent = new Agent({
|
||||
tools: [searchDatabase, myOtherTool],
|
||||
// ...
|
||||
})
|
||||
```
|
||||
|
||||
Tools are more easily shared via plugins/extensions:
|
||||
|
||||
```typescript
|
||||
const plugin: AgentPlugin = {
|
||||
const plugin: AgentExtension = {
|
||||
name: "database-tools",
|
||||
manifest: { capabilities: ["tools"] },
|
||||
setup(api) {
|
||||
@@ -110,11 +104,12 @@ const plugin: AgentPlugin = {
|
||||
},
|
||||
}
|
||||
```
|
||||
See [Plugins](/sdk/plugins) for more info.
|
||||
|
||||
See [Plugins](/sdk/plugins) for plugins and hooks.
|
||||
|
||||
## Tool Policies
|
||||
|
||||
You can control how tools are used through Tool Policies. These control whether a tool is visible and whether it requires approval.
|
||||
Policies control whether a tool is visible and whether it requires approval.
|
||||
|
||||
```typescript
|
||||
const agent = new Agent({
|
||||
@@ -136,6 +131,17 @@ const agent = new Agent({
|
||||
|
||||
Tool names not listed in `toolPolicies` default to enabled and auto-approved.
|
||||
|
||||
## Tool Design Rules
|
||||
|
||||
Good tools are specific and predictable.
|
||||
|
||||
- Use action-oriented names: `get_pull_request`, `search_database`, `deploy_service`.
|
||||
- Describe what the tool does, when to use it, and what it returns.
|
||||
- Put constraints in the description: rate limits, read-only behavior, required permissions.
|
||||
- Add descriptions for every input property.
|
||||
- Return structured JSON instead of prose when possible.
|
||||
- Respect `context.abortSignal` in long-running tools.
|
||||
|
||||
## MCP Tools
|
||||
|
||||
Tools work along side MCP. `ClineCore` can load MCP settings through its runtime/config extension path. MCP tools are registered alongside built-in and custom tools when MCP support is enabled for the session.
|
||||
`ClineCore` can load MCP settings through its runtime/config extension path. MCP tools are registered alongside built-in and custom tools when MCP support is enabled for the session.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# Cline Evals Architecture
|
||||
|
||||
> Note: Smoke tests (Layer 2) are partially disabled while the eval framework is repointed at the new SDK CLI. The scenarios under `evals/smoke-tests/` are preserved and `npm run eval:smoke:run` still works against whatever `cline` is on `$PATH` (install with `npm i -g cline`). The build-and-link helpers (`eval:smoke:build`, `eval:smoke`, `eval:smoke:ci`) and the auto-running `cline-evals-regression.yml` workflow are off until someone wires the build step at the new SDK CLI.
|
||||
|
||||
## Overview
|
||||
|
||||
The evals system provides multi-layered testing for Cline's AI capabilities.
|
||||
@@ -222,7 +220,7 @@ ls evals/smoke-tests/results/latest/<scenario>/<model>/workspace-trial-1/
|
||||
|
||||
## CI Integration
|
||||
|
||||
Smoke tests are temporarily disabled. `.github/workflows/cline-evals-regression.yml` accepts manual `workflow_dispatch` only until the build step is repointed at the new SDK CLI.
|
||||
Smoke tests run automatically on merge to `main` via `.github/workflows/cline-evals-regression.yml`.
|
||||
|
||||
**Triggers:**
|
||||
- Push to `main` branch (paths: `src/core/**`, `src/shared/**`, `proto/**`)
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
A layered testing system for measuring Cline's performance at different levels.
|
||||
|
||||
> Note: Smoke tests (Layer 2) are partially disabled while the eval framework is repointed at the new SDK CLI. The scenarios under `evals/smoke-tests/` are preserved and `npm run eval:smoke:run` still works against whatever `cline` is on `$PATH` (install with `npm i -g cline`). The build-and-link helpers (`eval:smoke:build`, `eval:smoke`, `eval:smoke:ci`) and the auto-running `cline-evals-regression.yml` workflow are off until someone wires the build step at the new SDK CLI.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
|
||||
Generated
+456
@@ -9,6 +9,7 @@
|
||||
"version": "2.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "1.15.0",
|
||||
"better-sqlite3": "^12.4.1",
|
||||
"chalk": "5.6.2",
|
||||
"commander": "^9.4.1",
|
||||
@@ -131,6 +132,23 @@
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz",
|
||||
"integrity": "sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.11",
|
||||
"form-data": "^4.0.5",
|
||||
"proxy-from-env": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/base64-js": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||
@@ -205,6 +223,19 @@
|
||||
"ieee754": "^1.1.13"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
|
||||
@@ -223,6 +254,18 @@
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
||||
@@ -259,6 +302,15 @@
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/detect-libc": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz",
|
||||
@@ -287,6 +339,20 @@
|
||||
"url": "https://dotenvx.com"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/end-of-stream": {
|
||||
"version": "1.4.5",
|
||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
|
||||
@@ -295,6 +361,51 @@
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-set-tostringtag": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
|
||||
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.6",
|
||||
"has-tostringtag": "^1.0.2",
|
||||
"hasown": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/expand-template": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
|
||||
@@ -308,17 +419,150 @@
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.11",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
|
||||
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
|
||||
"integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"es-set-tostringtag": "^2.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/fs-constants": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
||||
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/github-from-package": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
|
||||
"integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
|
||||
},
|
||||
"node_modules/gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-tostringtag": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
|
||||
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"has-symbols": "^1.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/ieee754": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||
@@ -354,6 +598,36 @@
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-db": "1.52.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mimic-response": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
|
||||
@@ -455,6 +729,15 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-from-env": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz",
|
||||
"integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/pump": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",
|
||||
@@ -779,6 +1062,21 @@
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||
},
|
||||
"axios": {
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz",
|
||||
"integrity": "sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==",
|
||||
"requires": {
|
||||
"follow-redirects": "^1.15.11",
|
||||
"form-data": "^4.0.5",
|
||||
"proxy-from-env": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"base64-js": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||
@@ -820,6 +1118,15 @@
|
||||
"ieee754": "^1.1.13"
|
||||
}
|
||||
},
|
||||
"call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"requires": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
|
||||
@@ -830,6 +1137,14 @@
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"requires": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"commander": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
||||
@@ -854,6 +1169,11 @@
|
||||
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
|
||||
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
|
||||
},
|
||||
"detect-libc": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz",
|
||||
@@ -870,6 +1190,16 @@
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz",
|
||||
"integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg=="
|
||||
},
|
||||
"dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"requires": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"end-of-stream": {
|
||||
"version": "1.4.5",
|
||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
|
||||
@@ -878,6 +1208,35 @@
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="
|
||||
},
|
||||
"es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="
|
||||
},
|
||||
"es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"requires": {
|
||||
"es-errors": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"es-set-tostringtag": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
|
||||
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
|
||||
"requires": {
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.6",
|
||||
"has-tostringtag": "^1.0.2",
|
||||
"hasown": "^2.0.2"
|
||||
}
|
||||
},
|
||||
"expand-template": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
|
||||
@@ -888,16 +1247,90 @@
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.15.11",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
|
||||
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ=="
|
||||
},
|
||||
"form-data": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
|
||||
"integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"es-set-tostringtag": "^2.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
},
|
||||
"fs-constants": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
||||
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
|
||||
},
|
||||
"function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="
|
||||
},
|
||||
"get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"requires": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"requires": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"github-from-package": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
|
||||
"integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
|
||||
},
|
||||
"gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="
|
||||
},
|
||||
"has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="
|
||||
},
|
||||
"has-tostringtag": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
|
||||
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
|
||||
"requires": {
|
||||
"has-symbols": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"requires": {
|
||||
"function-bind": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"ieee754": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||
@@ -919,6 +1352,24 @@
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true
|
||||
},
|
||||
"math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"requires": {
|
||||
"mime-db": "1.52.0"
|
||||
}
|
||||
},
|
||||
"mimic-response": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
|
||||
@@ -999,6 +1450,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"proxy-from-env": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz",
|
||||
"integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA=="
|
||||
},
|
||||
"pump": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "1.15.0",
|
||||
"better-sqlite3": "^12.4.1",
|
||||
"chalk": "5.6.2",
|
||||
"commander": "^9.4.1",
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# ميثاق المساهمين
|
||||
|
||||
## تعهدنا
|
||||
|
||||
نحن المساهمون والقائمون على هذا المشروع، نتعهد بتوفير بيئة مفتوحة ومرحبة، ونجعل المشاركة في مشروعنا ومجتمعنا تجربة خالية من التحرش للجميع، بغض النظر عن العمر، أو حجم الجسم، أو الإعاقة، أو العرق، أو الخصائص الجنسية، أو الهوية الجنسية والتعبير عنها، أو مستوى الخبرة، أو التعليم، أو الوضع الاجتماعي والاقتصادي، أو الجنسية، أو المظهر الشخصي، أو الدين، أو الهوية الجنسية والتوجه الجنسي.
|
||||
|
||||
## معاييرنا
|
||||
|
||||
أمثلة على السلوك الذي يساهم في خلق بيئة إيجابية تشمل:
|
||||
|
||||
- استخدام لغة ترحيبية وشاملة
|
||||
- احترام وجهات النظر والخبرات المختلفة
|
||||
- تقبل النقد البناء برحابة صدر
|
||||
- التركيز على ما هو الأفضل للمجتمع
|
||||
- إظهار التعاطف تجاه أعضاء المجتمع الآخرين
|
||||
|
||||
أمثلة على السلوك غير المقبول من قبل المشاركين تشمل:
|
||||
|
||||
- استخدام لغة أو صور جنسية والاهتمام الجنسي غير المرغوب فيه أو التحرش الجنسي
|
||||
- التصيد، والتعليقات المهينة/المسيئة، والهجمات الشخصية أو السياسية
|
||||
- التحرش العلني أو الخاص
|
||||
- نشر معلومات الآخرين الخاصة، مثل العنوان الفعلي أو الإلكتروني، دون إذن صريح
|
||||
- أي سلوك آخر يمكن اعتباره غير لائق في بيئة مهنية
|
||||
|
||||
## مسؤولياتنا
|
||||
|
||||
يتحمل القائمون على المشروع مسؤولية توضيح معايير السلوك المقبول، ومن المتوقع أن يتخذوا إجراءات تصحيحية مناسبة وعادلة استجابة لأي حالات سلوك غير مقبول.
|
||||
|
||||
يحق للقائمين على المشروع إزالة أو تعديل أو رفض التعليقات والالتزامات والتعليمات البرمجية وتعديلات wiki والمشكلات والمساهمات الأخرى التي لا تتماشى مع مدونة قواعد السلوك هذه، أو حظر أي مساهم بشكل مؤقت أو دائم بسبب سلوكيات أخرى يعتبرونها غير لائقة أو مهددة أو مسيئة أو ضارة، كما أنهم يتحملون مسؤولية ذلك.
|
||||
|
||||
## النطاق
|
||||
|
||||
تنطبق مدونة قواعد السلوك هذه داخل مساحات المشروع وفي الأماكن العامة عندما يمثل الفرد المشروع أو مجتمعه. تتضمن أمثلة تمثيل مشروع أو مجتمع استخدام عنوان بريد إلكتروني رسمي للمشروع، أو النشر عبر حساب رسمي على وسائل التواصل الاجتماعي، أو العمل كممثل معين في حدث عبر الإنترنت أو خارجه. يمكن للقائمين على المشروع تحديد وتوضيح تمثيل المشروع بشكل أكبر.
|
||||
|
||||
## التنفيذ
|
||||
|
||||
يمكن الإبلاغ عن حالات السلوك المسيء أو التحرش أو السلوك غير المقبول عن طريق الاتصال بفريق المشروع على hi@cline.bot. ستتم مراجعة جميع الشكاوى والتحقيق فيها وستؤدي إلى استجابة تعتبر ضرورية ومناسبة للظروف. يلتزم فريق المشروع بالحفاظ على السرية فيما يتعلق بالمبلغ عن الحادث. يمكن نشر مزيد من التفاصيل حول سياسات التنفيذ المحددة بشكل منفصل.
|
||||
|
||||
قد يواجه القائمون على المشروع الذين لا يتبعون أو يفرضون مدونة قواعد السلوك بحسن نية تداعيات مؤقتة أو دائمة على النحو الذي يحدده الأعضاء الآخرون في قيادة المشروع.
|
||||
|
||||
## الإسناد
|
||||
|
||||
تم اقتباس مدونة قواعد السلوك هذه من [تعهد المساهم][homepage]، الإصدار 1.4، متاح على https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
للحصول على إجابات للأسئلة الشائعة حول مدونة قواعد السلوك هذه، راجع https://www.contributor-covenant.org/faq
|
||||
@@ -0,0 +1,88 @@
|
||||
# المساهمة في Cline
|
||||
|
||||
نحن سعداء لاهتمامك بالمساهمة في Cline. سواء كنت تصلح خطأً أو تضيف ميزة أو تحسن الوثائق لدينا، فإن كل مساهمة تجعل Cline أذكى! للحفاظ على مجتمعنا نابضًا بالحياة وترحيبيًا، يجب على جميع الأعضاء الالتزام بـ [مدونة قواعد السلوك](CODE_OF_CONDUCT.md) لدينا.
|
||||
|
||||
## الإبلاغ عن الأخطاء أو المشكلات
|
||||
|
||||
تساعد تقارير الأخطاء على جعل Cline أفضل للجميع! قبل إنشاء مشكلة جديدة، يرجى [البحث عن المشكلات الموجودة](https://github.com/cline/cline/issues) لتجنب الازدواجية. عندما تكون جاهزًا للإبلاغ عن خطأ، انتقل إلى [صفحة المشكلات](https://github.com/cline/cline/issues/new/choose) حيث ستجد قالبًا لمساعدتك في ملء المعلومات ذات الصلة.
|
||||
|
||||
<blockquote class='warning-note'>
|
||||
🔐 <b>مهم:</b> إذا اكتشفت ثغرة أمنية، فيرجى استخدام <a href="https://github.com/cline/cline/security/advisories/new">أداة الأمان على Github للإبلاغ عنها بشكل خاص</a>.
|
||||
</blockquote>
|
||||
|
||||
## تحديد ما يجب العمل عليه
|
||||
|
||||
تبحث عن مساهمة أولى جيدة؟ تحقق من المشكلات المميزة بـ ["good first issue"](https://github.com/cline/cline/labels/good%20first%20issue) أو ["help wanted"](https://github.com/cline/cline/labels/help%20wanted). تم تحديد هذه المشكلات خصيصًا للمساهمين الجدد والمجالات التي نرحب فيها بالمساعدة!
|
||||
|
||||
نرحب أيضًا بالمساهمات في [الوثائق](https://github.com/cline/cline/tree/main/docs) لدينا! سواء كان تصحيح أخطاء إملائية، أو تحسين الأدلة الحالية، أو إنشاء محتوى تعليمي جديد - نود بناء مستودع موارد مدفوع من المجتمع يساعد الجميع على الاستفادة القصوى من Cline. يمكنك البدء بالغوص في `/docs` والبحث عن مجالات تحتاج إلى تحسين.
|
||||
|
||||
إذا كنت تخطط للعمل على ميزة أكبر، فيرجى إنشاء [طلب ميزة](https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop) أولاً حتى نتمكن من مناقشة ما إذا كان ذلك يتماشى مع رؤية Cline.
|
||||
|
||||
## إعداد التطوير
|
||||
|
||||
1. **إضافات VS Code**
|
||||
|
||||
- عند فتح المشروع، سيطالبك VS Code بتثبيت الإضافات الموصى بها
|
||||
- هذه الإضافات مطلوبة للتطوير - يرجى قبول جميع مطالبات التثبيت
|
||||
- إذا تجاهلت المطالبات، يمكنك تثبيتها يدويًا من لوحة الإضافات
|
||||
|
||||
2. **التطوير المحلي**
|
||||
- قم بتشغيل `npm run install:all` لتثبيت التبعيات
|
||||
- قم بتشغيل `npm run test` لتشغيل الاختبارات محليًا
|
||||
- قبل تقديم طلب السحب، قم بتشغيل `npm run format:fix` لتنسيق التعليمات البرمجية الخاصة بك
|
||||
|
||||
## كتابة وتقديم التعليمات البرمجية
|
||||
|
||||
يمكن لأي شخص المساهمة بالتعليمات البرمجية في Cline، لكننا نطلب منك اتباع هذه الإرشادات لضمان دمج مساهماتك بسلاسة:
|
||||
|
||||
1. **احتفظ بطلبات السحب مركزة**
|
||||
|
||||
- قيد طلبات السحب بميزة واحدة أو إصلاح خطأ
|
||||
- قسم التغييرات الأكبر إلى طلبات سحب أصغر ومتصلة
|
||||
- قسم التغييرات إلى التزامات منطقية يمكن مراجعتها بشكل مستقل
|
||||
|
||||
2. **جودة التعليمات البرمجية**
|
||||
|
||||
- قم بتشغيل `npm run lint` للتحقق من نمط التعليمات البرمجية
|
||||
- قم بتشغيل `npm run format` لتنسيق التعليمات البرمجية تلقائيًا
|
||||
- يجب أن تجتاز جميع طلبات السحب عمليات التحقق المستمر التي تشمل كلاً من التنضيد والتنسيق
|
||||
- تعامل مع أي تحذيرات أو أخطاء ESLint قبل التقديم
|
||||
- اتبع أفضل ممارسات TypeScript والحفاظ على سلامة النوع
|
||||
|
||||
3. **الاختبار**
|
||||
|
||||
- أضف اختبارات للميزات الجديدة
|
||||
- قم بتشغيل `npm test` للتأكد من اجتياز جميع الاختبارات
|
||||
- قم بتحديث الاختبارات الحالية إذا كانت تغييراتك تؤثر عليها
|
||||
- تضمين كل من اختبارات الوحدة واختبارات التكامل حيثما كان ذلك مناسبًا
|
||||
|
||||
4. **ملاحظات الإصدار وسجل التغييرات**
|
||||
|
||||
- لا يحتاج المساهمون إلى إنشاء ملفات changelog-entry ضمن PR.
|
||||
- يتولى فريق الصيانة إدارة إصدار النسخ وتنسيق سجل التغييرات أثناء عملية الإصدار.
|
||||
|
||||
5. **إرشادات الالتزام (Commit Guidelines)**
|
||||
|
||||
- اكتب رسائل التزام واضحة وواصفة
|
||||
- استخدم تنسيق الالتزام التقليدي (مثل: "feat:", "fix:", "docs:")
|
||||
- أشر إلى القضايا ذات الصلة في الالتزامات باستخدام #رقم-القضية
|
||||
|
||||
6. **قبل الإرسال**
|
||||
|
||||
- قم بإعادة دمج فرعك مع أحدث إصدار من الفرع الرئيسي
|
||||
- تأكد من أن الفرع الخاص بك يُبنى بنجاح
|
||||
- تحقق من اجتياز جميع الاختبارات
|
||||
- راجع التغييرات الخاصة بك للتأكد من عدم وجود تعليمات تصحيح الأخطاء أو سجلات وحدة التحكم
|
||||
|
||||
7. **وصف طلب السحب (Pull Request Description)**
|
||||
|
||||
- صف بوضوح ما تقوم به التغييرات
|
||||
- قم بتضمين خطوات لاختبار التغييرات
|
||||
- أدرج أي تغييرات غير متوافقة
|
||||
- أضف لقطات شاشة للتغييرات في واجهة المستخدم
|
||||
|
||||
## اتفاقية المساهمة
|
||||
|
||||
من خلال إرسال طلب سحب، فإنك توافق على أن مساهماتك سيتم ترخيصها بنفس ترخيص المشروع ([Apache 2.0](LICENSE)).
|
||||
|
||||
تذكر: المساهمة في Cline لا تقتصر فقط على كتابة الكود - إنها تتعلق بأن تكون جزءًا من مجتمع يُشكل مستقبل التطوير بمساعدة الذكاء الاصطناعي. لنبنِ شيئًا رائعًا معًا! 🚀
|
||||
@@ -0,0 +1,177 @@
|
||||
<div align="center"><sub>
|
||||
العربية | <a href="https://github.com/cline/cline/blob/main/locales/es/README.md" target="_blank">الإسبانية</a> | <a href="https://github.com/cline/cline/blob/main/locales/de/README.md" target="_blank">الألمانية</a> | <a href="https://github.com/cline/cline/blob/main/locales/ja/README.md" target="_blank">اليابانية</a> | <a href="https://github.com/cline/cline/blob/main/locales/zh-cn/README.md" target="_blank">الصينية المبسطة</a> | <a href="https://github.com/cline/cline/blob/main/locales/zh-tw/README.md" target="_blank">الصينية التقليدية</a> | <a href="https://github.com/cline/cline/blob/main/locales/pt-BR/README.md" target="_blank">البرتغالية</a>
|
||||
</sub></div>
|
||||
|
||||
# Cline
|
||||
|
||||
<p align="center">
|
||||
<img src="https://media.githubusercontent.com/media/cline/cline/main/assets/docs/demo.gif" width="100%" />
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<table>
|
||||
<tbody>
|
||||
<td align="center">
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev" target="_blank"><strong>تنزيل من متجر VS</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://discord.gg/cline" target="_blank"><strong>Discord</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://www.reddit.com/r/cline/" target="_blank"><strong>r/cline</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop" target="_blank"><strong>طلبات الميزات</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://docs.cline.bot/getting-started/getting-started-new-coders" target="_blank"><strong>البدء</strong></a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
التقى Cline، مساعد الذكاء الاصطناعي الذي يمكنه استخدام **سطر الأوامر** و **محرر النصوص** الخاص بك.
|
||||
|
||||
بفضل [قدرات Claude 4 Sonnet على التعليمات البرمجية الوكيلة](https://www.anthropic.com/claude/sonnet)، يمكن لـ Cline التعامل مع مهام تطوير البرامج المعقدة خطوة بخطوة. مع الأدوات التي تسمح له بإنشاء وتعديل الملفات، واستكشاف المشاريع الكبيرة، واستخدام المتصفح، وتنفيذ أوامر الطرفية (بعد منحك الإذن)، يمكنه مساعدتك بطرق تتجاوز إكمال الكود أو الدعم الفني. يمكن لـ Cline أيضًا استخدام بروتوكول سياق النموذج (MCP) لإنشاء أدوات جديدة وتوسيع قدراته الخاصة. في حين تعمل النصوص البرمجية الآلية المستقلة تقليديًا في بيئات محاصرة، توفر هذه الإضافة واجهة رسومية لموافقة المستخدم على كل تغيير في الملف وأمر طرفية، مما يوفر طريقة آمنة وسهلة الاستخدام لاستكشاف إمكانات الذكاء الاصطناعي الوكيل.
|
||||
|
||||
1. أدخل مهمتك وأضف الصور لتحويل المحاكاة إلى تطبيقات وظيفية أو إصلاح الأخطاء مع لقطات الشاشة.
|
||||
2. يبدأ Cline بتحليل هيكل الملفات الخاصة بك وشجرة التعريف المصدرية، وإجراء عمليات بحث regex، وقراءة الملفات ذات الصلة للاطلاع على المشاريع الحالية. من خلال إدارة المعلومات التي يتم إضافتها إلى السياق بعناية، يمكن لـ Cline تقديم مساعدة قيمة حتى للمشاريع الكبيرة والمعقدة دون إرهاق نافذة السياق.
|
||||
3. بمجرد حصول Cline على المعلومات التي يحتاجها، يمكنه:
|
||||
- إنشاء وتعديل الملفات + مراقبة أخطاء Linter/Compiler أثناء السير، مما يسمح له بإصلاح المشكلات مثل الواردات المفقودة وأخطاء البناء النحوي بمفرده.
|
||||
- تنفيذ الأوامر مباشرة في الطرفية الخاصة بك ومراقبة إخراجها أثناء العمل، مما يسمح له على سبيل المثال بالاستجابة لمشكلات خادم التطوير بعد تعديل ملف.
|
||||
- بالنسبة لمهام تطوير الويب، يمكن لـ Cline إطلاق الموقع في متصفح بلا رأس، والنقر، وكتابة النص، والتمرير، والتقاط لقطات الشاشة + سجلات وحدة التحكم، مما يسمح له بإصلاح أخطاء وقت التشغيل والأخطاء البصرية.
|
||||
4. عند اكتمال المهمة، سيقدم Cline النتيجة لك مع أمر طرفية مثل `open -a "Google Chrome" index.html`، والذي تقوم بتشغيله بنقرة زر.
|
||||
|
||||
> [!TIP]
|
||||
> استخدم اختصار `CMD/CTRL + Shift + P` لفتح لوحة الأوامر واكتب "Cline: Open In New Tab" لفتح الإضافة كعلامة تبويب في محرر النصوص الخاص بك. يتيح لك هذا استخدام Cline جنبًا إلى جنب مع مستكشف الملفات الخاص بك، ورؤية كيف يغير مساحة العمل الخاصة بك بوضوح أكبر.
|
||||
|
||||
---
|
||||
|
||||
<img align="right" width="340" src="https://github.com/user-attachments/assets/3cf21e04-7ce9-4d22-a7b9-ba2c595e88a4">
|
||||
|
||||
### استخدم أي واجهة برمجة تطبيقات ونموذج
|
||||
|
||||
يدعم Cline مقدمي واجهات برمجة التطبيقات مثل OpenRouter و Anthropic و OpenAI و Google Gemini و AWS Bedrock و Azure و GCP Vertex. يمكنك أيضًا تكوين أي واجهة برمجة تطبيقات متوافقة مع OpenAI، أو استخدام نموذج محلي من خلال LM Studio/Ollama. إذا كنت تستخدم OpenRouter، فستقوم الإضافة بجلب قائمة النماذج الأحدث الخاصة بهم، مما يسمح لك باستخدام أحدث النماذج بمجرد توفرها.
|
||||
|
||||
تتتبع الإضافة أيضًا إجمالي الرموز والاستخدام الخاص بواجهة برمجة التطبيقات لدورة المهمة بأكملها وطلبات فردية، مما يبقيك على اطلاع بالإنفاق في كل خطوة.
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/81be79a8-1fdb-4028-9129-5fe055e01e76">
|
||||
|
||||
### تشغيل الأوامر في الطرفية
|
||||
|
||||
بفضل [تحديثات تكامل الشل الجديدة في VSCode v1.93](https://code.visualstudio.com/updates/v1_93#_terminal-shell-integration-api)، يمكن لـ Cline تنفيذ الأوامر مباشرة في الطرفية الخاصة بك وتلقي الإخراج. يسمح له هذا بأداء مجموعة واسعة من المهام، من تثبيت الحزم وتشغيل سكربتات البناء إلى نشر التطبيقات، وإدارة قواعد البيانات، وتنفيذ الاختبارات، وذلك بالتكيف مع بيئة التطوير الخاصة بك وسلسلة الأدوات للقيام بالعمل على النحو الصحيح.
|
||||
|
||||
بالنسبة للعمليات الطويلة المدى مثل خوادم التطوير، استخدم زر "المتابعة أثناء التشغيل" للسماح لـ Cline بالاستمرار في المهمة بينما يعمل الأمر في الخلفية. أثناء عمل Cline، سيتم إخباره بأي إخراج طرفية جديد على الطريق، مما يسمح له بالاستجابة للمشكلات التي قد تنشأ، مثل أخطاء وقت الإنشاء عند تعديل الملفات.
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="400" src="https://github.com/user-attachments/assets/c5977833-d9b8-491e-90f9-05f9cd38c588">
|
||||
|
||||
### إنشاء وتعديل الملفات
|
||||
|
||||
يمكن لـ Cline إنشاء وتعديل الملفات مباشرة في محرر النصوص الخاص بك، وعرض الاختلافات. يمكنك تعديل أو إلغاء تغييرات Cline مباشرة في محرر الاختلافات، أو تقديم ملاحظات في الدردشة حتى تكون راضيًا عن النتيجة. يراقب Cline أيضًا أخطاء Linter/Compiler (الواردات المفقودة، أخطاء البناء النحوي، إلخ) حتى يتمكن من إصلاح المشكلات التي تنشأ أثناء السير بمفرده.
|
||||
|
||||
يتم تسجيل جميع التغييرات التي أجراها Cline في جدول زمني للملف، مما يوفر طريقة سهلة لتتبع وإلغاء التعديلات إذا لزم الأمر.
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/bc2e85ba-dfeb-4fe6-9942-7cfc4703cbe5">
|
||||
|
||||
### استخدم المتصفح
|
||||
|
||||
مع قدرة [استخدام الكمبيوتر](https://www.anthropic.com/news/3-5-models-and-computer-use) الجديدة لـ Claude 4 Sonnet، يمكن لـ Cline إطلاق متصفح، والنقر على العناصر، وكتابة النص، والتمرير، والتقاط لقطات الشاشة وسجلات وحدة التحكم في كل خطوة. يسمح له هذا بالتصحيح التفاعلي، واختبار نهاية إلى نهاية، وحتى الاستخدام العام للويب! يمنحه هذا الاستقلالية لإصلاح الأخطاء البصرية وأخطاء وقت التشغيل دون الحاجة إلى نسخ ولصق سجلات الأخطاء بنفسك.
|
||||
|
||||
حاول طلب من Cline "اختبار التطبيق"، وشاهده يشغل أمرًا مثل `npm run dev`، ويطلق خادم التطوير المحلي في متصفح، ويجري سلسلة من الاختبارات للتأكد من أن كل شيء يعمل. [شاهد عرضًا توضيحيًا هنا.](https://x.com/sdrzn/status/1850880547825823989)
|
||||
|
||||
<!-- Transparent pixel to create line break after floating image -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/ac0efa14-5c1f-4c26-a42d-9d7c56f5fadd">
|
||||
|
||||
### "إضافة أداة التي..."
|
||||
|
||||
شكراً لـ [بروتوكول سياق النموذج](https://github.com/modelcontextprotocol)، يمكن لـ Cline توسيع قدراته من خلال الأدوات المخصصة. بينما يمكنك استخدام [الخوادم التي أنشأها المجتمع](https://github.com/modelcontextprotocol/servers)، يمكن لـ Cline بدلاً من ذلك إنشاء أدوات وتثبيتها مصممة خصيصًا لتناسب سير عملك. ما عليك سوى أن تطلب من Cline "إضافة أداة"، وسيتولى كل شيء، من إنشاء خادم MCP جديد إلى تثبيته في الامتداد. تصبح هذه الأدوات المخصصة بعد ذلك جزءًا من مجموعة أدوات Cline، جاهزة للاستخدام في المهام المستقبلية.
|
||||
|
||||
- **"أضف أداة تجلب تذاكر Jira"**: استرجع تذاكر AC وقم بتشغيل Cline
|
||||
- **"أضف أداة تدير AWS EC2s"**: تحقق من مقاييس الخادم وقم بتوسيع أو تقليص عدد الحالات
|
||||
- **"أضف أداة تجلب أحدث حوادث PagerDuty"**: استرجع التفاصيل واطلب من Cline إصلاح الأخطاء
|
||||
|
||||
<!-- بكسل شفاف لإنشاء فاصل سطر بعد الصورة العائمة -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="360" src="https://github.com/user-attachments/assets/7fdf41e6-281a-4b4b-ac19-020b838b6970">
|
||||
|
||||
### إضافة السياق
|
||||
|
||||
**`@url`**: الصق رابط URL ليقوم الامتداد بجلبه وتحويله إلى Markdown، مفيد عندما تريد تزويد Cline بأحدث الوثائق
|
||||
|
||||
**`@problems`**: أضف أخطاء وتحذيرات بيئة العمل ('لوحة المشكلات') ليتمكن Cline من إصلاحها
|
||||
|
||||
**`@file`**: يضيف محتويات ملف حتى لا تضطر إلى إهدار طلبات API بالموافقة على قراءة الملف (+ البحث في الملفات)
|
||||
|
||||
**`@folder`**: يضيف جميع ملفات المجلد دفعة واحدة لتسريع سير العمل بشكل أكبر
|
||||
|
||||
<!-- بكسل شفاف لإنشاء فاصل سطر بعد الصورة العائمة -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/140c8606-d3bf-41b9-9a1f-4dbf0d4c90cb">
|
||||
|
||||
### نقاط التحقق: المقارنة والاستعادة
|
||||
|
||||
أثناء عمل Cline على مهمة، يأخذ الامتداد لقطة من بيئة العمل في كل خطوة. يمكنك استخدام زر "Compare" لرؤية الفرق بين اللقطة وبيئة العمل الحالية، وزر "Restore" للعودة إلى تلك النقطة.
|
||||
|
||||
على سبيل المثال، عند العمل مع خادم ويب محلي، يمكنك استخدام "استعادة بيئة العمل فقط" لاختبار إصدارات مختلفة من تطبيقك بسرعة، ثم استخدام "استعادة المهمة وبيئة العمل" عندما تجد الإصدار الذي تريد المتابعة منه. يتيح لك ذلك استكشاف أساليب مختلفة بأمان دون فقدان التقدم.
|
||||
|
||||
<!-- بكسل شفاف لإنشاء فاصل سطر بعد الصورة العائمة -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
## المساهمة
|
||||
|
||||
للمساهمة في المشروع، ابدأ بـ [دليل المساهمة](CONTRIBUTING.md) لتعلم الأساسيات. يمكنك أيضًا الانضمام إلى [خادم Discord](https://discord.gg/cline) للدردشة مع المساهمين الآخرين في قناة `#contributors`. إذا كنت تبحث عن عمل بدوام كامل، تحقق من الوظائف المتاحة على [صفحة التوظيف](https://cline.bot/join-us)!
|
||||
|
||||
<details>
|
||||
<summary>تعليمات التطوير المحلي</summary>
|
||||
|
||||
1. استنساخ المستودع _(يتطلب [git-lfs](https://git-lfs.com/))_:
|
||||
```bash
|
||||
git clone https://github.com/cline/cline.git
|
||||
```
|
||||
2. افتح المشروع في VSCode:
|
||||
```bash
|
||||
code cline
|
||||
```
|
||||
3. قم بتثبيت التبعيات اللازمة للامتداد وواجهة الويب:
|
||||
```bash
|
||||
npm run install:all
|
||||
```
|
||||
4. قم بالتشغيل بالضغط على `F5` (أو من `Run` -> `Start Debugging`) لفتح نافذة VSCode جديدة مع تحميل الامتداد. (قد تحتاج إلى تثبيت [إضافة esbuild problem matchers](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers) إذا واجهت مشكلات في بناء المشروع.)
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>إنشاء طلب سحب (Pull Request)</summary>
|
||||
|
||||
1. قم بعمل commit لتغييراتك.
|
||||
|
||||
2. ادفع فرعك وأنشئ PR على GitHub. سيقوم CI بـ:
|
||||
- تشغيل الاختبارات والفحوصات
|
||||
|
||||
3. يتولى فريق الصيانة إدارة إصدار النسخ وتنسيق سجل التغييرات أثناء عملية الإصدار.
|
||||
|
||||
</details>
|
||||
|
||||
## الرخصة
|
||||
|
||||
[Apache 2.0 © 2025 Cline Bot Inc.](./LICENSE)
|
||||
@@ -0,0 +1,37 @@
|
||||
# Verhaltenskodex für Mitwirkende
|
||||
|
||||
## Unser Versprechen
|
||||
|
||||
Im Interesse der Förderung einer offenen und einladenden Umgebung verpflichten wir uns als
|
||||
Mitwirkende und Betreuer, die Teilnahme an unserem Projekt und unserer
|
||||
Gemeinschaft zu einer belästigungsfreien Erfahrung für alle zu machen, unabhängig von Alter, Körpergröße,
|
||||
Behinderung, ethnischer Zugehörigkeit, sexuellen Merkmalen, Geschlechtsidentität und -ausdruck,
|
||||
Erfahrungsniveau, Bildung, sozioökonomischem Status, Nationalität, persönlichem Erscheinungsbild,
|
||||
Rasse, Religion oder sexueller Identität und Orientierung.
|
||||
|
||||
## Unsere Standards
|
||||
|
||||
Beispiele für Verhaltensweisen, die dazu beitragen, eine positive Umgebung zu schaffen, sind:
|
||||
|
||||
- Verwendung einer einladenden und inklusiven Sprache
|
||||
- Respekt gegenüber unterschiedlichen Standpunkten und Erfahrungen
|
||||
- Konstruktive Annahme von Kritik
|
||||
- Fokussierung auf das, was das Beste für die Gemeinschaft ist
|
||||
- Empathie gegenüber anderen Mitgliedern der Gemeinschaft zeigen
|
||||
|
||||
Beispiele für inakzeptables Verhalten von Teilnehmern sind:
|
||||
|
||||
- Die Verwendung von sexualisierter Sprache oder Bildern und unerwünschte sexuelle Aufmerksamkeit oder Annäherungen
|
||||
- Trollen, beleidigende/abwertende Kommentare und persönliche oder politische Angriffe
|
||||
- Öffentliche oder private Belästigung
|
||||
- Veröffentlichen von privaten Informationen anderer, wie eine physische oder elektronische Adresse,
|
||||
ohne ausdrückliche Erlaubnis
|
||||
- Andere Verhaltensweisen, die in einem professionellen Umfeld als unangemessen angesehen werden könnten
|
||||
|
||||
## Unsere Verantwortlichkeiten
|
||||
|
||||
Die Projektbetreuer sind dafür verantwortlich, die Standards für akzeptables Verhalten zu klären
|
||||
und es wird erwartet, dass sie angemessene und faire Korrekturmaßnahmen als Reaktion auf
|
||||
jedes Beispiel für inakzeptables Verhalten ergreifen.
|
||||
|
||||
Die Projektbetreuer haben das Recht und die Verantwortung, Kommentare, Commits, Code, Wiki-Änderungen, Issues und andere Beiträge zu entfernen, zu bearbeiten oder abzulehnen, die nicht mit diesem Verhaltenskodex übereinstimmen, oder jeden Mitwirkenden vorübergehend oder dauerhaft zu
|
||||
@@ -0,0 +1,82 @@
|
||||
# Beitrag zu Cline
|
||||
|
||||
Wir freuen uns, dass du daran interessiert bist, zu Cline beizutragen. Ob du einen Fehler behebst, eine Funktion hinzufügst oder unsere Dokumentation verbesserst – jeder Beitrag macht Cline intelligenter! Um unsere Community lebendig und einladend zu halten, müssen alle Mitglieder unseren [Verhaltenskodex](CODE_OF_CONDUCT.md) einhalten.
|
||||
|
||||
## Fehler oder Probleme melden
|
||||
|
||||
Fehlermeldungen helfen, Cline für alle zu verbessern! Bevor du ein neues Problem erstellst, überprüfe bitte die [bestehenden Probleme](https://github.com/cline/cline/issues), um Duplikate zu vermeiden. Wenn du bereit bist, einen Fehler zu melden, gehe zu unserer [Issues-Seite](https://github.com/cline/cline/issues/new/choose), wo du eine Vorlage findest, die dir hilft, die relevanten Informationen auszufüllen.
|
||||
|
||||
<blockquote class='warning-note'>
|
||||
🔐 <b>Wichtig:</b> Wenn du eine Sicherheitslücke entdeckst, verwende das <a href="https://github.com/cline/cline/security/advisories/new">GitHub-Sicherheitstool, um sie privat zu melden</a>.
|
||||
</blockquote>
|
||||
|
||||
## Entscheiden, woran man arbeiten möchte
|
||||
|
||||
Suchst du nach einem guten ersten Beitrag? Schau dir die mit ["good first issue"](https://github.com/cline/cline/labels/good%20first%20issue) oder ["help wanted"](https://github.com/cline/cline/labels/help%20wanted) gekennzeichneten Issues an. Diese sind speziell für neue Mitwirkende ausgewählt und Bereiche, in denen wir gerne Hilfe erhalten würden!
|
||||
|
||||
Wir begrüßen auch Beiträge zu unserer [Dokumentation](https://github.com/cline/cline/tree/main/docs). Ob du Tippfehler korrigierst, bestehende Anleitungen verbesserst oder neue Bildungsinhalte erstellst – wir möchten ein von der Community verwaltetes Ressourcen-Repository aufbauen, das allen hilft, das Beste aus Cline herauszuholen. Du kannst beginnen, indem du `/docs` erkundest und nach Bereichen suchst, die verbessert werden müssen.
|
||||
|
||||
Wenn du planst, an einer größeren Funktion zu arbeiten, erstelle bitte zuerst eine [Funktionsanfrage](https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop), damit wir besprechen können, ob sie mit der Vision von Cline übereinstimmt.
|
||||
|
||||
## Entwicklungsumgebung einrichten
|
||||
|
||||
1. **VS Code Erweiterungen**
|
||||
|
||||
- Beim Öffnen des Projekts wird VS Code dich auffordern, die empfohlenen Erweiterungen zu installieren
|
||||
- Diese Erweiterungen sind für die Entwicklung erforderlich, bitte akzeptiere alle Installationsanfragen
|
||||
- Wenn du die Anfragen abgelehnt hast, kannst du sie manuell im Erweiterungsbereich installieren
|
||||
|
||||
2. **Lokale Entwicklung**
|
||||
- Führe `npm run install:all` aus, um die Abhängigkeiten zu installieren
|
||||
- Führe `npm run test` aus, um die Tests lokal auszuführen
|
||||
- Bevor du einen PR einreichst, führe `npm run format:fix` aus, um deinen Code zu formatieren
|
||||
|
||||
## Code schreiben und einreichen
|
||||
|
||||
Jeder kann Code zu Cline beitragen, aber wir bitten dich, diese Richtlinien zu befolgen, um sicherzustellen, dass deine Beiträge reibungslos integriert werden:
|
||||
|
||||
1. **Pull Requests fokussiert halten**
|
||||
|
||||
- Begrenze PRs auf eine einzelne Funktion oder Fehlerbehebung
|
||||
- Teile größere Änderungen in kleinere, kohärente PRs auf
|
||||
- Teile Änderungen in logische Commits auf, die unabhängig überprüft werden können
|
||||
|
||||
2. **Codequalität**
|
||||
|
||||
- Führe `npm run lint` aus, um den Code-Stil zu überprüfen
|
||||
- Führe `npm run format` aus, um den Code automatisch zu formatieren
|
||||
- Alle PRs müssen die CI-Prüfungen bestehen, die Linting und Formatierung umfassen
|
||||
- Behebe alle ESLint-Warnungen oder -Fehler, bevor du einreichst
|
||||
- Befolge die Best Practices für TypeScript und halte die Typensicherheit ein
|
||||
|
||||
3. **Tests**
|
||||
|
||||
- Füge Tests für neue Funktionen hinzu
|
||||
- Führe `npm test` aus, um sicherzustellen, dass alle Tests bestehen
|
||||
- Aktualisiere bestehende Tests, wenn deine Änderungen sie beeinflussen
|
||||
- Füge sowohl Unit- als auch Integrationstests hinzu, wo es angebracht ist
|
||||
|
||||
4. **Commit-Richtlinien**
|
||||
|
||||
- Schreibe klare und beschreibende Commit-Nachrichten
|
||||
- Verwende das konventionelle Commit-Format (z.B. "feat:", "fix:", "docs:")
|
||||
- Verweise auf relevante Issues in den Commits mit #Issue-Nummer
|
||||
|
||||
5. **Vor dem Einreichen**
|
||||
|
||||
- Rebase deinen Branch mit dem neuesten Main
|
||||
- Stelle sicher, dass dein Branch korrekt gebaut wird
|
||||
- Überprüfe, dass alle Tests bestehen
|
||||
- Überprüfe deine Änderungen, um jeglichen Debug-Code oder Konsolenprotokolle zu entfernen
|
||||
|
||||
6. **Beschreibung des Pull Requests**
|
||||
- Beschreibe klar, was deine Änderungen bewirken
|
||||
- Füge Schritte hinzu, um die Änderungen zu testen
|
||||
- Liste alle wichtigen Änderungen auf
|
||||
- Füge Screenshots für Änderungen an der Benutzeroberfläche hinzu
|
||||
|
||||
## Beitragsvereinbarung
|
||||
|
||||
Durch das Einreichen eines Pull Requests erklärst du dich damit einverstanden, dass deine Beiträge unter derselben Lizenz wie das Projekt ([Apache 2.0](LICENSE)) lizenziert werden.
|
||||
|
||||
Denke daran: Zu Cline beizutragen bedeutet nicht nur, Code zu schreiben, sondern Teil einer Community zu sein, die die Zukunft der KI-gestützten Entwicklung gestaltet. Lass uns gemeinsam etwas Großartiges schaffen! 🚀
|
||||
@@ -0,0 +1,162 @@
|
||||
# Cline
|
||||
|
||||
<p align="center">
|
||||
<img src="https://media.githubusercontent.com/media/cline/cline/main/assets/docs/demo.gif" width="100%" />
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<table>
|
||||
<tbody>
|
||||
<td align="center">
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev" target="_blank"><strong>Im VS Marketplace herunterladen</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://discord.gg/cline" target="_blank"><strong>Discord</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://www.reddit.com/r/cline/" target="_blank"><strong>r/cline</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop" target="_blank"><strong>Feature Requests</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://cline.bot/join-us" target="_blank"><strong>Wir stellen ein!</strong></a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Lernen Sie Cline kennen, einen KI-Assistenten, der Ihre **CLI** u**N**d **E**ditor nutzen kann.
|
||||
|
||||
Dank der [agentischen Codierungsfähigkeiten von Claude 4 Sonnet](https://www.anthropic.com/claude/sonnet) kann Cline komplexe Softwareentwicklungsaufgaben Schritt für Schritt bewältigen. Mit Werkzeugen, die ihm das Erstellen und Bearbeiten von Dateien, das Erkunden großer Projekte, die Nutzung des Browsers und das Ausführen von Terminalbefehlen (nach Ihrer Genehmigung) ermöglichen, kann er Ihnen auf eine Weise helfen, die über die Codevervollständigung oder technischen Support hinausgeht. Cline kann sogar das Model Context Protocol (MCP) verwenden, um neue Werkzeuge zu erstellen und seine eigenen Fähigkeiten zu erweitern. Während autonome KI-Skripte traditionell in sandboxed Umgebungen laufen, bietet diese Erweiterung eine Mensch-in-der-Schleife-GUI, um jede Dateiänderung und jeden Terminalbefehl zu genehmigen, was eine sichere und zugängliche Möglichkeit bietet, das Potenzial agentischer KI zu erkunden.
|
||||
|
||||
1. Geben Sie Ihre Aufgabe ein und fügen Sie Bilder hinzu, um Mockups in funktionale Apps zu konvertieren oder Fehler mit Screenshots zu beheben.
|
||||
2. Cline beginnt mit der Analyse Ihrer Dateistruktur und Quellcode-ASTs, führt Regex-Suchen durch und liest relevante Dateien, um sich in bestehenden Projekten zurechtzufinden. Durch sorgfältiges Management der hinzugefügten Informationen kann Cline wertvolle Unterstützung auch bei großen, komplexen Projekten bieten, ohne das Kontextfenster zu überladen.
|
||||
3. Sobald Cline die benötigten Informationen hat, kann er:
|
||||
- Dateien erstellen und bearbeiten sowie Linter-/Compiler-Fehler überwachen, um proaktiv Probleme wie fehlende Importe und Syntaxfehler selbst zu beheben.
|
||||
- Befehle direkt in Ihrem Terminal ausführen und deren Ausgabe überwachen, sodass er z.B. auf Dev-Server-Probleme reagieren kann, nachdem er eine Datei bearbeitet hat.
|
||||
- Für Webentwicklungsaufgaben kann Cline die Website in einem Headless-Browser starten, klicken, tippen, scrollen und Screenshots sowie Konsolenprotokolle erfassen, sodass er Laufzeitfehler und visuelle Fehler beheben kann.
|
||||
4. Wenn eine Aufgabe abgeschlossen ist, präsentiert Cline das Ergebnis mit einem Terminalbefehl wie `open -a "Google Chrome" index.html`, den Sie mit einem Klick ausführen können.
|
||||
|
||||
> [!TIPP]
|
||||
> Verwenden Sie die Tastenkombination `CMD/CTRL + Shift + P`, um die Befehls-Palette zu öffnen und geben Sie "Cline: Open In New Tab" ein, um die Erweiterung als Tab in Ihrem Editor zu öffnen. So können Sie Cline neben Ihrem Dateiexplorer verwenden und sehen, wie er Ihren Arbeitsbereich verändert.
|
||||
|
||||
---
|
||||
|
||||
<img align="right" width="340" src="https://github.com/user-attachments/assets/3cf21e04-7ce9-4d22-a7b9-ba2c595e88a4">
|
||||
|
||||
### Verwenden Sie jede API und jedes Modell
|
||||
|
||||
Cline unterstützt API-Anbieter wie OpenRouter, Anthropic, OpenAI, Google Gemini, AWS Bedrock, Azure und GCP Vertex. Sie können auch jede OpenAI-kompatible API konfigurieren oder ein lokales Modell über LM Studio/Ollama verwenden. Wenn Sie OpenRouter verwenden, ruft die Erweiterung deren neueste Modellliste ab, sodass Sie die neuesten Modelle sofort verwenden können, sobald sie verfügbar sind.
|
||||
|
||||
Die Erweiterung verfolgt auch die gesamten Token- und API-Nutzungskosten für den gesamten Aufgabenzyklus und einzelne Anfragen, sodass Sie bei jedem Schritt über die Ausgaben informiert sind.
|
||||
|
||||
<!-- Transparenter Pixel, um einen Zeilenumbruch nach dem schwebenden Bild zu erzeugen -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/81be79a8-1fdb-4028-9129-5fe055e01e76">
|
||||
|
||||
### Befehle im Terminal ausführen
|
||||
|
||||
Dank der neuen [Shell-Integrations-Updates in VSCode v1.93](https://code.visualstudio.com/updates/v1_93#_terminal-shell-integration-api) kann Cline Befehle direkt in Ihrem Terminal ausführen und die Ausgabe empfangen. Dies ermöglicht ihm eine Vielzahl von Aufgaben, von der Installation von Paketen und dem Ausführen von Build-Skripten bis hin zur Bereitstellung von Anwendungen, Verwaltung von Datenbanken und Ausführung von Tests, während er sich an Ihre Entwicklungsumgebung und Toolchain anpasst, um die Aufgabe richtig zu erledigen.
|
||||
|
||||
Für lang laufende Prozesse wie Dev-Server verwenden Sie die Schaltfläche "Während des Laufens fortfahren", um Cline die Fortsetzung der Aufgabe zu ermöglichen, während der Befehl im Hintergrund läuft. Während Cline arbeitet, wird er über neue Terminalausgaben benachrichtigt, sodass er auf auftretende Probleme reagieren kann, wie z.B. Kompilierungsfehler beim Bearbeiten von Dateien.
|
||||
|
||||
<!-- Transparenter Pixel, um einen Zeilenumbruch nach dem schwebenden Bild zu erzeugen -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="400" src="https://github.com/user-attachments/assets/c5977833-d9b8-491e-90f9-05f9cd38c588">
|
||||
|
||||
### Dateien erstellen und bearbeiten
|
||||
|
||||
Cline kann Dateien direkt in Ihrem Editor erstellen und bearbeiten und Ihnen eine Diff-Ansicht der Änderungen präsentieren. Sie können die Änderungen von Cline direkt im Diff-Ansichts-Editor bearbeiten oder rückgängig machen oder Feedback im Chat geben, bis Sie mit dem Ergebnis zufrieden sind. Cline überwacht auch Linter-/Compiler-Fehler (fehlende Importe, Syntaxfehler usw.), sodass er auftretende Probleme selbst beheben kann.
|
||||
|
||||
Alle von Cline vorgenommenen Änderungen werden in der Timeline Ihrer Datei aufgezeichnet, was eine einfache Möglichkeit bietet, Änderungen nachzuverfolgen und bei Bedarf rückgängig zu machen.
|
||||
|
||||
<!-- Transparenter Pixel, um einen Zeilenumbruch nach dem schwebenden Bild zu erzeugen -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/bc2e85ba-dfeb-4fe6-9942-7cfc4703cbe5">
|
||||
|
||||
### Den Browser verwenden
|
||||
|
||||
Mit der neuen [Computer Use](https://www.anthropic.com/news/3-5-models-and-computer-use) Fähigkeit von Claude 4 Sonnet kann Cline einen Browser starten, Elemente anklicken, Text eingeben und scrollen, dabei Screenshots und Konsolenprotokolle bei jedem Schritt erfassen. Dies ermöglicht interaktives Debugging, End-to-End-Tests und sogar allgemeine Webnutzung! Dies gibt ihm die Autonomie, visuelle Fehler und Laufzeitprobleme zu beheben, ohne dass Sie selbst Fehlerprotokolle kopieren und einfügen müssen.
|
||||
|
||||
Versuchen Sie, Cline zu bitten, "die App zu testen", und sehen Sie zu, wie er einen Befehl wie `npm run dev` ausführt, Ihren lokal laufenden Dev-Server in einem Browser startet und eine Reihe von Tests durchführt, um zu bestätigen, dass alles funktioniert. [Sehen Sie sich hier eine Demo an.](https://x.com/sdrzn/status/1850880547825823989)
|
||||
|
||||
<!-- Transparenter Pixel, um einen Zeilenumbruch nach dem schwebenden Bild zu erzeugen -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/ac0efa14-5c1f-4c26-a42d-9d7c56f5fadd">
|
||||
|
||||
### "ein Werkzeug hinzufügen, das..."
|
||||
|
||||
Dank des [Model Context Protocol](https://github.com/modelcontextprotocol) kann Cline seine Fähigkeiten durch benutzerdefinierte Werkzeuge erweitern. Während Sie [community-made servers](https://github.com/modelcontextprotocol/servers) verwenden können, kann Cline stattdessen Werkzeuge erstellen und installieren, die speziell auf Ihren Workflow zugeschnitten sind. Bitten Sie Cline einfach, "ein Werkzeug hinzuzufügen", und er erledigt alles, von der Erstellung eines neuen MCP-Servers bis zur Installation in der Erweiterung. Diese benutzerdefinierten Werkzeuge werden dann Teil von Clines Toolkit und sind bereit, in zukünftigen Aufgaben verwendet zu werden.
|
||||
|
||||
- "ein Werkzeug hinzufügen, das Jira-Tickets abruft": Abrufen von Ticket-ACs und Cline zur Arbeit bringen
|
||||
- "ein Werkzeug hinzufügen, das AWS EC2s verwaltet": Überprüfen von Servermetriken und Skalieren von Instanzen
|
||||
- "ein Werkzeug hinzufügen, das die neuesten PagerDuty-Vorfälle abruft": Abrufen von Details und Cline bitten, Fehler zu beheben
|
||||
|
||||
<!-- Transparenter Pixel, um einen Zeilenumbruch nach dem schwebenden Bild zu erzeugen -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="360" src="https://github.com/user-attachments/assets/7fdf41e6-281a-4b4b-ac19-020b838b6970">
|
||||
|
||||
### Kontext hinzufügen
|
||||
|
||||
**`@url`:** Fügen Sie eine URL ein, damit die Erweiterung sie abruft und in Markdown konvertiert, nützlich, wenn Sie Cline die neuesten Dokumente geben möchten
|
||||
|
||||
**`@problems`:** Fügen Sie Arbeitsbereichsfehler und -warnungen (Panel 'Probleme') hinzu, die Cline beheben soll
|
||||
|
||||
**`@file`:** Fügt den Inhalt einer Datei hinzu, sodass Sie keine API-Anfragen verschwenden müssen, um das Lesen der Datei zu genehmigen (+ zum Suchen von Dateien tippen)
|
||||
|
||||
**`@folder`:** Fügt die Dateien eines Ordners auf einmal hinzu, um Ihren Workflow noch weiter zu beschleunigen
|
||||
|
||||
<!-- Transparenter Pixel, um einen Zeilenumbruch nach dem schwebenden Bild zu erzeugen -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/140c8606-d3bf-41b9-9a1f-4dbf0d4c90cb">
|
||||
|
||||
### Checkpoints: Vergleichen und Wiederherstellen
|
||||
|
||||
Während Cline eine Aufgabe bearbeitet, erstellt die Erweiterung bei jedem Schritt einen Schnappschuss Ihres Arbeitsbereichs. Sie können die Schaltfläche 'Vergleichen' verwenden, um einen Diff zwischen dem Schnappschuss und Ihrem aktuellen Arbeitsbereich zu sehen, und die Schaltfläche 'Wiederherstellen', um zu diesem Punkt zurückzukehren.
|
||||
|
||||
Wenn Sie beispielsweise mit einem lokalen Webserver arbeiten, können Sie 'Nur Arbeitsbereich wiederherstellen' verwenden, um schnell verschiedene Versionen Ihrer App zu testen, und 'Aufgabe und Arbeitsbereich wiederherstellen', wenn Sie die Version gefunden haben, von der aus Sie weiterentwickeln möchten. Dies ermöglicht es Ihnen, sicher verschiedene Ansätze zu erkunden, ohne Fortschritte zu verlieren.
|
||||
|
||||
<!-- Transparenter Pixel, um einen Zeilenumbruch nach dem schwebenden Bild zu erzeugen -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
## Beitrag leisten
|
||||
|
||||
Um zum Projekt beizutragen, beginnen Sie mit unserem [Beitragsleitfaden](CONTRIBUTING.md), um die Grundlagen zu lernen. Sie können auch unserem [Discord](https://discord.gg/cline) beitreten, um im Kanal `#contributors` mit anderen Mitwirkenden zu chatten. Wenn Sie auf der Suche nach einer Vollzeitstelle sind, schauen Sie sich unsere offenen Stellen auf unserer [Karriereseite](https://cline.bot/join-us) an!
|
||||
|
||||
<details>
|
||||
<summary>Lokale Entwicklungsanweisungen</summary>
|
||||
|
||||
1. Klonen Sie das Repository _(Erfordert [git-lfs](https://git-lfs.com/))_:
|
||||
```bash
|
||||
git clone https://github.com/cline/cline.git
|
||||
```
|
||||
2. Öffnen Sie das Projekt in VSCode:
|
||||
```bash
|
||||
code cline
|
||||
```
|
||||
3. Installieren Sie die notwendigen Abhängigkeiten für die Erweiterung und das Webview-GUI:
|
||||
```bash
|
||||
npm run install:all
|
||||
```
|
||||
4. Starten Sie durch Drücken von `F5` (oder `Run`->`Start Debugging`), um ein neues VSCode-Fenster mit der geladenen Erweiterung zu öffnen. (Möglicherweise müssen Sie die [esbuild problem matchers extension](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers) installieren, wenn Sie auf Probleme beim Erstellen des Projekts stoßen.)
|
||||
|
||||
</details>
|
||||
|
||||
## Lizenz
|
||||
|
||||
[Apache 2.0 © 2025 Cline Bot Inc.](./LICENSE)
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
# Código de Conducta para Contribuyentes
|
||||
|
||||
## Nuestro Compromiso
|
||||
|
||||
En el interés de fomentar un entorno abierto y acogedor, nosotros como
|
||||
contribuyentes y mantenedores nos comprometemos a hacer de la participación en nuestro proyecto y
|
||||
nuestra comunidad una experiencia libre de acoso para todos, independientemente de la edad, tamaño corporal,
|
||||
discapacidad, etnia, características sexuales, identidad y expresión de género,
|
||||
nivel de experiencia, educación, estatus socioeconómico, nacionalidad, apariencia personal,
|
||||
raza, religión o identidad y orientación sexual.
|
||||
|
||||
## Nuestros Estándares
|
||||
|
||||
Ejemplos de comportamientos que contribuyen a crear un entorno positivo incluyen:
|
||||
|
||||
- Uso de un lenguaje acogedor e inclusivo
|
||||
- Respeto a diferentes puntos de vista y experiencias
|
||||
- Aceptar de manera constructiva las críticas
|
||||
- Centrarse en lo que es mejor para la comunidad
|
||||
- Mostrar empatía hacia otros miembros de la comunidad
|
||||
|
||||
Ejemplos de comportamientos inaceptables por parte de los participantes incluyen:
|
||||
|
||||
- El uso de lenguaje o imágenes sexualizadas y la atención o avances sexuales no deseados
|
||||
- Trollear, comentarios insultantes/despectivos y ataques personales o políticos
|
||||
- Acoso público o privado
|
||||
- Publicar información privada de otros, como una dirección física o electrónica,
|
||||
sin permiso explícito
|
||||
- Otras conductas que podrían considerarse inapropiadas en un entorno profesional
|
||||
|
||||
## Nuestras Responsabilidades
|
||||
|
||||
Los mantenedores del proyecto son responsables de aclarar los estándares de comportamiento aceptable
|
||||
y se espera que tomen medidas correctivas apropiadas y justas en respuesta a cualquier
|
||||
caso de comportamiento inaceptable.
|
||||
|
||||
Los mantenedores del proyecto tienen el derecho y la responsabilidad de eliminar, editar o rechazar
|
||||
comentarios, commits, código, ediciones de wiki, issues y otras contribuciones que no estén alineadas con este Código de Conducta, o de prohibir temporal o permanentemente a cualquier contribuyente cuyo comportamiento sea inapropiado,
|
||||
amenazante, ofensivo o dañino.
|
||||
|
||||
## Alcance
|
||||
|
||||
Este Código de Conducta se aplica tanto dentro de los espacios del proyecto como en espacios públicos
|
||||
cuando una persona representa el proyecto o su comunidad. Ejemplos de
|
||||
representación de un proyecto o comunidad incluyen el uso de una dirección de correo electrónico oficial del proyecto,
|
||||
publicar en una cuenta oficial de redes sociales o actuar como un representante designado
|
||||
en un evento en línea o fuera de línea. La representación de un proyecto puede
|
||||
ser definida y clarificada más específicamente por los mantenedores del proyecto.
|
||||
|
||||
## Aplicación
|
||||
|
||||
Los casos de comportamiento abusivo, acosador o inaceptable de otra manera pueden
|
||||
ser reportados contactando al equipo del proyecto en hi@cline.bot. Todas las quejas
|
||||
serán revisadas e investigadas y resultarán en una respuesta que
|
||||
se considere necesaria y apropiada a las circunstancias. El equipo del proyecto está
|
||||
obligado a mantener la confidencialidad con respecto al informante de un incidente.
|
||||
Más detalles sobre políticas específicas de aplicación pueden ser publicados por separado.
|
||||
|
||||
Los mantenedores del proyecto que no sigan o hagan cumplir el Código de Conducta de buena
|
||||
fe pueden enfrentar repercusiones temporales o permanentes según lo determinen otros
|
||||
miembros de la dirección del proyecto.
|
||||
|
||||
## Atribución
|
||||
|
||||
Este Código de Conducta está adaptado del [Contributor Covenant][homepage], versión 1.4,
|
||||
disponible en https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
Respuestas a preguntas frecuentes sobre este Código de Conducta se pueden encontrar en
|
||||
https://www.contributor-covenant.org/faq
|
||||
@@ -0,0 +1,82 @@
|
||||
# Contribuir a Cline
|
||||
|
||||
Nos alegra que estés interesado en contribuir a Cline. Ya sea que corrijas un error, añadas una función o mejores nuestra documentación, ¡cada contribución hace que Cline sea más inteligente! Para mantener nuestra comunidad viva y acogedora, todos los miembros deben cumplir con nuestro [Código de Conducta](CODE_OF_CONDUCT.md).
|
||||
|
||||
## Informar de errores o problemas
|
||||
|
||||
¡Los informes de errores ayudan a mejorar Cline para todos! Antes de crear un nuevo problema, por favor revisa los [problemas existentes](https://github.com/cline/cline/issues) para evitar duplicados. Cuando estés listo para informar un error, dirígete a nuestra [página de Issues](https://github.com/cline/cline/issues/new/choose), donde encontrarás una plantilla que te ayudará a completar la información relevante.
|
||||
|
||||
<blockquote class='warning-note'>
|
||||
🔐 <b>Importante:</b> Si descubres una vulnerabilidad de seguridad, utiliza la <a href="https://github.com/cline/cline/security/advisories/new">herramienta de seguridad de GitHub para informarla de manera privada</a>.
|
||||
</blockquote>
|
||||
|
||||
## Decidir en qué trabajar
|
||||
|
||||
¿Buscas una buena primera contribución? Revisa los issues etiquetados con ["good first issue"](https://github.com/cline/cline/labels/good%20first%20issue) o ["help wanted"](https://github.com/cline/cline/labels/help%20wanted). ¡Estos están especialmente seleccionados para nuevos colaboradores y son áreas donde nos encantaría recibir ayuda!
|
||||
|
||||
También damos la bienvenida a contribuciones a nuestra [documentación](https://github.com/cline/cline/tree/main/docs). Ya sea corrigiendo errores tipográficos, mejorando guías existentes o creando nuevos contenidos educativos, queremos construir un repositorio de recursos gestionado por la comunidad que ayude a todos a sacar el máximo provecho de Cline. Puedes comenzar explorando `/docs` y buscando áreas que necesiten mejoras.
|
||||
|
||||
Si planeas trabajar en una función más grande, por favor crea primero una [solicitud de función](https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop) para que podamos discutir si se alinea con la visión de Cline.
|
||||
|
||||
## Configurar el entorno de desarrollo
|
||||
|
||||
1. **Extensiones de VS Code**
|
||||
|
||||
- Al abrir el proyecto, VS Code te pedirá que instales las extensiones recomendadas
|
||||
- Estas extensiones son necesarias para el desarrollo, por favor acepta todas las solicitudes de instalación
|
||||
- Si rechazaste las solicitudes, puedes instalarlas manualmente en la sección de extensiones
|
||||
|
||||
2. **Desarrollo local**
|
||||
- Ejecuta `npm run install:all` para instalar las dependencias
|
||||
- Ejecuta `npm run test` para ejecutar las pruebas localmente
|
||||
- Antes de enviar un PR, ejecuta `npm run format:fix` para formatear tu código
|
||||
|
||||
## Escribir y enviar código
|
||||
|
||||
Cualquiera puede contribuir código a Cline, pero te pedimos que sigas estas pautas para asegurar que tus contribuciones se integren sin problemas:
|
||||
|
||||
1. **Mantén los Pull Requests enfocados**
|
||||
|
||||
- Limita los PRs a una sola función o corrección de errores
|
||||
- Divide los cambios más grandes en PRs más pequeños y coherentes
|
||||
- Divide los cambios en commits lógicos que puedan ser revisados independientemente
|
||||
|
||||
2. **Calidad del código**
|
||||
|
||||
- Ejecuta `npm run lint` para verificar el estilo del código
|
||||
- Ejecuta `npm run format` para formatear el código automáticamente
|
||||
- Todos los PRs deben pasar las verificaciones de CI, que incluyen linting y formateo
|
||||
- Corrige todas las advertencias o errores de ESLint antes de enviar
|
||||
- Sigue las mejores prácticas para TypeScript y mantén la seguridad de tipos
|
||||
|
||||
3. **Pruebas**
|
||||
|
||||
- Añade pruebas para nuevas funciones
|
||||
- Ejecuta `npm test` para asegurarte de que todas las pruebas pasen
|
||||
- Actualiza las pruebas existentes si tus cambios las afectan
|
||||
- Añade tanto pruebas unitarias como de integración donde sea apropiado
|
||||
|
||||
4. **Pautas de commits**
|
||||
|
||||
- Escribe mensajes de commit claros y descriptivos
|
||||
- Usa el formato de commit convencional (por ejemplo, "feat:", "fix:", "docs:")
|
||||
- Haz referencia a los issues relevantes en los commits con #número-del-issue
|
||||
|
||||
5. **Antes de enviar**
|
||||
|
||||
- Rebasea tu rama con el último Main
|
||||
- Asegúrate de que tu rama se construya correctamente
|
||||
- Verifica que todas las pruebas pasen
|
||||
- Revisa tus cambios para eliminar cualquier código de depuración o registros de consola
|
||||
|
||||
6. **Descripción del Pull Request**
|
||||
- Describe claramente lo que hacen tus cambios
|
||||
- Añade pasos para probar los cambios
|
||||
- Enumera cualquier cambio importante
|
||||
- Añade capturas de pantalla para cambios en la interfaz de usuario
|
||||
|
||||
## Acuerdo de contribución
|
||||
|
||||
Al enviar un Pull Request, aceptas que tus contribuciones se licencien bajo la misma licencia que el proyecto ([Apache 2.0](LICENSE)).
|
||||
|
||||
Recuerda: Contribuir a Cline no solo significa escribir código, sino ser parte de una comunidad que está dando forma al futuro del desarrollo asistido por IA. ¡Hagamos algo grandioso juntos! 🚀
|
||||
@@ -0,0 +1,161 @@
|
||||
# Cline
|
||||
|
||||
<p align="center">
|
||||
<img src="https://media.githubusercontent.com/media/cline/cline/main/assets/docs/demo.gif" width="100%" />
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<table>
|
||||
<tbody>
|
||||
<td align="center">
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev" target="_blank"><strong>Descargar en VS Marketplace</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://discord.gg/cline" target="_blank"><strong>Discord</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://www.reddit.com/r/cline/" target="_blank"><strong>r/cline</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop" target="_blank"><strong>Solicitudes de Funciones</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://cline.bot/join-us" target="_blank"><strong>Estamos Contratando!</strong></a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Conozca a Cline, un asistente de IA que puede usar su **CLI** y **E**ditor.
|
||||
|
||||
Gracias a las [habilidades de codificación agencial de Claude 4 Sonnet](https://www.anthropic.com/claude/sonnet), Cline puede abordar tareas complejas de desarrollo de software paso a paso. Con herramientas que le permiten crear y editar archivos, explorar grandes proyectos, usar el navegador y ejecutar comandos de terminal (con su aprobación), puede ayudarle de una manera que va más allá de la autocompletación de código o el soporte técnico. Cline incluso puede usar el Model Context Protocol (MCP) para crear nuevas herramientas y expandir sus propias capacidades. Mientras que los scripts de IA autónomos tradicionalmente se ejecutan en entornos aislados, esta extensión ofrece una GUI con un humano en el bucle para aprobar cada cambio de archivo y comando de terminal, proporcionando una forma segura y accesible de explorar el potencial de la IA agencial.
|
||||
|
||||
1. Ingrese su tarea y agregue imágenes para convertir maquetas en aplicaciones funcionales o solucionar errores con capturas de pantalla.
|
||||
2. Cline comenzará analizando su estructura de archivos y ASTs de código fuente, realizando búsquedas Regex y leyendo archivos relevantes para orientarse en proyectos existentes. Al gestionar cuidadosamente la información agregada, Cline puede proporcionar asistencia valiosa incluso en proyectos grandes y complejos sin sobrecargar la ventana de contexto.
|
||||
3. Una vez que Cline tenga la información necesaria, puede:
|
||||
- Crear y editar archivos + monitorear errores de Linter/Compilador, para que pueda solucionar proactivamente problemas como importaciones faltantes y errores de sintaxis.
|
||||
- Ejecutar comandos directamente en su terminal y monitorear su salida, para que pueda responder a problemas del servidor de desarrollo después de editar un archivo.
|
||||
- Para tareas de desarrollo web, Cline puede iniciar el sitio web en un navegador sin cabeza, hacer clic, escribir, desplazarse y capturar capturas de pantalla + registros de consola, para que pueda solucionar errores de tiempo de ejecución y errores visuales.
|
||||
4. Cuando una tarea esté completa, Cline le presentará el resultado con un comando de terminal como `open -a "Google Chrome" index.html`, que puede ejecutar con un clic en un botón.
|
||||
|
||||
> [!TIP]
|
||||
> Use el atajo de teclado `CMD/CTRL + Shift + P` para abrir la paleta de comandos y escriba "Cline: Open In New Tab" para abrir la extensión como una pestaña en su editor. De esta manera, puede usar Cline junto a su explorador de archivos y ver más claramente cómo cambia su espacio de trabajo.
|
||||
|
||||
---
|
||||
|
||||
<img align="right" width="340" src="https://github.com/user-attachments/assets/3cf21e04-7ce9-4d22-a7b9-ba2c595e88a4">
|
||||
|
||||
### Use cualquier API y modelo
|
||||
|
||||
Cline admite proveedores de API como OpenRouter, Anthropic, OpenAI, Google Gemini, AWS Bedrock, Azure y GCP Vertex. También puede configurar cualquier API compatible con OpenAI o usar un modelo local a través de LM Studio/Ollama. Si usa OpenRouter, la extensión recupera su lista de modelos más reciente, para que pueda usar los modelos más nuevos tan pronto como estén disponibles.
|
||||
|
||||
La extensión también rastrea el uso total de tokens y costos de API para todo el ciclo de tareas y solicitudes individuales, para que esté informado sobre los gastos en cada paso.
|
||||
|
||||
<!-- Pixel transparente para crear un salto de línea después de la imagen flotante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/81be79a8-1fdb-4028-9129-5fe055e01e76">
|
||||
|
||||
### Ejecutar comandos en el terminal
|
||||
|
||||
Gracias a las nuevas [actualizaciones de integración de Shell en VSCode v1.93](https://code.visualstudio.com/updates/v1_93#_terminal-shell-integration-api), Cline puede ejecutar comandos directamente en su terminal y recibir la salida. Esto le permite realizar una variedad de tareas, desde la instalación de paquetes y la ejecución de scripts de compilación hasta la implementación de aplicaciones, la gestión de bases de datos y la ejecución de pruebas, adaptándose a su entorno de desarrollo y cadena de herramientas para hacer el trabajo correctamente.
|
||||
|
||||
Para procesos de larga duración como servidores de desarrollo, use el botón "Continuar mientras se ejecuta" para permitir que Cline continúe con la tarea mientras el comando se ejecuta en segundo plano. Mientras Cline trabaja, será notificado sobre nuevas salidas del terminal, para que pueda responder a problemas que puedan surgir, como errores de compilación al editar archivos.
|
||||
|
||||
<!-- Pixel transparente para crear un salto de línea después de la imagen flotante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="400" src="https://github.com/user-attachments/assets/c5977833-d9b8-491e-90f9-05f9cd38c588">
|
||||
|
||||
### Crear y editar archivos
|
||||
|
||||
Cline puede crear y editar archivos directamente en su editor y presentarle una vista de diferencias de los cambios. Puede editar o deshacer los cambios de Cline directamente en el editor de vista de diferencias o proporcionar comentarios en el chat hasta que esté satisfecho con el resultado. Cline también monitorea errores de Linter/Compilador (importaciones faltantes, errores de sintaxis, etc.), para que pueda solucionar problemas que surjan en el camino.
|
||||
|
||||
Todos los cambios realizados por Cline se registran en la línea de tiempo de su archivo, proporcionando una forma sencilla de rastrear cambios y deshacerlos si es necesario.
|
||||
|
||||
<!-- Pixel transparente para crear un salto de línea después de la imagen flotante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/bc2e85ba-dfeb-4fe6-9942-7cfc4703cbe5">
|
||||
|
||||
### Usar el navegador
|
||||
|
||||
Con la nueva [habilidad de uso de computadora](https://www.anthropic.com/news/3-5-models-and-computer-use) de Claude 4 Sonnet, Cline puede iniciar un navegador, hacer clic en elementos, escribir texto y desplazarse, capturando capturas de pantalla y registros de consola. Esto permite la depuración interactiva, pruebas de extremo a extremo e incluso el uso general de la web. Esto le da la autonomía para solucionar errores visuales y problemas de tiempo de ejecución sin que tenga que copiar y pegar registros de errores.
|
||||
|
||||
Intente pedirle a Cline que "pruebe la aplicación" y observe cómo ejecuta un comando como `npm run dev`, inicia su servidor de desarrollo local en un navegador y realiza una serie de pruebas para confirmar que todo funciona. [Vea una demostración aquí.](https://x.com/sdrzn/status/1850880547825823989)
|
||||
|
||||
<!-- Pixel transparente para crear un salto de línea después de la imagen flotante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/ac0efa14-5c1f-4c26-a42d-9d7c56f5fadd">
|
||||
|
||||
### "agregar una herramienta que..."
|
||||
|
||||
Gracias al [Model Context Protocol](https://github.com/modelcontextprotocol), Cline puede expandir sus habilidades mediante herramientas personalizadas. Mientras que puede usar [servidores creados por la comunidad](https://github.com/modelcontextprotocol/servers), Cline puede en su lugar crear e instalar herramientas adaptadas a su flujo de trabajo específico. Simplemente pida a Cline que "agregue una herramienta" y él se encargará de todo, desde la creación de un nuevo servidor MCP hasta la instalación en la extensión. Estas herramientas personalizadas se convierten en parte del conjunto de herramientas de Cline y están listas para ser utilizadas en tareas futuras.
|
||||
|
||||
- "agregar una herramienta que recupere tickets de Jira": Recuperar ACs de tickets y poner a Cline a trabajar
|
||||
- "agregar una herramienta que gestione AWS EC2s": Verificar métricas del servidor y escalar instancias hacia arriba o hacia abajo
|
||||
- "agregar una herramienta que recupere los últimos incidentes de PagerDuty": Recuperar detalles y pedir a Cline que solucione errores
|
||||
|
||||
<!-- Pixel transparente para crear un salto de línea después de la imagen flotante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="360" src="https://github.com/user-attachments/assets/7fdf41e6-281a-4b4b-ac19-020b838b6970">
|
||||
|
||||
### Agregar contexto
|
||||
|
||||
**`@url`:** Inserte una URL para que la extensión la recupere y convierta en Markdown, útil cuando desee proporcionar a Cline los documentos más recientes
|
||||
|
||||
**`@problems`:** Agregue errores y advertencias del espacio de trabajo (panel 'Problemas') que Cline debe solucionar
|
||||
|
||||
**`@file`:** Agregue el contenido de un archivo para que no tenga que desperdiciar solicitudes de API para aprobar la lectura del archivo (+ para buscar archivos)
|
||||
|
||||
**`@folder`:** Agregue los archivos de una carpeta a la vez para acelerar aún más su flujo de trabajo
|
||||
|
||||
<!-- Pixel transparente para crear un salto de línea después de la imagen flotante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/140c8606-d3bf-41b9-9a1f-4dbf0d4c90cb">
|
||||
|
||||
### Puntos de control: Comparar y Restaurar
|
||||
|
||||
Mientras Cline trabaja en una tarea, la extensión crea una instantánea de su espacio de trabajo en cada paso. Puede usar el botón 'Comparar' para ver una diferencia entre la instantánea y su espacio de trabajo actual, y el botón 'Restaurar' para volver a ese punto.
|
||||
|
||||
Por ejemplo, si está trabajando con un servidor web local, puede usar 'Restaurar solo espacio de trabajo' para probar rápidamente diferentes versiones de su aplicación, y luego 'Restaurar tarea y espacio de trabajo' cuando encuentre la versión desde la que desea continuar trabajando. Esto le permite explorar diferentes enfoques de manera segura sin perder progreso.
|
||||
|
||||
<!-- Pixel transparente para crear un salto de línea después de la imagen flotante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
## Contribuir
|
||||
|
||||
Para contribuir al proyecto, comience con nuestra [guía de contribución](CONTRIBUTING.md) para aprender los conceptos básicos. También puede unirse a nuestro [Discord](https://discord.gg/cline) para chatear con otros colaboradores en el canal `#contributors`. Si está buscando un trabajo a tiempo completo, consulte nuestras vacantes en nuestra [página de carreras](https://cline.bot/join-us).
|
||||
|
||||
<details>
|
||||
<summary>Instrucciones de desarrollo local</summary>
|
||||
|
||||
1. Clone el repositorio _(Requiere [git-lfs](https://git-lfs.com/))_:
|
||||
```bash
|
||||
git clone https://github.com/cline/cline.git
|
||||
```
|
||||
2. Abra el proyecto en VSCode:
|
||||
```bash
|
||||
code cline
|
||||
```
|
||||
3. Instale las dependencias necesarias para la extensión y la GUI de Webview:
|
||||
```bash
|
||||
npm run install:all
|
||||
```
|
||||
4. Inicie presionando `F5` (o `Run`->`Start Debugging`) para abrir una nueva ventana de VSCode con la extensión cargada. (Es posible que deba instalar la [extensión de emparejadores de problemas de esbuild](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers) si encuentra problemas al compilar el proyecto.)
|
||||
|
||||
</details>
|
||||
|
||||
## Licencia
|
||||
|
||||
[Apache 2.0 © 2025 Cline Bot Inc.](./LICENSE)
|
||||
@@ -0,0 +1,47 @@
|
||||
# コントリビューター規約行動規範
|
||||
|
||||
## 我々の誓い
|
||||
|
||||
オープンで歓迎される環境を育むために、我々はコントリビューターおよびメンテナーとして、年齢、体型、障害、民族、性の特徴、性別のアイデンティティおよび表現、経験のレベル、教育、社会経済的地位、国籍、個人の外見、人種、宗教、または性的アイデンティティおよび指向に関係なく、プロジェクトおよびコミュニティへの参加がハラスメントのない体験となるよう誓います。
|
||||
|
||||
## 我々の基準
|
||||
|
||||
ポジティブな環境を作り出す行動の例としては、以下のものがあります:
|
||||
|
||||
- 歓迎的で包括的な言葉を使うこと
|
||||
- 異なる視点や経験を尊重すること
|
||||
- 建設的な批判を優雅に受け入れること
|
||||
- コミュニティのために最善を尽くすことに集中すること
|
||||
- 他のコミュニティメンバーに対して共感を示すこと
|
||||
|
||||
参加者による許容できない行動の例としては、以下のものがあります:
|
||||
|
||||
- 性的な言葉や画像の使用、望まれない性的関心やアプローチ
|
||||
- 荒らし、侮辱的/軽蔑的なコメント、個人的または政治的な攻撃
|
||||
- 公的または私的なハラスメント
|
||||
- 明示的な許可なしに他人の個人情報(物理的または電子的な住所など)を公開すること
|
||||
- プロフェッショナルな環境で不適切と合理的に見なされるその他の行動
|
||||
|
||||
## 我々の責任
|
||||
|
||||
プロジェクトのメンテナーは、許容される行動の基準を明確にする責任があり、不適切な行動の事例に対して適切かつ公平な是正措置を講じることが期待されています。
|
||||
|
||||
プロジェクトのメンテナーは、この行動規範に沿わないコメント、コミット、コード、ウィキの編集、問題、およびその他の貢献を削除、編集、または拒否する権利と責任を持ち、また、不適切、脅迫的、攻撃的、または有害と見なされるその他の行動を行ったコントリビューターを一時的または永久に禁止する権利と責任を持ちます。
|
||||
|
||||
## 範囲
|
||||
|
||||
この行動規範は、プロジェクトスペース内およびプロジェクトやコミュニティを代表する個人が公の場で行動する場合に適用されます。プロジェクトやコミュニティを代表する例としては、公式のプロジェクトメールアドレスを使用すること、公式のソーシャルメディアアカウントを通じて投稿すること、またはオンラインまたはオフラインのイベントで任命された代表として行動することが含まれます。プロジェクトの代表としての行動は、プロジェクトのメンテナーによってさらに定義および明確化される場合があります。
|
||||
|
||||
## 執行
|
||||
|
||||
虐待的、嫌がらせ、またはその他の許容できない行動の事例は、プロジェクトチームに hi@cline.bot まで報告することができます。すべての苦情はレビューおよび調査され、状況に応じて必要かつ適切な対応が行われます。プロジェクトチームは、事件の報告者に関する機密性を保持する義務があります。具体的な執行ポリシーの詳細は別途掲載される場合があります。
|
||||
|
||||
行動規範を誠実に遵守または執行しないプロジェクトのメンテナーは、プロジェクトのリーダーシップの他のメンバーによって一時的または永久的な影響を受ける可能性があります。
|
||||
|
||||
## 帰属
|
||||
|
||||
この行動規範は、[Contributor Covenant][homepage] バージョン 1.4 から適応されており、https://www.contributor-covenant.org/version/1/4/code-of-conduct.html で入手できます。
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
この行動規範に関する一般的な質問への回答については、https://www.contributor-covenant.org/faq を参照してください。
|
||||
@@ -0,0 +1,82 @@
|
||||
# Cline
|
||||
|
||||
Clineへの貢献に興味をお持ちいただきありがとうございます。
|
||||
|
||||
## バグや問題の報告
|
||||
|
||||
バグ報告は、Clineを皆さんにとってより良いものにするために役立ちます!新しい問題を作成する前に、重複を避けるために[既存の問題を検索](https://github.com/cline/cline/issues)してください。バグを報告する準備ができたら、[問題ページ](https://github.com/cline/cline/issues/new/choose)に移動し、関連情報を記入するためのテンプレートをご利用ください。
|
||||
|
||||
<blockquote class='warning-note'>
|
||||
🔐 <b>重要:</b> セキュリティ脆弱性を発見した場合は、<a href="https://github.com/cline/cline/security/advisories/new">Githubセキュリティツールを使用して非公開で報告</a>してください。
|
||||
</blockquote>
|
||||
|
||||
## 作業内容の決定
|
||||
|
||||
最初の貢献をお探しですか?["good first issue"](https://github.com/cline/cline/labels/good%20first%20issue)や["help wanted"](https://github.com/cline/cline/labels/help%20wanted)のラベルが付いた問題をチェックしてください。これらは新しい貢献者向けに特に選ばれたもので、私たちが助けを求めている分野です!
|
||||
|
||||
また、[ドキュメント](https://github.com/cline/cline/tree/main/docs)への貢献も歓迎します!誤字の修正、既存のガイドの改善、新しい教育コンテンツの作成など、コミュニティ主導のリソースリポジトリを構築するために皆さんの力をお借りしたいと考えています。`/docs`に飛び込んで、改善が必要な箇所を探してみてください。
|
||||
|
||||
大きな機能に取り組む予定がある場合は、まず[機能リクエスト](https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop)を作成し、それがClineのビジョンに合致するかどうかを議論しましょう。
|
||||
|
||||
## 開発環境のセットアップ
|
||||
|
||||
1. **VS Code拡張機能**
|
||||
|
||||
- プロジェクトを開くと、VS Codeは推奨される拡張機能のインストールを促します
|
||||
- これらの拡張機能は開発に必要です - すべてのインストールプロンプトを受け入れてください
|
||||
- プロンプトを閉じた場合は、拡張機能パネルから手動でインストールできます
|
||||
|
||||
2. **ローカル開発**
|
||||
- `npm run install:all`を実行して依存関係をインストールします
|
||||
- `npm run test`を実行してローカルでテストを実行します
|
||||
- PRを提出する前に、`npm run format:fix`を実行してコードをフォーマットします
|
||||
|
||||
## コードの作成と提出
|
||||
|
||||
誰でもClineにコードを貢献できますが、貢献がスムーズに統合されるように以下のガイドラインに従ってください:
|
||||
|
||||
1. **プルリクエストを集中させる**
|
||||
|
||||
- PRは単一の機能またはバグ修正に限定してください
|
||||
- 大きな変更は小さな関連PRに分割してください
|
||||
- 論理的なコミットに分けて、独立してレビューできるようにしてください
|
||||
|
||||
2. **コード品質**
|
||||
|
||||
- `npm run lint`を実行してコードスタイルをチェックします
|
||||
- `npm run format`を実行してコードを自動的にフォーマットします
|
||||
- すべてのPRは、リンティングとフォーマットを含むCIチェックに合格する必要があります
|
||||
- 提出前にESLintの警告やエラーをすべて解決してください
|
||||
- TypeScriptのベストプラクティスに従い、型の安全性を維持してください
|
||||
|
||||
3. **テスト**
|
||||
|
||||
- 新しい機能にはテストを追加してください
|
||||
- `npm test`を実行してすべてのテストが合格することを確認してください
|
||||
- 変更が既存のテストに影響を与える場合は、それらを更新してください
|
||||
- 適切な場合には、ユニットテストと統合テストの両方を含めてください
|
||||
|
||||
4. **コミットガイドライン**
|
||||
|
||||
- 明確で説明的なコミットメッセージを書いてください
|
||||
- 従来のコミット形式(例:"feat:", "fix:", "docs:")を使用してください
|
||||
- コミットで関連する問題を#issue-numberを使用して参照してください
|
||||
|
||||
5. **提出前に**
|
||||
|
||||
- 最新のmainにブランチをリベースしてください
|
||||
- ブランチが正常にビルドされることを確認してください
|
||||
- すべてのテストが合格していることを再確認してください
|
||||
- デバッグコードやコンソールログがないか変更を確認してください
|
||||
|
||||
6. **プルリクエストの説明**
|
||||
- 変更内容を明確に説明してください
|
||||
- 変更をテストする手順を含めてください
|
||||
- 破壊的な変更がある場合はリストしてください
|
||||
- UIの変更にはスクリーンショットを追加してください
|
||||
|
||||
## 貢献契約
|
||||
|
||||
プルリクエストを提出することで、あなたの貢献がプロジェクトと同じライセンス([Apache 2.0](LICENSE))の下でライセンスされることに同意したことになります。
|
||||
|
||||
覚えておいてください:Clineへの貢献はコードを書くことだけではなく、AI支援開発の未来を形作るコミュニティの一員になることです。一緒に素晴らしいものを作りましょう!🚀
|
||||
@@ -0,0 +1,161 @@
|
||||
# Cline
|
||||
|
||||
<p align="center">
|
||||
<img src="https://media.githubusercontent.com/media/cline/cline/main/assets/docs/demo.gif" width="100%" />
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<table>
|
||||
<tbody>
|
||||
<td align="center">
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev" target="_blank"><strong>VS Marketplaceでダウンロード</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://discord.gg/cline" target="_blank"><strong>Discord</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://www.reddit.com/r/cline/" target="_blank"><strong>r/cline</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop" target="_blank"><strong>機能リクエスト</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://cline.bot/join-us" target="_blank"><strong>採用情報</strong></a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Clineは、**CLI**と**エディター**を使用できるAIアシスタントです。
|
||||
|
||||
[Claude 4 Sonnetのエージェント的コーディング機能](https://www.anthropic.com/claude/sonnet)のおかげで、Clineは複雑なソフトウェア開発タスクをステップバイステップで処理できます。ファイルの作成と編集、大規模プロジェクトの探索、ブラウザの使用、ターミナルコマンドの実行(許可後)などのツールを使用して、コード補完や技術サポートを超えた支援を提供します。Clineは、Model Context Protocol (MCP)を使用して新しいツールを作成し、自身の機能を拡張することもできます。自律的なAIスクリプトは通常サンドボックス環境で実行されますが、この拡張機能はファイル変更やターミナルコマンドを承認するための人間インターフェースを提供し、エージェント的AIの可能性を安全かつアクセスしやすい方法で探求できます。
|
||||
|
||||
1. タスクを入力し、モックアップを機能するアプリに変換したり、スクリーンショットでバグを修正したりします。
|
||||
2. Clineは、ファイル構造とソースコードASTの分析、正規表現検索の実行、関連ファイルの読み取りから始め、既存プロジェクトに精通します。コンテキストに追加される情報を慎重に管理することで、大規模で複雑なプロジェクトでもコンテキストウィンドウを圧倒することなく貴重な支援を提供できます。
|
||||
3. Clineが必要な情報を取得すると、次のことができます:
|
||||
- ファイルの作成と編集 + リンター/コンパイラーエラーの監視を行い、欠落したインポートや構文エラーなどの問題を自動的に修正します。
|
||||
- ターミナルでコマンドを直接実行し、作業中に出力を監視します。これにより、ファイル編集後の開発サーバーの問題に対応できます。
|
||||
- ウェブ開発タスクでは、ヘッドレスブラウザでサイトを起動し、クリック、入力、スクロール、スクリーンショットとコンソールログのキャプチャを行い、ランタイムエラーや視覚的なバグを修正します。
|
||||
4. タスクが完了すると、Clineは`open -a "Google Chrome" index.html`のようなターミナルコマンドを提示し、ボタンをクリックして実行できます。
|
||||
|
||||
> [!TIP]
|
||||
> `CMD/CTRL + Shift + P`ショートカットを使用してコマンドパレットを開き、「Cline: Open In New Tab」と入力して、エディターのタブとして拡張機能を開きます。これにより、ファイルエクスプローラーと並行してClineを使用し、ワークスペースの変更をより明確に確認できます。
|
||||
|
||||
---
|
||||
|
||||
<img align="right" width="340" src="https://github.com/user-attachments/assets/3cf21e04-7ce9-4d22-a7b9-ba2c595e88a4">
|
||||
|
||||
### どのAPIやモデルでも使用可能
|
||||
|
||||
Clineは、OpenRouter、Anthropic、OpenAI、Google Gemini、AWS Bedrock、Azure、GCP VertexなどのAPIプロバイダーをサポートしています。また、OpenAI互換のAPIを設定したり、LM Studio/Ollamaを通じてローカルモデルを使用することもできます。OpenRouterを使用している場合、拡張機能は最新のモデルリストを取得し、最新のモデルをすぐに使用できるようにします。
|
||||
|
||||
拡張機能は、タスクループ全体と個々のリクエストのトークン総数とAPI使用コストを追跡し、各ステップで支出を把握できます。
|
||||
|
||||
<!-- 透明なピクセルで浮動画像の後に改行を作成 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/81be79a8-1fdb-4028-9129-5fe055e01e76">
|
||||
|
||||
### ターミナルでコマンドを実行
|
||||
|
||||
VSCode v1.93の新しい[シェル統合アップデート](https://code.visualstudio.com/updates/v1_93#_terminal-shell-integration-api)のおかげで、Clineはターミナルでコマンドを直接実行し、出力を受け取ることができます。これにより、パッケージのインストールやビルドスクリプトの実行からアプリケーションのデプロイ、データベースの管理、テストの実行まで、幅広いタスクを実行できます。Clineは、開発環境とツールチェーンに適応して、タスクを正確に実行します。
|
||||
|
||||
開発サーバーのような長時間実行されるプロセスの場合、「実行中に続行」ボタンを使用して、コマンドがバックグラウンドで実行されている間にClineがタスクを続行できるようにします。Clineが作業を進める中で、新しいターミナル出力が通知され、ファイル編集時のコンパイルエラーなどの問題に対応できます。
|
||||
|
||||
<!-- 透明なピクセルで浮動画像の後に改行を作成 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="400" src="https://github.com/user-attachments/assets/c5977833-d9b8-491e-90f9-05f9cd38c588">
|
||||
|
||||
### ファイルの作成と編集
|
||||
|
||||
Clineはエディター内でファイルを作成および編集し、変更の差分ビューを提示します。差分ビューエディターでClineの変更を直接編集または元に戻すことができ、チャットでフィードバックを提供して満足するまで調整できます。Clineはリンター/コンパイラーエラー(欠落したインポート、構文エラーなど)も監視し、発生した問題を自動的に修正します。
|
||||
|
||||
Clineによるすべての変更はファイルのタイムラインに記録され、必要に応じて変更を追跡および元に戻す簡単な方法を提供します。
|
||||
|
||||
<!-- 透明なピクセルで浮動画像の後に改行を作成 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/bc2e85ba-dfeb-4fe6-9942-7cfc4703cbe5">
|
||||
|
||||
### ブラウザの使用
|
||||
|
||||
Claude 4 Sonnetの新しい[コンピュータ使用](https://www.anthropic.com/news/3-5-models-and-computer-use)機能により、Clineはブラウザを起動し、要素をクリック、テキストを入力、スクロールし、各ステップでスクリーンショットとコンソールログをキャプチャできます。これにより、インタラクティブなデバッグ、エンドツーエンドテスト、さらには一般的なウェブ使用が可能になります。これにより、エラーログを手動でコピー&ペーストすることなく、視覚的なバグやランタイムの問題を自律的に修正できます。
|
||||
|
||||
Clineに「アプリをテストして」と頼んでみてください。彼は`npm run dev`のようなコマンドを実行し、ローカルで実行中の開発サーバーをブラウザで起動し、一連のテストを実行してすべてが正常に動作することを確認します。[デモはこちら。](https://x.com/sdrzn/status/1850880547825823989)
|
||||
|
||||
<!-- 透明なピクセルで浮動画像の後に改行を作成 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/ac0efa14-5c1f-4c26-a42d-9d7c56f5fadd">
|
||||
|
||||
### 「ツールを追加して...」
|
||||
|
||||
[Model Context Protocol](https://github.com/modelcontextprotocol)のおかげで、Clineはカスタムツールを通じて機能を拡張できます。[コミュニティ製サーバー](https://github.com/modelcontextprotocol/servers)を使用することもできますが、Clineは代わりに特定のワークフローに合わせたツールを作成してインストールできます。「ツールを追加して」と頼むだけで、Clineは新しいMCPサーバーの作成から拡張機能へのインストールまでをすべて処理します。これらのカスタムツールはClineのツールキットの一部となり、将来のタスクで使用できるようになります。
|
||||
|
||||
- 「Jiraチケットを取得するツールを追加して」:チケットACを取得し、Clineに作業を依頼
|
||||
- 「AWS EC2を管理するツールを追加して」:サーバーメトリクスを確認し、インスタンスをスケールアップまたはダウン
|
||||
- 「最新のPagerDutyインシデントを取得するツールを追加して」:詳細を取得し、Clineにバグ修正を依頼
|
||||
|
||||
<!-- 透明なピクセルで浮動画像の後に改行を作成 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="360" src="https://github.com/user-attachments/assets/7fdf41e6-281a-4b4b-ac19-020b838b6970">
|
||||
|
||||
### コンテキストを追加
|
||||
|
||||
**`@url`:** 最新のドキュメントをClineに提供したい場合に、URLを貼り付けて拡張機能が取得し、Markdownに変換します。
|
||||
|
||||
**`@problems`:** Clineが修正するためのワークスペースエラーと警告(「問題」パネル)を追加します。
|
||||
|
||||
**`@file`:** ファイルの内容を追加し、読み取りファイルを承認するAPIリクエストを節約します(+ファイルを検索して入力)。
|
||||
|
||||
**`@folder`:** フォルダーのファイルを一度に追加して、ワークフローをさらにスピードアップします。
|
||||
|
||||
<!-- 透明なピクセルで浮動画像の後に改行を作成 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/140c8606-d3bf-41b9-9a1f-4dbf0d4c90cb">
|
||||
|
||||
### チェックポイント:比較と復元
|
||||
|
||||
Clineがタスクを進める中で、拡張機能は各ステップでワークスペースのスナップショットを撮ります。「比較」ボタンを使用してスナップショットと現在のワークスペースの差分を確認し、「復元」ボタンを使用してそのポイントにロールバックできます。
|
||||
|
||||
たとえば、ローカルウェブサーバーで作業している場合、「ワークスペースのみを復元」を使用して異なるバージョンのアプリを迅速にテストし、「タスクとワークスペースを復元」を使用して続行したいバージョンを見つけたときに使用します。これにより、進行状況を失うことなく異なるアプローチを安全に探求できます。
|
||||
|
||||
<!-- 透明なピクセルで浮動画像の後に改行を作成 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
## 貢献
|
||||
|
||||
プロジェクトに貢献するには、[貢献ガイド](CONTRIBUTING.md)から基本を学び始めてください。また、[Discord](https://discord.gg/cline)に参加して、`#contributors`チャンネルで他の貢献者とチャットすることもできます。フルタイムの仕事を探している場合は、[採用ページ](https://cline.bot/join-us)でオープンポジションを確認してください。
|
||||
|
||||
<details>
|
||||
<summary>ローカル開発の手順</summary>
|
||||
|
||||
1. リポジトリをクローンします _(Requires [git-lfs](https://git-lfs.com/))_:
|
||||
```bash
|
||||
git clone https://github.com/cline/cline.git
|
||||
```
|
||||
2. プロジェクトをVSCodeで開きます:
|
||||
```bash
|
||||
code cline
|
||||
```
|
||||
3. 拡張機能とwebview-guiの必要な依存関係をインストールします:
|
||||
```bash
|
||||
npm run install:all
|
||||
```
|
||||
4. `F5`を押して(または`Run`->`Start Debugging`)、拡張機能が読み込まれた新しいVSCodeウィンドウを開きます。(プロジェクトのビルドに問題がある場合は、[esbuild problem matchers extension](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers)をインストールする必要があるかもしれません。)
|
||||
|
||||
</details>
|
||||
|
||||
## ライセンス
|
||||
|
||||
[Apache 2.0 © 2025 Cline Bot Inc.](./LICENSE)
|
||||
@@ -0,0 +1,47 @@
|
||||
# 기여자 행동 강령
|
||||
|
||||
## 서약
|
||||
|
||||
우리는 개방적이고 환영하는 환경을 조성하기 위해 노력하며, 기여자 및 유지 관리자로서 모든 사람이 차별과 괴롭힘 없이 프로젝트와 커뮤니티에 참여할 수 있도록 최선을 다할 것을 서약합니다. 이는 연령, 체형, 장애, 민족성, 성적 특성, 성 정체성 및 표현, 경험 수준, 교육 수준, 사회·경제적 지위, 국적, 외모, 인종, 종교, 성 정체성과 성적 지향에 관계없이 모든 사람에게 적용됩니다.
|
||||
|
||||
## 행동 기준
|
||||
|
||||
긍정적인 환경을 조성하기 위한 바람직한 행동의 예시:
|
||||
|
||||
- 환영하고 포용적인 언어 사용하기
|
||||
- 서로 다른 관점과 경험을 존중하기
|
||||
- 건설적인 비판을 우아하게 수용하기
|
||||
- 커뮤니티에 최선이 되는 것에 집중하기
|
||||
- 다른 커뮤니티 구성원들에 대한 공감 보여주기
|
||||
|
||||
참여자가 해서는 안 되는 행동의 예시:
|
||||
|
||||
- 성적인 언어와 이미지 사용, 원치 않는 성적 관심이나 접근
|
||||
- 트롤링, 모욕적/경멸적인 댓글, 개인적 또는 정치적 공격
|
||||
- 공개적 또는 사적인 괴롭힘
|
||||
- 상대방의 동의 없이 개인정보(실제 주소나 전자 주소 등) 공개하기
|
||||
- 전문적 환경에서 부적절하다고 여겨질 수 있는 기타 행위
|
||||
|
||||
## 책임
|
||||
|
||||
프로젝트 유지 관리자는 허용 가능한 행동 기준을 명확히 설명할 책임이 있으며, 부적절한 행동이 발생할 경우 적절하고 공정한 시정 조치를 취해야 합니다.
|
||||
|
||||
프로젝트 유지 관리자는 본 행동 강령에 부합하지 않는 댓글, 커밋, 코드, 위키 수정, 이슈 및 기타 기여를 삭제, 수정 또는 거부할 권리와 책임이 있으며, 부적절하다고 판단되는 행동(위협적이거나, 공격적이거나, 해로운 행위 등)을 한 기여자를 일시적 또는 영구적으로 차단할 권리를 가집니다.
|
||||
|
||||
## 범위
|
||||
|
||||
이 행동 강령은 프로젝트 공간과 개인이 프로젝트나 커뮤니티를 대표하는 공개 공간에서 모두 적용됩니다. 프로젝트 또는 커뮤니티를 대표하는 예로는 공식 프로젝트 이메일 주소 사용, 공식 소셜 미디어 계정을 통한 게시, 온라인 또는 오프라인 행사에서 지정된 대표자로 활동하는 경우 등이 포함됩니다. 프로젝트의 대표성은 프로젝트 유지 관리자가 추가로 정의하고 명확히 할 수 있습니다.
|
||||
|
||||
## 집행
|
||||
|
||||
학대, 괴롭힘 또는 기타 용납할 수 없는 행동은 프로젝트 팀에 hi@cline.bot을 통해 신고 할 수 있습니다. 모든 신고는 검토 및 조사되며, 상황에 따라 필요하고 적절한 조치가 취해질 것입니다. 프로젝트 팀은 사건 신고자의 신원을 보호할 의무가 있습니다. 특정 시행 정책에 대한 추가 세부 사항은 별도로 게시될 수 있습니다.
|
||||
|
||||
행동 강령을 성실히 준수하거나 집행하지 않는 프로젝트 유지관리자는 프로젝트 리더십의 구성원에 의해 일시적 또는 영구적인 제재를 받을 수 있습니다.
|
||||
|
||||
## 출처
|
||||
|
||||
이 행동 강령은 [Contributor Covenant][homepage] 버전 1.4에서 수정되었으며, https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 에서 확인할 수 있습니다.
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
이 행동 강령에 대한 일반적인 질문에 대한 답변은 https://www.contributor-covenant.org/faq 를 참조하시기 바랍니다.
|
||||
@@ -0,0 +1,87 @@
|
||||
# Cline
|
||||
|
||||
Cline에 기여하는 것에 관심을 가져주셔서 감사합니다! 버그 수정, 기능 추가, 문서 개선 등 모든 기여는 Cline을 더욱 스마트하게 만드는 데 기여합니다. 활기차고 환영하는 커뮤니티를 유지하기 위해 모든 구성원은 [행동 강령](CODE_OF_CONDUCT.md)을 준수해야 합니다.
|
||||
|
||||
## 버그와 문제 보고
|
||||
|
||||
버그 보고는 Cline을 모두에게 더 나은 것으로 만드는 데 도움이 됩니다! 새로운 이슈를 생성하기 전에, 중복을 피하기 위해 [기존 이슈를 검색](https://github.com/cline/cline/issues)해 주세요. 버그를 보고할 준비가 되었다면, [이슈 페이지](https://github.com/cline/cline/issues/new/choose)로 이동하여 관련 정보를 작성하기 위한 템플릿을 사용해 주세요.
|
||||
|
||||
<blockquote class='warning-note'>
|
||||
🔐 <b>중요:</b> 보안 취약점을 발견한 경우, <a href="https://github.com/cline/cline/security/advisories/new">GitHub 보안 도구를 사용하여 비공개로 보고</a>해 주세요.
|
||||
</blockquote>
|
||||
|
||||
## 작업 내용 결정하기
|
||||
|
||||
첫 기여를 찾고 계신가요? ["good first issue"](https://github.com/cline/cline/labels/good%20first%20issue)나 ["help wanted"](https://github.com/cline/cline/labels/help%20wanted) 라벨이 붙은 이슈를 확인해 보세요. 이러한 이슈들은 새로운 기여자를 위해 특별히 선정된 작업으로, 도움이 필요한 영역이 표시되어 있습니다!
|
||||
|
||||
또한, [문서](https://github.com/cline/cline/tree/main/docs)에 대한 기여도 환영합니다! 오타 수정, 기존 가이드 개선, 새로운 교육 콘텐츠 작성 등, 커뮤니티 주도의 리소스 저장소를 구축하는 데 여러분의 도움이 필요합니다. `/docs`를 살펴보고 개선이 필요한 부분을 찾아보세요.
|
||||
|
||||
큰 기능에 대해 작업할 계획이 있다면, 먼저 [기능 요청](https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop)을 생성하여 이것이 Cline의 비전과 부합하는지 논의하는 것이 좋습니다.
|
||||
|
||||
## 개발 환경 설정
|
||||
|
||||
1. **VS Code 확장 프로그램**
|
||||
|
||||
- 프로젝트를 열면 VS Code가 권장 확장 프로그램 설치를 안내합니다
|
||||
- 개발을 위해 이 확장 프로그램들이 필요하므로, 설치 안내를 수락해 주세요.
|
||||
- 프롬프트를 닫은 경우 확장 프로그램 패널에서 수동으로 설치할 수 있습니다
|
||||
|
||||
2. **로컬 개발**
|
||||
- `npm run install:all`을 실행하여 의존성을 설치합니다
|
||||
- `npm run test`를 실행하여 로컬에서 테스트를 실행합니다
|
||||
- PR을 제출하기 전에 `npm run format:fix`를 실행하여 코드를 포맷팅합니다
|
||||
|
||||
## 코드 작성과 제출
|
||||
|
||||
누구나 Cline에 코드를 기여할 수 있지만, 기여가 원활하게 통합되도록 다음 가이드라인을 따라주세요:
|
||||
|
||||
1. **Pull Request 집중하기**
|
||||
|
||||
- PR은 단일 기능 또는 버그 수정으로 제한해 주세요
|
||||
- 큰 변경사항은 작은 관련 PR로 분할해 주세요
|
||||
- 논리적으로 독립적인 커밋 단위로 나누어 리뷰가 용이하도록 구성하세요.
|
||||
|
||||
2. **코드 품질**
|
||||
|
||||
- `npm run lint`를 실행하여 코드 스타일을 체크합니다
|
||||
- `npm run format`을 실행하여 코드를 자동으로 포맷팅합니다
|
||||
- 모든 PR은 린팅과 포맷팅을 포함한 CI 체크를 통과해야 합니다
|
||||
- 제출 전에 ESLint 경고나 에러를 모두 해결해 주세요
|
||||
- TypeScript 모범 사례를 따르고, 타입 안전성을 유지해 주세요
|
||||
|
||||
3. **테스트**
|
||||
|
||||
- 새로운 기능에는 테스트를 추가해 주세요
|
||||
- `npm test`를 실행하여 모든 테스트가 통과하는지 확인해 주세요
|
||||
- 변경사항이 기존 테스트에 영향을 미치는 경우 해당 테스트를 업데이트해 주세요
|
||||
- 적절한 경우 단위 테스트와 통합 테스트를 모두 포함해 주세요
|
||||
|
||||
4. **버전/릴리스 노트 관리**
|
||||
|
||||
- 기여자는 PR에서 changelog-entry 파일을 만들 필요가 없습니다.
|
||||
- 릴리스 버전 관리와 CHANGELOG 정리는 메인테이너가 릴리스 과정에서 수행합니다.
|
||||
|
||||
5. **커밋 가이드라인**
|
||||
|
||||
- 명확하고 설명적인 커밋 메시지를 작성해 주세요
|
||||
- 컨벤셔널 커밋 형식(예: "feat:", "fix:", "docs:")을 사용해 주세요
|
||||
- 커밋에서 관련 이슈를 #issue-number를 사용하여 참조해 주세요
|
||||
|
||||
6. **제출 전 확인사항**
|
||||
|
||||
- 최신 main에 브랜치를 리베이스해 주세요
|
||||
- 브랜치가 정상적으로 빌드되는지 확인해 주세요
|
||||
- 모든 테스트가 통과하는지 다시 확인해 주세요
|
||||
- 디버그 코드나 콘솔 로그가 없는지 변경사항을 확인해 주세요
|
||||
|
||||
7. **Pull Request 설명**
|
||||
- 변경 내용을 명확하게 설명해 주세요
|
||||
- 변경사항을 테스트하는 방법을 포함해 주세요
|
||||
- 호환되지 않는 변경 사항이 있다면 목록으로 작성해주세요
|
||||
- UI 변경이 있는 경우, 스크린샷을 추가해 주세요
|
||||
|
||||
## 기여 동의서
|
||||
|
||||
Pull Request를 제출함으로써, 귀하의 기여가 프로젝트와 동일한 라이선스([Apache 2.0](/LICENSE)) 에 따라 제공됨에 동의하는 것입니다.
|
||||
|
||||
기억하세요: Cline에 기여하는 것은 코드를 작성하는 것뿐만 아니라, AI 지원 개발의 미래를 형성하는 커뮤니티의 일원이 되는 것입니다. 함께 멋진 것을 만들어봅시다! 🚀
|
||||
@@ -0,0 +1,160 @@
|
||||
# Cline
|
||||
|
||||
<p align="center">
|
||||
<img src="https://media.githubusercontent.com/media/cline/cline/main/assets/docs/demo.gif" width="100%" />
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<table>
|
||||
<tbody>
|
||||
<td align="center">
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev" target="_blank"><strong>VS Marketplace에서 다운로드</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://discord.gg/cline" target="_blank"><strong>Discord</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://www.reddit.com/r/cline/" target="_blank"><strong>r/cline</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop" target="_blank"><strong>기능 요청</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://cline.bot/join-us" target="_blank"><strong>채용 정보</strong></a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Cline을 만나보세요, **CLI** 및 **에디터**를 활용할 수 있는 AI 어시스턴트입니다.
|
||||
|
||||
[Claude 4 Sonnet의 에이전트형 코딩 기능](https://www.anthropic.com/claude/sonnet) 덕분에, Cline은 복잡한 소프트웨어 개발 작업을 단계별로 처리할 수 있습니다. 파일 생성과 편집, 대규모 프로젝트 탐색, 브라우저 사용, 터미널 명령 실행(권한 허가 필요) 등의 도구를 사용하여 단순 코드 완성이나 기술 지원을 넘어서는 도움을 제공합니다. Cline은 Model Context Protocol(MCP)를 사용하여 새로운 도구를 만들고 자신의 기능을 확장할 수도 있습니다. 자율적인 AI 스크립트는 일반적으로 샌드박스 환경에서 실행되지만, 이 확장 프로그램은 모든 파일 변경 및 터미널 명령을 승인할 수 있는 사람이 개입가능한 GUI를 제공하여, 에이전트형 AI의 잠재력을 보다 안전하고 쉽게 탐색할 수 있도록 합니다.
|
||||
|
||||
1. 작업을 입력하고, 목업을 기능하는 앱으로 변환하거나 스크린샷으로 버그를 수정합니다.
|
||||
2. Cline은 파일 구조와 소스코드 AST의 분석, 정규식 검색 실행, 관련 파일 읽기부터 시작하여 기존 프로젝트를 파악합니다. 또한, 어떤 정보를 컨텍스트에 추가할지를 신중하게 관리하여, 대규모 복잡한 프로젝트에서도 컨텍스트 윈도우를 과부하시키지 않으면서도 효과적인 지원을 제공합니다.
|
||||
3. Cline이 필요한 정보를 얻은 후 다음과 같은 작업을 할 수 있습니다:
|
||||
- 파일 생성과 편집 + 린터/컴파일러 오류 모니터링을 수행하여 누락된 임포트나 구문 오류 등의 문제를 자동으로 수정합니다.
|
||||
- 터미널에서 명령을 직접 실행하고 작업 중에 출력을 모니터링합니다. 이를 통해 파일 편집 후 개발 서버의 문제에 대응할 수 있습니다.
|
||||
- 웹 개발 작업에서는 헤드리스 브라우저로 사이트를 실행하고, 클릭, 입력, 스크롤, 스크린샷과 콘솔 로그 캡처를 수행하여 런타임 오류나 시각적 버그를 수정합니다.
|
||||
4. 작업이 완료되면 Cline은 `open -a "Google Chrome" index.html`과 같은 터미널 명령을 제공하여 버튼 클릭 한 번으로 결과를 확인할 수 있도록 합니다.
|
||||
|
||||
> [!TIP]
|
||||
> `CMD/CTRL + Shift + P` 단축키를 사용하여 명령 팔레트를 열고 "Cline: Open In New Tab"을 입력하여 에디터의 탭으로 확장 프로그램을 엽니다. 이를 통해 파일 탐색기와 병행하여 Cline을 사용하고 워크스페이스의 변경을 더 명확하게 확인할 수 있습니다.
|
||||
|
||||
---
|
||||
|
||||
<img align="right" width="340" src="https://github.com/user-attachments/assets/3cf21e04-7ce9-4d22-a7b9-ba2c595e88a4">
|
||||
|
||||
### 어떤 API나 모델이든 사용 가능
|
||||
|
||||
Cline은 OpenRouter, Anthropic, OpenAI, Google Gemini, AWS Bedrock, Azure, GCP Vertex 등의 API 제공자를 지원합니다. 또한 OpenAI 호환 API를 설정하거나 LM Studio/Ollama를 통해 로컬 모델을 사용할 수도 있습니다. OpenRouter를 사용하는 경우, 확장 프로그램에서 최신 모델 목록을 가져와 바로 최신 모델을 사용할 수 있게 합니다.
|
||||
|
||||
또한, Cline은 전체 작업 루프와 개별 요청별로 토큰 사용량과 API 비용을 추적하여, 진행 중인 작업의 비용을 실시간으로 확인할 수 있도록 도와줍니다.
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/81be79a8-1fdb-4028-9129-5fe055e01e76">
|
||||
|
||||
### 터미널에서 명령 실행
|
||||
|
||||
VSCode v1.93의 새로운 [셸 통합 업데이트](https://code.visualstudio.com/updates/v1_93#_terminal-shell-integration-api) 덕분에, Cline은 터미널에서 명령을 직접 실행하고 출력을 받을 수 있습니다. 이를 통해 패키지 설치나 빌드 스크립트 실행부터 애플리케이션 배포, 데이터베이스 관리, 테스트 실행까지 광범위한 작업을 수행할 수 있습니다. Cline은 개발 환경과 도구 체인에 맞추어 정확하게 작업을 실행합니다.
|
||||
|
||||
개발 서버와 같은 오래 실행되는 프로세스의 경우, "실행 중 계속"(Proceed While Running) 버튼을 사용하여 명령이 백그라운드에서 실행되는 동안 Cline이 작업을 계속할 수 있게 합니다. 작업이 진행되는 동안 Cline은 새로운 터미널 출력을 실시간으로 확인하여, 파일 편집 시 발생하는 컴파일 오류와 같은 문제에 즉시 대응할 수 있습니다.
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="400" src="https://github.com/user-attachments/assets/c5977833-d9b8-491e-90f9-05f9cd38c588">
|
||||
|
||||
### 파일 생성과 편집
|
||||
|
||||
Cline은 에디터 내에서 파일을 생성 및 편집하고 변경의 Diff 뷰로 표시합니다. Diff 뷰 에디터에서 Cline의 변경을 직접 편집하거나 되돌릴 수 있으며, 채팅에서 피드백을 제공하여 만족할 때까지 개선 요청할 수 있습니다. Cline은 린터/컴파일러 오류(누락된 임포트, 구문 오류 등)도 모니터링하고 발생한 문제를 자동으로 수정합니다.
|
||||
|
||||
Cline에 의한 모든 변경은 파일의 타임라인에 기록되어 필요할 때 변경을 추적하고 되돌릴 수 있는 간단한 방법을 제공합니다.
|
||||
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/bc2e85ba-dfeb-4fe6-9942-7cfc4703cbe5">
|
||||
|
||||
### 브라우저 사용
|
||||
|
||||
Claude 4 Sonnet의 새로운 [컴퓨터 사용](https://www.anthropic.com/news/3-5-models-and-computer-use) 기능으로 인해, Cline은 브라우저를 실행하고 요소를 클릭하고 텍스트를 입력하고 스크롤하며 각 단계에서 스크린샷과 콘솔 로그를 캡처할 수 있습니다. 이를 통해 인터랙티브한 디버깅, 엔드투엔드 테스트, 심지어 일반적인 웹 탐색까지 가능해집니다. 이로 인해 오류 로그를 수동으로 복사 & 붙여넣기 할 필요 없이 시각적 버그나 런타임 문제를 자율적으로 수정할 수 있습니다.
|
||||
|
||||
Cline에게 "앱을 테스트해줘"라고 요청하면, `npm run dev`와 같은 명령을 실행하고 로컬에서 실행 중인 개발 서버를 브라우저에서 실행하여 일련의 테스트를 수행하고 모든 것이 정상적으로 작동하는지 확인합니다. [데모는 여기를 참조하세요.](https://x.com/sdrzn/status/1850880547825823989)
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/ac0efa14-5c1f-4c26-a42d-9d7c56f5fadd">
|
||||
|
||||
### "도구를 추가 해주세요."
|
||||
|
||||
Cline은 [Model Context Protocol](https://github.com/modelcontextprotocol)을 활용하여 커스텀 도구를 생성하고 기능을 확장할 수 있습니다. 기존의 [커뮤니티 서버](https://github.com/modelcontextprotocol/servers)를 사용할 수도 있지만, Cline은 사용자의 워크플로우에 최적화된 도구를 직접 제작하고 설치할 수도 있습니다. "~ 도구를 추가해주세요."라고 요청만 하면, Cline은 새로운 MCP 서버 생성부터 확장 프로그램 내 설치까지 모두 자동으로 처리합니다. 이러한 커스텀 도구는 Cline의 툴키트의 일부가 되어 향후 작업에서 사용할 수 있게 됩니다.
|
||||
|
||||
- "Jira 티켓을 가져오는 도구를 추가해주세요": 티켓 AC를 가져와 Cline에게 작업을 요청
|
||||
- "AWS EC2를 관리하는 도구를 추가해주세요": 서버 메트릭을 확인하고 인스턴스를 확장 또는 축소
|
||||
- "최신 PagerDuty 인시던트를 가져오는 도구를 추가해주세요": 최신 장애 정보를 가져와 Cline에게 버그 수정 요청
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="360" src="https://github.com/user-attachments/assets/7fdf41e6-281a-4b4b-ac19-020b838b6970">
|
||||
|
||||
### 컨텍스트 추가
|
||||
|
||||
**`@url`:** URL을 붙여넣으면 확장이 해당 페이지를 가져와 Markdown으로 변환합니다. 최신 문서를 Cline에게 제공할 때 유용합니다.
|
||||
|
||||
**`@problems`:** Cline이 수정할 워크스페이스 오류와 경고(Problems' panel)를 추가합니다.
|
||||
|
||||
**`@file`:** 파일의 내용을 추가하여, 파일을 읽는 데 API 요청을 허비하지 않고도 Cline이 접근할 수 있도록 합니다. (+ 파일 검색 가능)
|
||||
|
||||
**`@folder`:** 폴더 내 모든 파일을 한 번에 추가하여 워크플로우를 더욱 빠르게 진행할 수 있습니다.
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/140c8606-d3bf-41b9-9a1f-4dbf0d4c90cb">
|
||||
|
||||
### 체크포인트: 비교 및 복원
|
||||
|
||||
Cline이 작업을 진행하는 동안 확장 프로그램은 각 단계에서 워크스페이스의 스냅샷을 저장합니다. “Compare” 버튼을 사용하여 스냅샷과 현재 워크스페이스의 차이를 확인하고, “Restore” 버튼을 사용하여 해당 시점으로 롤백할 수 있습니다.
|
||||
|
||||
예를 들어, 로컬 웹 서버에서 작업 중일 때 “Restore Workspace Only”을 사용하여 서로 다른 버전의 앱을 신속하게 테스트하고, “Restore Task and Workspace”을 사용하여 계속 진행할 버전을 찾을 수 있습니다. 이를 통해 진행 상황을 잃지 않고 안전하게 다양한 접근 방식을 실험할 수 있습니다.
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
## 기여
|
||||
|
||||
프로젝트에 기여하려면, [기여 가이드](CONTRIBUTING.md)에서 기본 사항을 익히세요. 또한, [Discord](https://discord.gg/cline)에 참여하여 `#contributors` 채널에서 다른 기여자들과 이야기할 수 있습니다. 풀타임 직업을 찾고 있다면, [채용 페이지](https://cline.bot/join-us)에서 열려있는 포지션을 확인하세요.
|
||||
|
||||
<details>
|
||||
<summary>로컬 개발 방법</summary>
|
||||
|
||||
1. 리포지토리를 클론합니다 _(Requires [git-lfs](https://git-lfs.com/))_:
|
||||
```bash
|
||||
git clone https://github.com/cline/cline.git
|
||||
```
|
||||
2. 프로젝트를 VSCode에서 엽니다:
|
||||
```bash
|
||||
code cline
|
||||
```
|
||||
3. 확장 프로그램과 webview-gui의 필요한 의존성을 설치합니다:
|
||||
```bash
|
||||
npm run install:all
|
||||
```
|
||||
4. `F5`를 눌러(또는 `Run`->`Start Debugging`), 확장 프로그램이 로드된 새로운 VSCode 창을 엽니다. (프로젝트 빌드에 문제가 있는 경우, [esbuild problem matchers extension](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers)을 설치해야 할 수도 있습니다.)
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Pull Request 생성 방법</summary>
|
||||
|
||||
1. 변경 사항을 커밋하세요.
|
||||
|
||||
2. 브랜치를 푸시하고 GitHub에서 PR을 생성하세요. CI가 다음과 같은 작업을 수행합니다:
|
||||
- 테스트 및 코드 검증 실행
|
||||
|
||||
3. 버전 관리 및 변경 로그 정리는 릴리스 과정에서 메인테이너가 처리합니다.
|
||||
|
||||
</details>
|
||||
|
||||
## 라이센스
|
||||
|
||||
[Apache 2.0 © 2025 Cline Bot Inc.](/LICENSE)
|
||||
@@ -0,0 +1,51 @@
|
||||
# Código de Conduta para Contribuidores
|
||||
|
||||
## Nosso Compromisso
|
||||
|
||||
|
||||
Com o objetivo de promover um ambiente aberto e acolhedor, nós, como contribuidores e mantenedores, nos comprometemos a tornar a participação em nosso projeto e comunidade uma experiência livre de assédio para todos, independentemente de idade, tamanho corporal, deficiência, etnia, características sexuais, identidade e expressão de gênero, nível de experiência, educação, status socioeconômico, nacionalidade, aparência pessoal, raça, religião ou orientação sexual.
|
||||
|
||||
## Nossos Padrões
|
||||
|
||||
Exemplos de comportamentos que contribuem para criar um ambiente positivo incluem:
|
||||
|
||||
- Uso de linguagem acolhedora e inclusiva
|
||||
- Respeito por diferentes pontos de vista e experiências
|
||||
- Aceitar críticas de maneira construtiva
|
||||
- Foco no que é melhor para a comunidade
|
||||
- Ser empático com outros membros da comunidade
|
||||
|
||||
|
||||
Exemplos de comportamentos inaceitáveis por parte dos participantes incluem:
|
||||
|
||||
- Uso de linguagem ou imagens sexualizadas e atenção ou avanços sexuais indesejados
|
||||
- Trollar, insultar, fazer comentários depreciativos, ataques pessoais ou políticos
|
||||
- Assédio público ou privado
|
||||
- Divulgar informações privadas sem autorização, como endereços físicos ou eletrônicos, sem permissão explícita
|
||||
- Outras condutas que poderiam ser consideradas inadequadas em um ambiente profissional
|
||||
|
||||
## Nossas Responsabilidades
|
||||
|
||||
Os mantenedores do projeto são responsáveis por esclarecer os padrões de comportamento aceitáveis e devem tomar ações corretivas apropriadas e justas em resposta a qualquer instância de comportamento inaceitável.
|
||||
|
||||
Os mantenedores têm o direito e a responsabilidade de remover, editar ou rejeitar comentários, commits, códigos, edições no wiki, issues e outras contribuições que não estejam alinhadas com este Código de Conduta. Também podem banir temporária ou permanentemente qualquer colaborador cujo comportamento seja considerado inapropriado, ameaçador, ofensivo ou prejudicial.
|
||||
|
||||
## Escopo
|
||||
|
||||
Este Código de Conduta se aplica tanto aos espaços do projeto quanto aos espaços públicos
|
||||
quando uma pessoa representa o projeto ou sua comunidade. Exemplos de
|
||||
representação de um projeto ou comunidade incluem o uso de um endereço de e-mail oficial do projeto,
|
||||
publicar em uma conta oficial de mídia social ou atuar como representante designado
|
||||
em um evento online ou offline. A representação de um projeto pode
|
||||
ser mais especificamente definido e esclarecido pelos mantenedores do projeto.
|
||||
|
||||
## Aplicação
|
||||
|
||||
Casos de comportamento abusivo, assediador ou inaceitáveis podem ser reportados entrando em contato com a equipe do projeto pelo email hi@cline.bot. Todas as queixas serão revisadas e investigadas confidencialmente. Mais detalhes sobre políticas específicas podem ser publicados separadamente.
|
||||
|
||||
Os mantenedores que não seguirem ou aplicarem este Código de Conduta de boa fé podem enfrentar repercussões temporárias ou permanentes determinadas por outros membros da liderança do projeto.
|
||||
|
||||
## Atribuição
|
||||
|
||||
Este Código de Conduta é adaptado do [Contributor Covenant](https://www.contributor-covenant.org), versão 1.4, disponível em https://www.contributor-covenant.org/version/1/4/code-of-conduct.html.
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
# Contribuir para o Cline
|
||||
|
||||
Estamos felizes por você estar interessado em contribuir com o Cline. Seja corrigindo um erro, adicionando uma funcionalidade ou melhorando nossa documentação, cada contribuição torna o Cline mais inteligente! Para manter nossa comunidade viva e acolhedora, todos os membros devem cumprir nosso Código de Conduta [Código de Conduta](CODE_OF_CONDUCT.md).
|
||||
|
||||
## Relatar erros ou problemas
|
||||
|
||||
Relatar erros ajuda a melhorar o Cline para todos! Antes de criar um novo issue, revise as [issues existentes](https://github.com/cline/cline/issues) para evitar duplicações. Quando estiver pronto para relatar um erro, vá até nossa [página de Issues](https://github.com/cline/cline/issues/new/choose), onde você encontrará um modelo que ajudará a preencher as informações relevantes.
|
||||
|
||||
<blockquote class='warning-note'>
|
||||
🔐 <b>Importante:</b> Se você descobrir uma vulnerabilidade de segurança, utilize a <a href="https://github.com/cline/cline/security/advisories/new">ferramenta de segurança do GitHub</a> para relatá-la de forma privada.
|
||||
</blockquote>
|
||||
|
||||
## Escolher no que trabalhar
|
||||
|
||||
Procurando uma boa primeira contribuição? Consulte os problemas marcados com ["good first issue"](https://github.com/cline/cline/labels/good%20first%20issue) ou ["help wanted"](https://github.com/cline/cline/labels/help%20wanted). Estes foram especialmente selecionados para novos colaboradores e são áreas em que adoraríamos receber ajuda!
|
||||
|
||||
Também damos boas-vindas a contribuições para nossa [documentação](https://github.com/cline/cline/tree/main/docs). Seja corrigindo erros de digitação, melhorando guias existentes ou criando novos conteúdos educativos, queremos construir um repositório de recursos gerido pela comunidade que ajude todos a tirar o máximo proveito do Cline. Você pode começar explorando `/docs` e procurando áreas que precisam de melhorias.
|
||||
|
||||
Se planeja trabalhar em uma funcionalidade maior, crie primeiro uma [solicitação de funcionalidade](https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop) para que possamos discutir se ela se alinha à visão do Cline.
|
||||
|
||||
## Configurar o ambiente de desenvolvimento
|
||||
|
||||
1. **Extensões do VS Code**
|
||||
|
||||
- Ao abrir o projeto, o VS Code solicitará que você instale as extensões recomendadas.
|
||||
- Essas extensões são necessárias para o desenvolvimento – aceite todas as solicitações de instalação.
|
||||
- Caso tenha rejeitado as solicitações, você pode instalá-las manualmente na seção de extensões.
|
||||
|
||||
2. **Desenvolvimento local**
|
||||
- Execute `npm run install:all` para instalar as dependências.
|
||||
- Execute `npm run test` para rodar os testes localmente.
|
||||
- Antes de enviar um PR, execute `npm run format:fix` para formatar seu código.
|
||||
|
||||
## Escrever e enviar código
|
||||
|
||||
Qualquer pessoa pode contribuir com código para o Cline, mas pedimos que siga estas diretrizes para garantir que suas contribuições sejam integradas sem problemas:
|
||||
|
||||
1. **Mantenha os Pull Requests focados**
|
||||
|
||||
- Limite os PRs a uma única funcionalidade ou correção de erro.
|
||||
- Divida alterações maiores em PRs menores e coerentes.
|
||||
- Divida as alterações em commits lógicos que possam ser revisados independentemente.
|
||||
|
||||
2. **Qualidade do código**
|
||||
|
||||
- Execute `npm run lint` para verificar o estilo do código.
|
||||
- Execute `npm run format` para formatar automaticamente o código.
|
||||
- Todos os PRs devem passar nas verificações do CI, que incluem linting e formatação.
|
||||
- Resolva todos os avisos ou erros do ESLint antes de enviar.
|
||||
- Siga as melhores práticas para TypeScript e mantenha a segurança dos tipos.
|
||||
|
||||
3. **Testes**
|
||||
|
||||
- Adicione testes para novas funcionalidades.
|
||||
- Execute `npm test` para garantir que todos os testes passem.
|
||||
- Atualize testes existentes caso suas alterações os afetem.
|
||||
- Inclua tanto testes unitários quanto de integração onde for apropriado.
|
||||
|
||||
4. **Diretrizes de commits**
|
||||
|
||||
- Escreva mensagens de commit claras e descritivas.
|
||||
- Use o formato convencional (por exemplo, "feat:", "fix:", "docs:").
|
||||
- Faça referência aos issues relevantes nos commits usando #número-do-issue.
|
||||
|
||||
5. **Antes de enviar**
|
||||
|
||||
- Faça rebase com sua branch com a última versão da branch principal (main).
|
||||
- Certifique-se de que sua branch seja construída corretamente.
|
||||
- Verifique se todos os testes passam.
|
||||
- Revise suas alterações para remover qualquer código de depuração ou logs desnecessários.
|
||||
|
||||
6. **Descrição do Pull Request**
|
||||
- Descreva claramente o que suas alterações fazem.
|
||||
- Inclua passos para testar as alterações.
|
||||
- Liste quaisquer mudanças importantes.
|
||||
- Adicione capturas de tela para mudanças na interface do usuário.
|
||||
|
||||
## Acordo de contribuição
|
||||
|
||||
Ao enviar um Pull Request, você concorda que suas contribuições serão licenciadas sob a mesma licença do projeto ([Apache 2.0](LICENSE)).
|
||||
|
||||
Lembre-se: Contribuir com o Cline não é apenas escrever código – é fazer parte de uma comunidade que está moldando o futuro do desenvolvimento assistido por IA. Vamos criar algo incrível juntos! 🚀
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
# Cline
|
||||
|
||||
<p align="center">
|
||||
<img src="https://media.githubusercontent.com/media/cline/cline/main/assets/docs/demo.gif" width="100%" />
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<table>
|
||||
<tbody>
|
||||
<td align="center">
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev" target="_blank"><strong>Baixar no VS Marketplace</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://discord.gg/cline" target="_blank"><strong>Discord</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://www.reddit.com/r/cline/" target="_blank"><strong>r/cline</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop" target="_blank"><strong>Solicitação de Funcionalidades</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://cline.bot/join-us" target="_blank"><strong>Estamos Contratando!</strong></a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Conheça o Cline: um assistente de IA que pode usar seu **CLI** e **Editor**.
|
||||
|
||||
Graças às [habilidades avançadas do Claude 4 Sonnet](https://www.anthropic.com/claude/sonnet), o Cline pode lidar com tarefas complexas de desenvolvimento de software passo a passo. Com ferramentas que permitem criar e editar arquivos, explorar grandes projetos, usar o navegador e executar comandos no terminal (com sua aprovação), ele pode ajudar você de maneiras que vão além da inclusão de código ou suporte técnico. O Cline pode é capaz inclusive de usar o Model Context Protocol (MCP) para criar novas ferramentas e expandir seus próprios recursos. Embora os scripts de IA autônomas tradicionalmente sejam executados em ambientes isolados, esta extensão oferece uma GUI com um humano no circuito para aprovar cada alteração de arquivo e comando de terminal, fornecendo uma maneira segura e acessível de explorar todo o potencial da IA.
|
||||
|
||||
1. Insira sua tarefa e adicione imagens para transformar mockups em aplicativos funcionais ou corrigir erros através de capturas de tela.
|
||||
|
||||
2. O Cline começará analisando a estrutura do seu arquivo e os ASTs do código-fonte, fazendo pesquisas com Regex e lendo arquivos relevantes para se orientar em projetos existentes. Ao gerenciar cuidadosamente as informações agregadas, o Cline pode fornecer assistência valiosa mesmo em projetos grandes e complexos, sem sobrecarregar a janela de contexto.
|
||||
3. Assim que ele tiver as informações necessárias, o Cline poderá:
|
||||
- Criar e editar arquivos + monitorar erros de Linter/Compilador, para que você possa corrigir proativamente problemas como importações ausentes e erros de sintaxe.
|
||||
- Executar comandos diretamente no terminal e monitorar o resultado, para que você possa responder a problemas do servidor de desenvolvimento após editar um arquivo.
|
||||
- Para tarefas de desenvolvimento web, o Cline pode iniciar o site em um navegador headless, clicar, digitar, fazer scroll e capturar capturas de tela + registros de console, para que você possa corrigir erros em tempo de execução e erros visuais.
|
||||
|
||||
> [!TIP]
|
||||
> Use o atalho de teclado `CMD/CTRL + Shift + P` para abrir a lista de comandos possiveis e digite "Cline: Abrir em nova aba" para abrir a extensão como uma aba no seu editor. Dessa forma, você pode usar o Cline junto com seu explorador de arquivos e ver mais claramente como seu espaço de trabalho muda.
|
||||
|
||||
---
|
||||
|
||||
<img align="right" width="340" src="https://github.com/user-attachments/assets/3cf21e04-7ce9-4d22-a7b9-ba2c595e88a4">
|
||||
|
||||
### Use qualquer API ou modelo
|
||||
|
||||
O Cline oferece suporte a provedores de API como OpenRouter, Anthropic, OpenAI, Google Gemini, AWS Bedrock, Azure e GCP Vertex. Você também pode configurar qualquer API compatível com OpenAI ou usar um modelo local via LM Studio/Ollama. Se você usar o OpenRouter, a extensão recuperará sua lista de modelos mais recentes, para que você possa usar os modelos mais novos assim que estiverem disponíveis.
|
||||
|
||||
A extensão também rastreia o uso total de tokens e os custos da API para todo o ciclo de tarefas e solicitações individuais, para que você seja informado sobre as despesas em cada etapa.
|
||||
|
||||
<!-- Pixel transparente para criar uma quebra de linha após a imagem flutuante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/81be79a8-1fdb-4028-9129-5fe055e01e76">
|
||||
|
||||
### Executar comandos no terminal
|
||||
|
||||
Graças às novas [atualizações de integração do Shell no VSCode v1.93](https://code.visualstudio.com/updates/v1_93#_terminal-shell-integration-api), o Cline pode executar comandos diretamente no seu terminal e receber o resultado. Isso permite que você execute uma variedade de tarefas, desde instalar pacotes e executar build scripts para fazer deploy de aplicações, gerenciar bancos de dados e executar testes, adaptando-se ao seu ambiente de desenvolvimento e ferramentas para fazer o trabalho corretamente.
|
||||
|
||||
Para processos de longa duração, como servidores de desenvolvimento, use o botão "Continuar durante a execução" para permitir que o Cline continue a tarefa enquanto o comando é executado em segundo plano. Enquanto Cline trabalha, você será notificado sobre novas saídas do terminal, para que possa responder a problemas que possam surgir, como erros de compilação ao editar arquivos.
|
||||
|
||||
<!-- Pixel transparente para criar uma quebra de linha após a imagem flutuante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="400" src="https://github.com/user-attachments/assets/c5977833-d9b8-491e-90f9-05f9cd38c588">
|
||||
|
||||
### Criar e editar arquivos
|
||||
|
||||
Cline pode criar e editar arquivos diretamente no seu editor, apresentando um diff com as alterações. Você pode editar ou reverter as alterações do Cline diretamente no editor de diff ou fornecer feedback no chat até ficar satisfeito com o resultado. Cline também monitora erros de linter/compilador (importações ausentes, erros de sintaxe, etc.) para que possa corrigir problemas que surgem ao longo do caminho por conta própria.
|
||||
|
||||
Todas as alterações feitas pelo Cline são registradas na Linha do tempo do arquivo, fornecendo uma maneira fácil de rastrear e reverter modificações, caso seja necessário.
|
||||
|
||||
<!-- Pixel transparente para criar uma quebra de linha após a imagem flutuante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/bc2e85ba-dfeb-4fe6-9942-7cfc4703cbe5">
|
||||
|
||||
### Uso do navegador
|
||||
|
||||
Com a nova habilidade de [uso de computador](https://www.anthropic.com/news/3-5-models-and-computer-use) do Claude Sonnet 4, Cline pode abrir um navegador, clicar em elementos, digitar texto e rolar, capturando a tela e logs de console. Isso permite depurar de maneira interativa, testes end-to-end e até mesmo uso geral da web. Isso lhe dá autonomia para solucionar erros visuais e problemas em tempo de execução sem precisar copiar e colar logs dos erros.
|
||||
|
||||
Tente pedir a Cline para "testar o aplicativo" e observe enquanto o Cline executa um comando como `npm run dev`, inicia seu servidor de desenvolvimento local em um navegador e executa uma série de testes para confirmar se tudo funciona. [Veja uma demonstração aqui.](https://x.com/sdrzn/status/1850880547825823989)
|
||||
|
||||
<!-- Pixel transparente para crear un salto de línea después de la imagen flotante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/ac0efa14-5c1f-4c26-a42d-9d7c56f5fadd">
|
||||
|
||||
### "adicione uma ferramenta que..."
|
||||
|
||||
Graças ao [Model Context Protocol](https://github.com/modelcontextprotocol), o Cline pode expandir seus recursos por meio de ferramentas personalizadas. Embora você possa usar [servidores criados pela comunidade](https://github.com/modelcontextprotocol/servers), Cline pode criar e instalar ferramentas especificamente para seu fluxo de trabalho. Basta pedir ao Cline para "adicionar uma ferramenta" e ele cuidará de tudo, desde a criação de um novo servidor MCP até a instalação na extensão. Essas ferramentas personalizadas se tornam parte do conjunto de ferramentas da Cline e estão prontas para serem usadas em tarefas futuras.
|
||||
|
||||
- "adicione uma ferramenta que recupere tickets do Jira": Recupere ACs de tickets e coloque Cline para trabalhar
|
||||
- "adicione uma ferramenta que gerencie AWS EC2s": verifique as métricas do servidor e aumente ou diminua as instâncias
|
||||
- "adicione uma ferramenta para recuperar os últimos incidentes do PagerDuty": Recupere detalhes e peça ao Cline para corrigir erros
|
||||
|
||||
<!-- Pixel transparente para crear un salto de línea después de la imagen flotante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="360" src="https://github.com/user-attachments/assets/7fdf41e6-281a-4b4b-ac19-020b838b6970">
|
||||
|
||||
### Adicione contexto
|
||||
|
||||
**`@url`:** Insira uma URL para a extensão recuperar e converter para Markdown, que é útil quando você deseja fornecer ao Cline documentos mais recentes
|
||||
|
||||
**`@problems`:** Adicionar erros e avisos do espaço de trabalho (painel 'Problemas') que o Cline deve corrigir
|
||||
|
||||
**`@file`:** Adicione o conteúdo de um arquivo para que você não precise desperdiçar solicitações de API para aprovar a leitura do arquivo (+ para pesquisar arquivos)
|
||||
|
||||
**`@folder`:** Adicione arquivos de uma pasta por vez para acelerar ainda mais seu fluxo de trabalho
|
||||
|
||||
<!-- Pixel transparente para criar uma quebra de linha após a imagem flutuante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/140c8606-d3bf-41b9-9a1f-4dbf0d4c90cb">
|
||||
|
||||
### Checkpoints: Comparar e Restaurar
|
||||
|
||||
Enquanto Cline trabalha em uma tarefa, a extensão cria um instantâneo de seu espaço de trabalho em cada etapa. Você pode usar o botão "Comparar" para ver a diferença entre o instantâneo e seu espaço de trabalho atual, e o botão "Restaurar" para retornar a esse ponto.
|
||||
|
||||
Por exemplo, se estiver trabalhando com um servidor web local, você pode usar 'Restaurar somente o espaço de trabalho' para testar rapidamente diferentes versões do seu aplicativo e, em seguida, 'Restaurar tarefa e espaço de trabalho' quando encontrar a versão na qual deseja continuar trabalhando. Isso permite que você explore diferentes abordagens com segurança sem perder o progresso.
|
||||
|
||||
<!-- Pixel transparente para crear un salto de línea después de la imagen flotante -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
## Contribuições
|
||||
|
||||
Para contribuir com o projeto, comece com nosso [Guia de Contribuição](CONTRIBUTING.md) para aprender o básico. Você também pode entrar no nosso [Discord](https://discord.gg/cline) para bater papo com outros colaboradores no canal `#contributors`. Se você está procurando um emprego de período integral, confira nossas vagas em aberto na nossa [página de carreiras](https://cline.bot/join-us).
|
||||
|
||||
<details>
|
||||
<summary>Instruções para desenvolvimento local</summary>
|
||||
|
||||
1. Clone o repositório _(Necessário [git-lfs](https://git-lfs.com/))_:
|
||||
```bash
|
||||
git clone https://github.com/cline/cline.git
|
||||
```
|
||||
2. Abra o projeto no VSCode:
|
||||
```bash
|
||||
code cline
|
||||
```
|
||||
3. Instale as dependências necessárias para a extensão e webview-gui:
|
||||
```bash
|
||||
npm run install:all
|
||||
```
|
||||
4. Inicie pressionando `F5` (ou `Executar`->`Iniciar Depuração`) para abrir uma nova janela do VSCode com a extensão carregada. (Pode ser necessário instalar a [extensão esbuild problem matchers](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers) se você encontrar problemas ao compilar seu projeto.)
|
||||
|
||||
</details>
|
||||
|
||||
## Licença
|
||||
|
||||
[Apache 2.0 © 2025 Cline Bot Inc.](./LICENSE)
|
||||
@@ -0,0 +1,47 @@
|
||||
# 贡献者公约行为准则
|
||||
|
||||
## 我们的承诺
|
||||
|
||||
为了营造一个开放和欢迎的环境,我们作为贡献者和维护者承诺让我们的项目和社区的参与体验对每个人都无骚扰,无论年龄、体型、残疾、种族、性别特征、性别认同和表达、经验水平、教育程度、社会经济地位、国籍、个人外貌、种族、宗教或性取向。
|
||||
|
||||
## 我们的标准
|
||||
|
||||
有助于创造积极环境的行为示例包括:
|
||||
|
||||
- 使用欢迎和包容的语言
|
||||
- 尊重不同的观点和经验
|
||||
- 优雅地接受建设性的批评
|
||||
- 专注于对社区最有利的事情
|
||||
- 对其他社区成员表现出同理心
|
||||
|
||||
参与者不可接受的行为示例包括:
|
||||
|
||||
- 使用性化语言或图像以及不受欢迎的性关注或挑逗
|
||||
- 故意挑衅、侮辱/贬低性评论和个人或政治攻击
|
||||
- 公开或私下骚扰
|
||||
- 未经明确许可发布他人的私人信息,如物理或电子地址
|
||||
- 其他在专业环境中合理认为不适当的行为
|
||||
|
||||
## 我们的责任
|
||||
|
||||
项目维护者有责任澄清可接受行为的标准,并期望对任何不可接受行为采取适当和公平的纠正措施。
|
||||
|
||||
项目维护者有权利和责任删除、编辑或拒绝与本行为准则不一致的评论、提交、代码、维基编辑、问题和其他贡献,或暂时或永久禁止任何贡献者进行他们认为不适当、威胁、冒犯或有害的其他行为。
|
||||
|
||||
## 适用范围
|
||||
|
||||
本行为准则适用于项目空间内和公共空间中代表项目或其社区的个人。代表项目或社区的示例包括使用官方项目电子邮件地址,通过官方社交媒体账户发布,或在在线或离线活动中作为指定代表。项目的代表性可能由项目维护者进一步定义和澄清。
|
||||
|
||||
## 执行
|
||||
|
||||
滥用、骚扰或其他不可接受行为的实例可以通过联系项目团队 hi@cline.bot 报告。所有投诉将被审查和调查,并将导致根据情况认为必要和适当的回应。项目团队有义务对事件报告者保密。具体执行政策的详细信息可能会单独发布。
|
||||
|
||||
未能善意遵守或执行行为准则的项目维护者可能会面临由项目领导的其他成员决定的临时或永久后果。
|
||||
|
||||
## 归属
|
||||
|
||||
本行为准则改编自 [贡献者公约][主页],版本 1.4,可在 https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 获取。
|
||||
|
||||
[主页]: https://www.contributor-covenant.org
|
||||
|
||||
有关此行为准则的常见问题的答案,请参见 https://www.contributor-covenant.org/faq
|
||||
@@ -0,0 +1,82 @@
|
||||
# 贡献到 Cline
|
||||
|
||||
我们很高兴您有兴趣为 Cline 做出贡献。无论您是修复错误、添加功能还是改进我们的文档,每一份贡献都让 Cline 更加智能!为了保持我们的社区充满活力和欢迎,所有成员必须遵守我们的[行为准则](CODE_OF_CONDUCT.md)。
|
||||
|
||||
## 报告错误或问题
|
||||
|
||||
错误报告有助于让 Cline 对每个人都更好!在创建新问题之前,请先[搜索现有问题](https://github.com/cline/cline/issues)以避免重复。当您准备好报告错误时,请前往我们的[问题页面](https://github.com/cline/cline/issues/new/choose),在那里您会找到一个模板来帮助您填写相关信息。
|
||||
|
||||
<blockquote class='warning-note'>
|
||||
🔐 <b>重要:</b>如果您发现安全漏洞,请使用<a href="https://github.com/cline/cline/security/advisories/new">Github 安全工具私下报告</a>。
|
||||
</blockquote>
|
||||
|
||||
## 决定要做什么
|
||||
|
||||
寻找一个好的首次贡献?查看标记为["good first issue"](https://github.com/cline/cline/labels/good%20first%20issue)或["help wanted"](https://github.com/cline/cline/labels/help%20wanted)的问题。这些是专门为新贡献者策划的领域,我们非常欢迎您的帮助!
|
||||
|
||||
我们也欢迎对我们的[文档](https://github.com/cline/cline/tree/main/docs)做出贡献!无论是修正错别字、改进现有指南,还是创建新的教育内容 - 我们希望建立一个社区驱动的资源库,帮助每个人充分利用 Cline。您可以从深入研究 `/docs` 并寻找需要改进的地方开始。
|
||||
|
||||
如果您计划开发一个更大的功能,请先创建一个[功能请求](https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop),以便我们讨论它是否符合 Cline 的愿景。
|
||||
|
||||
## 开发设置
|
||||
|
||||
1. **VS Code 扩展**
|
||||
|
||||
- 打开项目时,VS Code 会提示您安装推荐的扩展
|
||||
- 这些扩展是开发所必需的 - 请接受所有安装提示
|
||||
- 如果您忽略了提示,可以从扩展面板手动安装它们
|
||||
|
||||
2. **本地开发**
|
||||
- 运行 `npm run install:all` 安装依赖项
|
||||
- 运行 `npm run test` 本地运行测试
|
||||
- 提交 PR 之前,运行 `npm run format:fix` 格式化您的代码
|
||||
|
||||
## 编写和提交代码
|
||||
|
||||
任何人都可以为 Cline 贡献代码,但我们要求您遵循以下指南,以确保您的贡献能够顺利集成:
|
||||
|
||||
1. **保持 Pull Request 集中**
|
||||
|
||||
- 将 PR 限制为单个功能或错误修复
|
||||
- 将较大的更改拆分为较小的相关 PR
|
||||
- 将更改分为逻辑提交,以便独立审查
|
||||
|
||||
2. **代码质量**
|
||||
|
||||
- 运行 `npm run lint` 检查代码风格
|
||||
- 运行 `npm run format` 自动格式化代码
|
||||
- 所有 PR 必须通过 CI 检查,包括 lint 和格式化
|
||||
- 提交前解决所有 ESLint 警告或错误
|
||||
- 遵循 TypeScript 最佳实践并保持类型安全
|
||||
|
||||
3. **测试**
|
||||
|
||||
- 为新功能添加测试
|
||||
- 运行 `npm test` 确保所有测试通过
|
||||
- 如果您的更改影响现有测试,请更新它们
|
||||
- 在适当的情况下包括单元测试和集成测试
|
||||
|
||||
4. **提交指南**
|
||||
|
||||
- 编写清晰、描述性的提交消息
|
||||
- 使用常规提交格式(例如,“feat:”,“fix:”,“docs:”)
|
||||
- 在提交中引用相关问题,使用 #issue-number
|
||||
|
||||
5. **提交前**
|
||||
|
||||
- 将您的分支重新基于最新的 main
|
||||
- 确保您的分支成功构建
|
||||
- 仔细检查所有测试是否通过
|
||||
- 检查您的更改是否有任何调试代码或控制台日志
|
||||
|
||||
6. **Pull Request 描述**
|
||||
- 清楚描述您的更改内容
|
||||
- 包括测试更改的步骤
|
||||
- 列出任何重大更改
|
||||
- 对于 UI 更改,添加截图
|
||||
|
||||
## 贡献协议
|
||||
|
||||
通过提交 pull request,您同意您的贡献将根据与项目相同的许可证([Apache 2.0](LICENSE))进行许可。
|
||||
|
||||
记住:为 Cline 做贡献不仅仅是编写代码 - 这是成为一个社区的一部分,共同塑造 AI 辅助开发的未来。让我们一起构建一些令人惊叹的东西!🚀
|
||||
@@ -0,0 +1,162 @@
|
||||
# Cline
|
||||
|
||||
<p align="center">
|
||||
<img src="https://media.githubusercontent.com/media/cline/cline/main/assets/docs/demo.gif" width="100%" />
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<table>
|
||||
<tbody>
|
||||
<td align="center">
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev" target="_blank"><strong>在 VS Marketplace 下载</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://discord.gg/cline" target="_blank"><strong>Discord</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://www.reddit.com/r/cline/" target="_blank"><strong>r/cline</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop" target="_blank"><strong>功能请求</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://docs.cline.bot/getting-started/for-new-coders" target="_blank"><strong>新手上路</strong></a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
认识 Cline —— 一个可以使用你的 **终端** 和 **编辑器** 的 AI 助手。
|
||||
|
||||
得益于 [Claude 4 Sonnet 的代理式编码能力](https://www.anthropic.com/claude/sonnet),Cline 能够逐步处理复杂的软件开发任务。借助于一系列工具,他可以创建和编辑文件、浏览大型项目、使用浏览器,并在你授权后执行终端命令,从而在代码补全或技术支持之外提供更深入的帮助。Cline 甚至还能使用 Model Context Protocol(MCP)来创建新工具,并扩展自身的能力。虽然传统的自动化 AI 脚本通常运行在沙盒环境中,但这个扩展提供了一个人类参与审核的图形界面(GUI),用于审批每一次文件变更和终端命令,从而为探索代理式 AI 的潜力提供了一种安全且易于使用的方式。
|
||||
|
||||
1. 输入你的任务,并添加图片,以将界面原型(mockup)转换为功能应用,或通过截图修复 bug。
|
||||
2. Cline 会从分析你的文件结构和源代码的抽象语法树(AST)开始,同时执行正则搜索并读取相关文件,以便尽快熟悉项目上下文。通过精细地管理上下文中引入的信息,即使面对大型复杂项目,Cline 也能在不超出上下文窗口限制的前提下提供有效协助。
|
||||
3. 一旦获取了所需信息,Cline 能够:
|
||||
- 创建和编辑文件,并在过程中监控 linter 或编译器错误,主动修复诸如缺少导入、语法错误等问题。
|
||||
- 直接在你的终端中执行命令,并在运行过程中监控输出,例如在修改文件后自动响应开发服务器问题。
|
||||
- 针对 Web 开发任务,Cline 可以在无头浏览器中打开网站,进行点击、输入、滚动操作,并采集截图与控制台日志,从而修复运行时错误和界面问题。
|
||||
4. 当任务完成后,Cline 会通过类似 `open -a "Google Chrome" index.html` 的终端命令将结果展示给你,你只需点击按钮即可执行。
|
||||
|
||||
> [!TIP]
|
||||
> 使用 `CMD/CTRL + Shift + P` 快捷键打开命令面板并输入 "Cline: Open In New Tab" 将扩展作为标签在编辑器中打开。这让你可以与文件资源管理器并排使用 Cline,更清楚地看到他如何改变你的工作空间。
|
||||
|
||||
---
|
||||
|
||||
<img align="right" width="340" src="https://github.com/user-attachments/assets/3cf21e04-7ce9-4d22-a7b9-ba2c595e88a4">
|
||||
|
||||
### 使用任何 API 和模型
|
||||
|
||||
Cline 支持 OpenRouter、Anthropic、OpenAI、Google Gemini、AWS Bedrock、Azure 和 GCP Vertex 等 API 提供商。你还可以配置任何兼容 OpenAI 的 API,或通过 LM Studio/Ollama 使用本地模型。如果你使用 OpenRouter,扩展会获取他们的最新模型列表,让你在新模型可用时立即使用。
|
||||
|
||||
此外,该扩展还会记录整个任务流程中以及每次请求的总 token 数和 API 使用费用,确保你在每一步都能清楚了解花费情况。
|
||||
|
||||
<!-- 透明像素以在浮动图像后创建换行 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/81be79a8-1fdb-4028-9129-5fe055e01e76">
|
||||
|
||||
### 在终端中运行命令
|
||||
|
||||
感谢 VSCode v1.93 中的新 [终端 shell 集成更新](https://code.visualstudio.com/updates/v1_93#_terminal-shell-integration-api),Cline 可以直接在你的终端中执行命令并接收输出。这使他能够执行广泛的任务,从安装包和运行构建脚本到部署应用程序、管理数据库和执行测试,同时适应你的开发环境和工具链以正确完成工作。
|
||||
|
||||
对于长时间运行的进程如开发服务器,使用“在运行时继续”按钮让 Cline 在命令后台运行时继续任务。当 Cline 工作时,他会在过程中收到任何新的终端输出通知,让他对可能出现的问题做出反应,例如编辑文件时的编译时错误。
|
||||
|
||||
<!-- 透明像素以在浮动图像后创建换行 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="400" src="https://github.com/user-attachments/assets/c5977833-d9b8-491e-90f9-05f9cd38c588">
|
||||
|
||||
### 创建和编辑文件
|
||||
|
||||
Cline 可以直接在你的编辑器中创建和编辑文件,向你展示更改的差异视图。你可以直接在差异视图编辑器中编辑或恢复 Cline 的更改,或在聊天中提供反馈,直到你对结果满意。Cline 还会监控 linter/编译器错误(缺少导入、语法错误等),以便他在过程中自行修复出现的问题。
|
||||
|
||||
Cline 所做的所有更改都会记录在你的文件时间轴中,提供了一种简单的方法来跟踪和恢复修改(如果需要)。
|
||||
|
||||
<!-- 透明像素以在浮动图像后创建换行 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/bc2e85ba-dfeb-4fe6-9942-7cfc4703cbe5">
|
||||
|
||||
### 使用浏览器
|
||||
|
||||
借助 Claude 4 Sonnet 的新 [计算机使用](https://www.anthropic.com/news/3-5-models-and-computer-use) 功能,Cline 可以启动浏览器,点击元素,输入文本和滚动,在每一步捕获截图和控制台日志。这允许进行交互式调试、端到端测试,甚至是一般的网页使用!这使他能够自主修复视觉错误和运行时问题,而无需你亲自操作和复制粘贴错误日志。
|
||||
|
||||
试试让 Cline “测试应用程序”,看看他如何运行 `npm run dev` 命令,在浏览器中启动你本地运行的开发服务器,并执行一系列测试以确认一切正常。[在这里查看演示。](https://x.com/sdrzn/status/1850880547825823989)
|
||||
|
||||
<!-- 透明像素以在浮动图像后创建换行 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/ac0efa14-5c1f-4c26-a42d-9d7c56f5fadd">
|
||||
|
||||
### “添加一个工具……”
|
||||
|
||||
感谢 [Model Context Protocol](https://github.com/modelcontextprotocol),Cline 可以通过自定义工具扩展他的能力。虽然你可以使用 [社区制作的服务器](https://github.com/modelcontextprotocol/servers),但 Cline 可以创建和安装适合你特定工作流程的工具。只需让 Cline “添加一个工具”,他将处理所有事情,从创建新的 MCP 服务器到将其安装到扩展中。这些自定义工具将成为 Cline 工具包的一部分,准备在未来的任务中使用。
|
||||
|
||||
- “添加一个获取 Jira 工单的工具”:检索工单 AC 并让 Cline 开始工作
|
||||
- “添加一个管理 AWS EC2 的工具”:检查服务器指标并上下扩展实例
|
||||
- “添加一个获取最新 PagerDuty 事件的工具”:获取详细信息并让 Cline 修复错误
|
||||
|
||||
<!-- 透明像素以在浮动图像后创建换行 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="360" src="https://github.com/user-attachments/assets/7fdf41e6-281a-4b4b-ac19-020b838b6970">
|
||||
|
||||
### 添加上下文
|
||||
|
||||
**`@url`:** 粘贴一个 URL 以供扩展获取并转换为 markdown,当你想给 Cline 提供最新文档时非常有用
|
||||
|
||||
**`@problems`:** 添加工作区错误和警告(“问题”面板)以供 Cline 修复
|
||||
|
||||
**`@file`:** 添加文件内容,这样你就不必浪费 API 请求批准读取文件(+ 输入以搜索文件)
|
||||
|
||||
**`@folder`:** 一次添加文件夹的文件,以进一步加快你的工作流程
|
||||
|
||||
<!-- 透明像素以在浮动图像后创建换行 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/140c8606-d3bf-41b9-9a1f-4dbf0d4c90cb">
|
||||
|
||||
### 检查点:比较和恢复
|
||||
|
||||
当 Cline 完成任务时,扩展会在每一步拍摄你的工作区快照。你可以使用“比较”按钮查看快照和当前工作区之间的差异,并使用“恢复”按钮回滚到该点。
|
||||
|
||||
例如,当使用本地 Web 服务器时,你可以使用“仅恢复工作区”快速测试应用程序的不同版本,然后在找到要继续构建的版本时使用“恢复任务和工作区”。这让你可以安全地探索不同的方法而不会丢失进度。
|
||||
|
||||
<!-- 透明像素以在浮动图像后创建换行 -->
|
||||
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
## 贡献
|
||||
|
||||
要为项目做出贡献,请从我们的 [贡献指南](CONTRIBUTING.md) 开始,了解基础知识。你还可以加入我们的 [Discord](https://discord.gg/cline) 在 `#contributors` 频道与其他贡献者聊天。如果你正在寻找全职工作,请查看我们在 [招聘页面](https://cline.bot/join-us) 上的开放职位!
|
||||
|
||||
<details>
|
||||
<summary>本地开发说明</summary>
|
||||
|
||||
1. 克隆仓库 _(需要 [git-lfs](https://git-lfs.com/))_:
|
||||
```bash
|
||||
git clone https://github.com/cline/cline.git
|
||||
```
|
||||
2. 在 VSCode 中打开项目:
|
||||
```bash
|
||||
code cline
|
||||
```
|
||||
3. 安装扩展和 webview-gui 的必要依赖:
|
||||
```bash
|
||||
npm run install:all
|
||||
```
|
||||
4. 按 `F5`(或 `运行`->`开始调试`)启动以打开一个加载了扩展的新 VSCode 窗口。(如果你在构建项目时遇到问题,可能需要安装 [esbuild problem matchers 扩展](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers))
|
||||
|
||||
</details>
|
||||
|
||||
## 许可证
|
||||
|
||||
[Apache 2.0 © 2025 Cline Bot Inc.](./LICENSE)
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# 貢獻者公約行為準則
|
||||
|
||||
## 我們的承諾
|
||||
|
||||
為了營造開放且友善的環境,我們身為貢獻者與維護者,承諾讓參與本專案及社群的體驗,對每個人都不帶有騷擾,不論其年齡、體型、身心障礙、族裔、性徵、性別認同與表現、經驗程度、教育程度、社經地位、國籍、個人外表、種族、宗教信仰、或性傾向。
|
||||
|
||||
## 我們的準則
|
||||
|
||||
有助於創造正面環境的行為包括:
|
||||
|
||||
- 使用友善和包容的語言
|
||||
- 尊重不同的觀點與經驗
|
||||
- 優雅地接受建設性批評
|
||||
- 著重於對社群最有利的事情
|
||||
- 對其他社群成員展現同理心
|
||||
|
||||
參與者不可接受的行為包括:
|
||||
|
||||
- 使用帶有性暗示的言語或影像,以及不受歡迎的性關注或騷擾
|
||||
- 挑釁、羞辱/貶低他人的評論,以及人身或政治攻擊
|
||||
- 公開或私下的騷擾行為
|
||||
- 未經他人明確許可,公開他人的私人資料,如實體或電子郵件地址
|
||||
- 其他在專業環境中可被合理認定為不恰當的行為
|
||||
|
||||
## 我們的責任
|
||||
|
||||
專案維護者有責任釐清可接受行為的標準,並應對任何不可接受的行為採取適當且公平的糾正措施。
|
||||
|
||||
專案維護者有權利和責任移除、編輯或拒絕不符合本行為準則的評論、提交、程式碼、維基編輯、議題和其他貢獻,或暫時或永久封鎖任何他們認為有不當、威脅、冒犯或有害行為的貢獻者。
|
||||
|
||||
## 範疇
|
||||
|
||||
本行為準則適用於專案空間及公開場合,當個人代表本專案或其社群時都必須遵守。代表本專案或社群的情況包括:使用官方專案電子郵件地址、透過官方社群媒體帳號發文,或在線上或實體活動中擔任指定代表。專案維護者可進一步定義並釐清專案代表的其他情況。
|
||||
|
||||
## 執行
|
||||
|
||||
如發生辱罵、騷擾或其他不可接受的行為,請透過 hi@cline.bot 聯絡專案團隊回報。所有申訴都將被審查和調查,並做出必要且合適的回應。專案團隊有義務為事件回報者保密。具體執行政策的更多細節可能另行公佈。
|
||||
|
||||
未遵守或未切實執行本行為準則的專案維護者,可能會面臨由專案領導團隊其他成員所決定的暫時或永久的處置。
|
||||
|
||||
## 來源說明
|
||||
|
||||
本行為準則改編自[貢獻者公約][homepage]第 1.4 版,可在此查閱:
|
||||
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
關於本行為準則的常見問題解答,請參考:
|
||||
https://www.contributor-covenant.org/faq
|
||||
@@ -0,0 +1,80 @@
|
||||
# 貢獻至 Cline
|
||||
|
||||
我們非常感謝您有意願貢獻至 Cline。無論是修正程式錯誤、新增功能或改善文件,每一份貢獻都能讓 Cline 更加出色!為了維持社群的活力與友善,所有成員都必須遵守我們的[行為準則](CODE_OF_CONDUCT.md)。
|
||||
|
||||
## 回報程式錯誤或問題
|
||||
|
||||
程式錯誤回報能幫助 Cline 變得更好!在建立新的議題之前,請先[搜尋現有議題](https://github.com/cline/cline/issues),避免重複。當您準備好回報程式錯誤時,請前往我們的[議題頁面](https://github.com/cline/cline/issues/new/choose),您會找到協助填寫相關資訊的範本。
|
||||
|
||||
<blockquote class='warning-note'>
|
||||
🔐 <b>重要:</b> 若您發現安全性漏洞,請使用 <a href="https://github.com/cline/cline/security/advisories/new">GitHub 安全性工具進行私密回報</a>。
|
||||
</blockquote>
|
||||
|
||||
## 決定要處理的工作
|
||||
|
||||
想找適合第一次貢獻的工作嗎?請檢視標示為[「good first issue」](https://github.com/cline/cline/labels/good%20first%20issue)或[「help wanted」](https://github.com/cline/cline/labels/help%20wanted)的議題。這些議題特別適合新手貢獻者,我們也非常歡迎您的協助!
|
||||
|
||||
我們也歡迎對[文件](https://github.com/cline/cline/tree/main/docs)的貢獻!無論是修正錯字、改善現有指南或建立新的教學內容,我們都期待能建立一個由社群共同維護的知識庫,協助每個人充分運用 Cline。您可以從 `/docs` 開始,尋找需要改善的地方。
|
||||
|
||||
若您計畫處理較大的功能,請先建立一個[功能請求](https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop),以便我們討論該功能是否符合 Cline 的願景。
|
||||
|
||||
## 開發環境設定
|
||||
|
||||
1. **VS Code 擴充套件**
|
||||
- 開啟專案時,VS Code 會提示您安裝建議的擴充套件
|
||||
- 這些擴充套件是開發所需,請接受所有安裝提示
|
||||
- 若您已關閉提示,可從擴充套件面板手動安裝
|
||||
|
||||
2. **本機開發**
|
||||
- 執行 `npm run install:all` 安裝相依套件
|
||||
- 執行 `npm run test` 在本機執行測試
|
||||
- 提交 PR 前,執行 `npm run format:fix` 格式化您的程式碼
|
||||
|
||||
## 撰寫與提交程式碼
|
||||
|
||||
任何人都可以貢獻程式碼至 Cline,但我們要求您遵守以下指引,以確保您的貢獻能順利整合:
|
||||
|
||||
1. **保持 Pull Request 聚焦**
|
||||
- 每個 PR 限制在單一功能或錯誤修正
|
||||
- 將較大的變更拆分成較小且相關的 PR
|
||||
- 將變更拆分成邏輯性的提交,以便獨立審查
|
||||
|
||||
2. **程式碼品質**
|
||||
- 執行 `npm run lint` 檢查程式碼風格
|
||||
- 執行 `npm run format` 自動格式化程式碼
|
||||
- 所有 PR 必須通過包含程式碼風格檢查與格式化的 CI 檢查
|
||||
- 提交前解決所有 ESLint 警告或錯誤
|
||||
- 遵循 TypeScript 最佳實務並維持型別安全
|
||||
|
||||
3. **測試**
|
||||
- 為新功能新增測試
|
||||
- 執行 `npm test` 確保所有測試通過
|
||||
- 若您的變更影響現有測試,請更新測試
|
||||
- 適當時包含單元測試與整合測試
|
||||
|
||||
4. **版本與變更日誌說明**
|
||||
- 貢獻者不需要在 PR 中建立 changelog-entry 檔案。
|
||||
- 維護者會在發版流程中處理版本管理與變更日誌整理。
|
||||
|
||||
5. **提交指引**
|
||||
- 撰寫清晰且描述性的提交訊息
|
||||
- 使用慣用提交格式(例如:「feat:」、「fix:」、「docs:」)
|
||||
- 在提交中引用相關議題,使用 #issue-number
|
||||
|
||||
6. **提交前檢查**
|
||||
- 將您的分支 rebase 到最新的 main
|
||||
- 確保您的分支可以成功建置
|
||||
- 再次確認所有測試通過
|
||||
- 檢查您的變更是否包含除錯程式碼或 console 紀錄
|
||||
|
||||
7. **Pull Request 說明**
|
||||
- 清楚描述您的變更內容
|
||||
- 包含測試變更的步驟
|
||||
- 列出任何重大變更
|
||||
- 若有使用者介面變更,請附上截圖
|
||||
|
||||
## 貢獻協議
|
||||
|
||||
提交 Pull Request 即表示您同意您的貢獻將依照專案相同的授權條款([Apache 2.0](LICENSE))進行授權。
|
||||
|
||||
請記住:貢獻至 Cline 不只是撰寫程式碼,更是成為塑造 AI 輔助開發未來的社群一份子。讓我們一起打造令人驚艷的成果吧!🚀
|
||||
@@ -0,0 +1,176 @@
|
||||
<div align="center"><sub>
|
||||
<a href="https://github.com/cline/cline/blob/main/README.md" target="_blank">English</a> | <a href="https://github.com/cline/cline/blob/main/locales/es/README.md" target="_blank">Español</a> | <a href="https://github.com/cline/cline/blob/main/locales/de/README.md" target="_blank">Deutsch</a> | <a href="https://github.com/cline/cline/blob/main/locales/ja/README.md" target="_blank">日本語</a> | <a href="https://github.com/cline/cline/blob/main/locales/zh-cn/README.md" target="_blank">简体中文</a> | 繁體中文 | <a href="https://github.com/cline/cline/blob/main/locales/ko/README.md" target="_blank">한국어</a>
|
||||
</sub></div>
|
||||
|
||||
# Cline
|
||||
|
||||
<p align="center">
|
||||
<img src="https://media.githubusercontent.com/media/cline/cline/main/assets/docs/demo.gif" width="100%" />
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<table>
|
||||
<tbody>
|
||||
<td align="center">
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev" target="_blank"><strong>從 VS Marketplace 下載</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://discord.gg/cline" target="_blank"><strong>Discord</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://www.reddit.com/r/cline/" target="_blank"><strong>r/cline</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/cline/cline/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop" target="_blank"><strong>功能建議</strong></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://docs.cline.bot/getting-started/getting-started-new-coders" target="_blank"><strong>新手上路</strong></a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
認識 Cline,一個可以使用您的**命令列介面** (CLI) 和**程式編輯器** (Editor) 的 AI 助理。
|
||||
|
||||
感謝 [Claude 4 Sonnet 的代理式程式設計能力](https://www.anthropic.com/claude/sonnet),Cline 能夠逐步處理複雜的軟體開發任務。透過能讓他建立和編輯檔案、探索大型專案、使用瀏覽器,以及執行終端機指令(在您授權後)的工具,從而在程式碼補全或技術支援之外提供更深入的協助。Cline 甚至能使用模型上下文協定(Model Context Protocol,MCP)來建立新工具並擴展自己的功能。雖然自主 AI 腳本傳統上會在沙箱環境中執行,但這個擴充套件提供了人機互動的圖形介面,讓您可以核准每個檔案變更和終端機指令,提供一個安全且容易使用的方式來探索代理式 AI 的潛力。
|
||||
|
||||
1. 輸入您的任務,並可以加入圖片來將設計稿轉換成功能性應用程式,或使用截圖來修正錯誤。
|
||||
2. Cline 會先分析您的檔案結構和程式碼 AST、執行正規表達式搜尋,並讀取相關檔案,以便在現有專案中快速掌握狀況。透過仔細管理加入上下文的資訊,Cline 可以在不超過上下文視窗的情況下,為大型且複雜的專案提供有價值的協助。
|
||||
3. 一旦 Cline 取得所需資訊後,他可以:
|
||||
- 建立和編輯檔案,並在過程中監控程式碼檢查工具/編譯器的錯誤,讓他能主動修正缺少的匯入語句和語法錯誤等問題。
|
||||
- 直接在您的終端機中執行指令並監控其輸出,讓他能夠在編輯檔案後回應開發伺服器的問題。
|
||||
- 對於網頁開發任務,Cline 可以在無頭瀏覽器中啟動網站、點選、輸入、捲動並擷取螢幕截圖和主控台記錄,讓他能修正執行時錯誤和視覺問題。
|
||||
4. 當任務完成時,Cline 會以終端機指令(如 `open -a "Google Chrome" index.html`)向您呈現結果,您只需點選按鈕即可執行。
|
||||
|
||||
> [!TIP]
|
||||
> 使用 `CMD/CTRL + Shift + P` 快速鍵開啟命令選擇區,輸入「Cline: Open In New Tab」即可在編輯器中以分頁方式開啟擴充套件。這讓您可以同時檢視檔案總管,並更清楚地看到 Cline 如何變更您的工作區。
|
||||
|
||||
---
|
||||
|
||||
<img align="right" width="340" src="https://github.com/user-attachments/assets/3cf21e04-7ce9-4d22-a7b9-ba2c595e88a4">
|
||||
|
||||
### 使用任何 API 和模型
|
||||
|
||||
Cline 支援 OpenRouter、Anthropic、OpenAI、Google Gemini、AWS Bedrock、Azure 和 GCP Vertex 等 API 提供者。您也可以設定任何與 OpenAI 相容的 API,或透過 LM Studio/Ollama 使用本機模型。若您使用 OpenRouter,此擴充套件會擷取他們最新的模型列表,讓您能在新模型推出時立即使用。
|
||||
|
||||
此擴充套件也會追蹤整個任務迴圈和個別請求的 token 總數和 API 使用成本,讓您隨時掌握費用支出。
|
||||
|
||||
<!-- 透明像素用於浮動圖片後的換行 -->
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/81be79a8-1fdb-4028-9129-5fe055e01e76">
|
||||
|
||||
### 在終端機中執行指令
|
||||
|
||||
感謝 [VSCode v1.93 的終端機整合更新](https://code.visualstudio.com/updates/v1_93#_terminal-shell-integration-api),Cline 可以直接在您的終端機中執行指令並接收輸出。這讓他能執行各種任務,從安裝套件和執行建置腳本到部署應用程式、管理資料庫和執行測試,同時適應您的開發環境和工具鏈,以正確完成工作。
|
||||
|
||||
對於開發伺服器等長時間執行的程序,使用「繼續執行中的程序」按鈕讓 Cline 在指令於背景執行時繼續任務。當 Cline 工作時,他會收到任何新的終端機輸出通知,讓他能回應可能出現的問題,例如編輯檔案時的編譯錯誤。
|
||||
|
||||
<!-- 透明像素用於浮動圖片後的換行 -->
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="400" src="https://github.com/user-attachments/assets/c5977833-d9b8-491e-90f9-05f9cd38c588">
|
||||
|
||||
### 建立和編輯檔案
|
||||
|
||||
Cline 可以直接在您的編輯器中建立和編輯檔案,並顯示變更的差異檢視。您可以直接在差異檢視編輯器中編輯或還原 Cline 的變更,或在聊天中提供意見回饋,直到您滿意結果為止。Cline 也會監控程式碼檢查工具/編譯器的錯誤(缺少的匯入語句、語法錯誤等),讓他能自行修正過程中出現的問題。
|
||||
|
||||
所有 Cline 做的變更都會記錄在您檔案的時間軸中,提供簡單的方式來追蹤和還原修改。
|
||||
|
||||
<!-- 透明像素用於浮動圖片後的換行 -->
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="370" src="https://github.com/user-attachments/assets/bc2e85ba-dfeb-4fe6-9942-7cfc4703cbe5">
|
||||
|
||||
### 使用瀏覽器
|
||||
|
||||
透過 Claude 4 Sonnet 的新[電腦使用](https://www.anthropic.com/news/3-5-models-and-computer-use)功能,Cline 可以啟動瀏覽器、點選元素、輸入文字和捲動,在每個步驟擷取螢幕截圖和主控台記錄。這讓互動式除錯、端對端測試,甚至一般網頁使用成為可能!這讓他能獨立修正視覺問題和執行時錯誤,而不需要您手動複製錯誤記錄。
|
||||
|
||||
試著請 Cline 「測試應用程式」,觀察他如何執行 `npm run dev`、在瀏覽器中啟動您的本機開發伺服器,並執行一系列測試來確認一切正常運作。[點此觀看示範](https://x.com/sdrzn/status/1850880547825823989)。
|
||||
|
||||
<!-- 透明像素用於浮動圖片後的換行 -->
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/ac0efa14-5c1f-4c26-a42d-9d7c56f5fadd">
|
||||
|
||||
### 「新增一個工具來...」
|
||||
|
||||
感謝[模型上下文協定](https://github.com/modelcontextprotocol),Cline 可以透過自訂工具擴展他的功能。雖然您可以使用[社群製作的伺服器](https://github.com/modelcontextprotocol/servers),但 Cline 可以改為建立專門為您的工作流程量身打造的工具。只要請 Cline 「新增工具」,他就會處理所有事情,從建立新的 MCP 伺服器到將其安裝到擴充套件中。這些自訂工具就會成為 Cline 工具箱的一部分,隨時可用於未來的任務。
|
||||
|
||||
- 「新增一個擷取 Jira 工單的工具」:取得工單驗收條件並讓 Cline 開始工作
|
||||
- 「新增一個管理 AWS EC2 的工具」:檢查伺服器指標並調整執行個體規模
|
||||
- 「新增一個擷取最新 PagerDuty 事件的工具」:取得詳細資訊並請 Cline 修復錯誤
|
||||
|
||||
<!-- 透明像素用於浮動圖片後的換行 -->
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="left" width="360" src="https://github.com/user-attachments/assets/7fdf41e6-281a-4b4b-ac19-020b838b6970">
|
||||
|
||||
### 新增上下文
|
||||
|
||||
**`@url`**:貼上網址讓擴充套件擷取並轉換為 Markdown,當您想給 Cline 最新文件時很有用
|
||||
|
||||
**`@problems`**:新增工作區的錯誤和警告(「問題」面板)給 Cline 修正
|
||||
|
||||
**`@file`**:新增檔案內容,讓您不必浪費 API 請求來核准讀取檔案(+ 輸入以搜尋檔案)
|
||||
|
||||
**`@folder`**:一次新增整個資料夾的檔案,讓您的工作流程更快速
|
||||
|
||||
<!-- 透明像素用於浮動圖片後的換行 -->
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
<img align="right" width="350" src="https://github.com/user-attachments/assets/140c8606-d3bf-41b9-9a1f-4dbf0d4c90cb">
|
||||
|
||||
### 檢查點:比較和還原
|
||||
|
||||
當 Cline 處理任務時,擴充套件會在每個步驟擷取您工作區的快照。您可以使用「比較」按鈕檢視快照與目前工作區的差異,並使用「還原」按鈕回到該時間點。
|
||||
|
||||
例如,在使用本機網頁伺服器時,您可以使用「僅還原工作區」來快速測試應用程式的不同版本,然後在找到想要繼續開發的版本時使用「還原任務和工作區」。這讓您能安全地探索不同方法而不會失去進度。
|
||||
|
||||
<!-- 透明像素用於浮動圖片後的換行 -->
|
||||
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
|
||||
|
||||
## 貢獻
|
||||
|
||||
要為專案貢獻,請先閱讀我們的[貢獻指南](CONTRIBUTING.md)來了解基礎知識。您也可以加入我們的 [Discord](https://discord.gg/cline),在 `#contributors` 頻道與其他貢獻者交流。如果您在尋找全職工作,請檢視我們[職涯頁面](https://cline.bot/join-us)上的職缺!
|
||||
|
||||
<details>
|
||||
<summary>本機開發說明</summary>
|
||||
|
||||
1. 複製程式碼庫(需要 [git-lfs](https://git-lfs.com/)):
|
||||
|
||||
```bash
|
||||
git clone https://github.com/cline/cline.git
|
||||
```
|
||||
|
||||
2. 在 VSCode 中開啟專案:
|
||||
|
||||
```bash
|
||||
code cline
|
||||
```
|
||||
|
||||
3. 安裝擴充套件和網頁介面所需的相依套件:
|
||||
|
||||
```bash
|
||||
npm run install:all
|
||||
```
|
||||
|
||||
4. 按下 `F5`(或選擇「執行」->「開始除錯」)來啟動並開啟一個已載入擴充套件的新 VSCode 視窗。(如果建置專案時遇到問題,您可能需要安裝 [esbuild problem matchers 擴充套件](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers))
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>建立 Pull Request</summary>
|
||||
|
||||
1. 提交您的變更。
|
||||
|
||||
2. 推送您的分支並在 GitHub 上建立 PR。我們的 CI 會:
|
||||
- 執行測試和檢查
|
||||
|
||||
3. 版本管理與變更日誌整理會由維護者在發版流程中處理。
|
||||
|
||||
</details>
|
||||
|
||||
## 授權條款
|
||||
|
||||
[Apache 2.0 © 2025 Cline Bot Inc.](./LICENSE)
|
||||
Generated
+4
-4
@@ -55,7 +55,7 @@
|
||||
"@vscode/codicons": "^0.0.36",
|
||||
"archiver": "^7.0.1",
|
||||
"aws4fetch": "^1.0.20",
|
||||
"axios": "1.15.1",
|
||||
"axios": "1.15.0",
|
||||
"better-sqlite3": "^12.4.1",
|
||||
"cheerio": "^1.0.0",
|
||||
"chokidar": "^4.0.1",
|
||||
@@ -9304,9 +9304,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.15.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.15.1.tgz",
|
||||
"integrity": "sha512-WOG+Jj8ZOvR0a3rAn+Tuf1UQJRxw5venr6DgdbJzngJE3qG7X0kL83CZGpdHMxEm+ZK3seAbvFsw4FfOfP9vxg==",
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz",
|
||||
"integrity": "sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.11",
|
||||
|
||||
+19
-5
@@ -384,8 +384,17 @@
|
||||
"vscode:prepublish": "npm run package",
|
||||
"compile": "npm run check-types && npm run lint && node esbuild.mjs",
|
||||
"compile-standalone": "npm run check-types && npm run lint && node esbuild.mjs --standalone",
|
||||
"compile-standalone-npm": "npm run protos && npm run check-types && npm run lint && node esbuild.mjs --standalone",
|
||||
"cli:link": "cd cli && npm run link",
|
||||
"cli:build": "npm run protos && cd cli && npm run build",
|
||||
"cli:run": "node cli/dist/cli.mjs",
|
||||
"cli:build:production": "cd cli && npm run build:production",
|
||||
"cli:watch": "cd cli && npm run watch",
|
||||
"cli:test": "cd cli && npm run test",
|
||||
"test:install": "bash scripts/test-install.sh",
|
||||
"cli:dev": "cd cli && npm run dev",
|
||||
"postcompile-standalone": "node scripts/package-standalone.mjs",
|
||||
"postcompile-standalone-npm": "node scripts/package-npm.mjs",
|
||||
"dev": "npm run protos && npm run watch",
|
||||
"watch": "npx npm-run-all -p watch:*",
|
||||
"watch:esbuild": "node esbuild.mjs --watch",
|
||||
@@ -400,7 +409,7 @@
|
||||
"clean:all": "npm run clean:build && npm run clean:deps",
|
||||
"compile-tests": "node ./scripts/build-tests.js",
|
||||
"watch-tests": "tsc -p . -w --outDir out",
|
||||
"check-types": "npm run protos && npx tsc --noEmit && cd webview-ui && npx tsc --noEmit",
|
||||
"check-types": "npm run protos && npx tsc --noEmit && cd webview-ui && npx tsc --noEmit && cd ../cli && npx tsc --noEmit",
|
||||
"lint": "biome lint --no-errors-on-unmatched --files-ignore-unknown=true --diagnostic-level=error && npm run lint:proto",
|
||||
"lint:proto": "bash ./scripts/proto-lint.sh",
|
||||
"format": "biome format --changed --no-errors-on-unmatched --files-ignore-unknown=true --diagnostic-level=error",
|
||||
@@ -419,13 +428,14 @@
|
||||
"test:e2e:build": "vsce package --allow-package-secrets sendgrid --out dist/e2e.vsix",
|
||||
"test:e2e": "playwright install && npm run test:e2e:build && node src/test/e2e/utils/build.mjs && playwright test",
|
||||
"test:e2e:optimal": "npm run test:e2e:build && node src/test/e2e/utils/build.mjs && playwright test",
|
||||
"test:e2e:cli:tui": "cd tests/e2e/cli && tui-test",
|
||||
"test:e2e:ui": "npx tsx scripts/interactive-playwright.ts",
|
||||
"install:all": "npm install && cd webview-ui && npm install",
|
||||
"dev:webview": "cd webview-ui && npm run dev",
|
||||
"build:webview": "cd webview-ui && npm run build",
|
||||
"test:webview": "cd webview-ui && npm run test",
|
||||
"publish:marketplace": "node scripts/publish-marketplace.mjs",
|
||||
"publish:marketplace:prerelease": "node scripts/publish-marketplace.mjs --pre-release",
|
||||
"publish:marketplace": "vsce publish --allow-package-secrets sendgrid && ovsx publish",
|
||||
"publish:marketplace:prerelease": "vsce publish --allow-package-secrets sendgrid --pre-release && ovsx publish --pre-release",
|
||||
"publish:marketplace:nightly": "node ./scripts/publish-nightly.mjs",
|
||||
"prepare": "npx husky",
|
||||
"docs": "cd docs && npm run dev",
|
||||
@@ -433,7 +443,11 @@
|
||||
"docs:rename-file": "cd docs && npm run rename",
|
||||
"report-issue": "node scripts/report-issue.js",
|
||||
"storybook": "cd webview-ui && npm run storybook",
|
||||
"eval:smoke:run": "npx tsx evals/smoke-tests/run-smoke-tests.ts"
|
||||
"cli:unlink": "cd cli && npm run unlink",
|
||||
"eval:smoke:build": "npm run cli:build && npm run cli:link",
|
||||
"eval:smoke:run": "npx tsx evals/smoke-tests/run-smoke-tests.ts",
|
||||
"eval:smoke": "npm run eval:smoke:build && npm run eval:smoke:run",
|
||||
"eval:smoke:ci": "npm run eval:smoke:build && npm run eval:smoke:run -- --trials 1 --parallel"
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/shared/storage/state-keys.ts": [
|
||||
@@ -534,7 +548,7 @@
|
||||
"@vscode/codicons": "^0.0.36",
|
||||
"archiver": "^7.0.1",
|
||||
"aws4fetch": "^1.0.20",
|
||||
"axios": "1.15.1",
|
||||
"axios": "1.15.0",
|
||||
"better-sqlite3": "^12.4.1",
|
||||
"cheerio": "^1.0.0",
|
||||
"chokidar": "^4.0.1",
|
||||
|
||||
@@ -38,11 +38,6 @@ service WorkspaceService {
|
||||
|
||||
// Opens a folder/workspace in the IDE
|
||||
rpc openFolder(OpenFolderRequest) returns (OpenFolderResponse);
|
||||
|
||||
// Searches workspace files/folders by name using the host's native index
|
||||
// (e.g. IntelliJ FilenameIndex). Hosts that lack a fast index should leave
|
||||
// this UNIMPLEMENTED so the caller can fall back to ripgrep.
|
||||
rpc searchWorkspaceItems(SearchWorkspaceItemsRequest) returns (SearchWorkspaceItemsResponse);
|
||||
}
|
||||
|
||||
message GetWorkspacePathsRequest {
|
||||
@@ -84,11 +79,6 @@ message SearchWorkspaceItemsRequest {
|
||||
FOLDER = 1;
|
||||
}
|
||||
optional SearchItemType selected_type = 3;
|
||||
// Absolute path of the workspace/content root to scope the search to. In
|
||||
// multi-root projects the caller invokes the RPC once per root and sets
|
||||
// this so the host returns only files under that root and relativizes
|
||||
// paths against it. Hosts that can't honor it should ignore it.
|
||||
optional string workspace_path = 4;
|
||||
}
|
||||
|
||||
// Response for host-side workspace search
|
||||
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
# Build CLI release for a specific ref/commit using GitHub Actions
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/build-cli-artifact.sh [ref] [pr_number]
|
||||
#
|
||||
# Examples:
|
||||
# ./scripts/build-cli-artifact.sh # Build from current branch
|
||||
# ./scripts/build-cli-artifact.sh main # Build from main branch
|
||||
# ./scripts/build-cli-artifact.sh abc123 # Build from commit abc123
|
||||
# ./scripts/build-cli-artifact.sh feature/new 1234 # Build from branch and comment on PR #1234
|
||||
|
||||
set -e
|
||||
|
||||
REF="${1:-$(git rev-parse --abbrev-ref HEAD)}"
|
||||
PR_NUMBER="${2:-}"
|
||||
|
||||
echo "🚀 Triggering CLI build workflow..."
|
||||
echo " Branch/commit: $REF"
|
||||
|
||||
# Build args array
|
||||
ARGS=(-f "ref=$REF")
|
||||
|
||||
if [ -n "$PR_NUMBER" ]; then
|
||||
ARGS+=(-f "pr_number=$PR_NUMBER")
|
||||
echo " Will comment on PR #$PR_NUMBER"
|
||||
fi
|
||||
|
||||
# Trigger the workflow
|
||||
gh workflow run pack-cli.yml "${ARGS[@]}"
|
||||
|
||||
echo ""
|
||||
echo "✅ Workflow triggered!"
|
||||
echo ""
|
||||
echo "The workflow will create a GitHub Release with a public download URL."
|
||||
echo ""
|
||||
echo "To monitor the workflow:"
|
||||
echo " gh run list --workflow=pack-cli.yml --limit 5"
|
||||
echo ""
|
||||
echo "Once complete, find the release:"
|
||||
echo " gh release list --limit 10"
|
||||
echo ""
|
||||
echo "Install from the release URL (no authentication required):"
|
||||
echo " npm install -g https://github.com/cline/cline/releases/download/cli-build-<commit>/cline-<version>.tgz"
|
||||
@@ -1,90 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Swap README.md with README.marketplace.md so the VS Code Marketplace listing
|
||||
// (which is generated from the README baked into the .vsix at package time)
|
||||
// keeps the extension-focused content even after the repo's README.md is
|
||||
// repurposed as a multi-product landing page.
|
||||
//
|
||||
// The README files diverge in two directions:
|
||||
// - README.md is what GitHub renders on the repo home page. We want this to
|
||||
// cover the SDK, JetBrains plugin, CLI, and VS Code extension together.
|
||||
// - README.marketplace.md is what users see on the VS Code Marketplace and
|
||||
// inside the extension after install. It stays focused on the VS Code UX.
|
||||
//
|
||||
// vsce reads README.md from the extension root at `vsce package` / `vsce publish`
|
||||
// time and has no flag to point it elsewhere, so we copy README.marketplace.md
|
||||
// over README.md just before packaging and put the original back afterwards.
|
||||
//
|
||||
// swapIn is idempotent: if README.md already matches README.marketplace.md
|
||||
// (e.g., an outer wrapper has already swapped), it no-ops instead of erroring
|
||||
// on the backup file. This lets nested callers (publish.yml wrapping the whole
|
||||
// step, plus the individual npm scripts swapping internally) coexist safely.
|
||||
|
||||
import fs from "node:fs"
|
||||
import path from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const projectRoot = path.join(__dirname, "..")
|
||||
|
||||
const README_PATH = path.join(projectRoot, "README.md")
|
||||
const MARKETPLACE_PATH = path.join(projectRoot, "README.marketplace.md")
|
||||
const BACKUP_PATH = path.join(projectRoot, ".README.github.bak")
|
||||
|
||||
function readFile(p) {
|
||||
return fs.readFileSync(p, "utf-8")
|
||||
}
|
||||
|
||||
export function swapIn() {
|
||||
if (!fs.existsSync(MARKETPLACE_PATH)) {
|
||||
throw new Error(`Missing ${MARKETPLACE_PATH}. The marketplace README must exist before publishing.`)
|
||||
}
|
||||
if (!fs.existsSync(README_PATH)) {
|
||||
throw new Error(`Missing ${README_PATH}. Cannot swap in marketplace README.`)
|
||||
}
|
||||
|
||||
if (readFile(README_PATH) === readFile(MARKETPLACE_PATH)) {
|
||||
return { skipped: true }
|
||||
}
|
||||
|
||||
if (fs.existsSync(BACKUP_PATH)) {
|
||||
throw new Error(
|
||||
`Stale backup at ${BACKUP_PATH}. A previous publish may have aborted before restoring README.md. ` +
|
||||
`Move it back to README.md manually before retrying.`,
|
||||
)
|
||||
}
|
||||
|
||||
fs.copyFileSync(README_PATH, BACKUP_PATH)
|
||||
fs.copyFileSync(MARKETPLACE_PATH, README_PATH)
|
||||
return { skipped: false }
|
||||
}
|
||||
|
||||
export function restore() {
|
||||
if (!fs.existsSync(BACKUP_PATH)) {
|
||||
return { skipped: true }
|
||||
}
|
||||
fs.copyFileSync(BACKUP_PATH, README_PATH)
|
||||
fs.unlinkSync(BACKUP_PATH)
|
||||
return { skipped: false }
|
||||
}
|
||||
|
||||
const invokedAsCli = process.argv[1] && path.resolve(process.argv[1]) === path.resolve(__filename)
|
||||
if (invokedAsCli) {
|
||||
const cmd = process.argv[2]
|
||||
try {
|
||||
if (cmd === "swap-in") {
|
||||
const result = swapIn()
|
||||
console.log(result.skipped ? "marketplace-readme: already swapped, skipping" : "marketplace-readme: swapped in")
|
||||
} else if (cmd === "restore") {
|
||||
const result = restore()
|
||||
console.log(result.skipped ? "marketplace-readme: no backup, skipping" : "marketplace-readme: restored")
|
||||
} else {
|
||||
console.error("Usage: marketplace-readme.mjs <swap-in|restore>")
|
||||
process.exit(2)
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`marketplace-readme: ${err.message}`)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* NPM Package Builder for Cline CLI
|
||||
*
|
||||
* This script builds the Cline CLI NPM package (dist-standalone/).
|
||||
* It packages the CLI from cli/.
|
||||
*
|
||||
* Usage: node scripts/package-npm.mjs
|
||||
*
|
||||
* Prerequisites:
|
||||
* - cd cli && npm run build:production
|
||||
*/
|
||||
|
||||
import { fileURLToPath } from "node:url"
|
||||
import { execSync } from "child_process"
|
||||
import dotenv from "dotenv"
|
||||
import fs from "fs"
|
||||
import { cp } from "fs/promises"
|
||||
import path from "path"
|
||||
|
||||
const BUILD_DIR = "dist-standalone"
|
||||
const CLI_DIR = "cli"
|
||||
const IS_VERBOSE = process.argv.includes("-v") || process.argv.includes("--verbose")
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const rootDir = path.resolve(__dirname, "..")
|
||||
// Load .env from repo root
|
||||
dotenv.config({ path: path.join(rootDir, ".env") })
|
||||
|
||||
async function main() {
|
||||
console.log("🚀 Building Cline CLI NPM Package (TypeScript)\n")
|
||||
|
||||
await cleanBuildDir()
|
||||
setupEnvironmentVariables()
|
||||
|
||||
await buildTypeScriptCli()
|
||||
await copyCliDist()
|
||||
await copyPackageJson()
|
||||
await copyReadme()
|
||||
await createNpmIgnoreFile()
|
||||
|
||||
console.log("\n✅ Build complete!")
|
||||
console.log(`\n📦 NPM package ready in ${BUILD_DIR}/`)
|
||||
console.log(`To publish: cd ${BUILD_DIR} && npm publish`)
|
||||
}
|
||||
|
||||
function setupEnvironmentVariables() {
|
||||
// Use a different API key for CLI error capturing, to redirect CLI errors to a different project
|
||||
const cliErrorTrackingKey = process.env.CLI_ERROR_SERVICE_API_KEY
|
||||
if (cliErrorTrackingKey) {
|
||||
process.env.ERROR_SERVICE_API_KEY = cliErrorTrackingKey
|
||||
// If we're sending to a different project, enable exception autocapture
|
||||
process.env.ENABLE_ERROR_AUTOCAPTURE = "true"
|
||||
log_verbose("Set ERROR_SERVICE_API_KEY for build")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean the build directory
|
||||
*/
|
||||
async function cleanBuildDir() {
|
||||
console.log("Cleaning build directory...")
|
||||
await rmrf(BUILD_DIR)
|
||||
fs.mkdirSync(BUILD_DIR, { recursive: true })
|
||||
console.log(`✓ ${BUILD_DIR}/ cleaned`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the TypeScript CLI
|
||||
*/
|
||||
async function buildTypeScriptCli() {
|
||||
console.log("Building TypeScript CLI...")
|
||||
|
||||
// Install dependencies if needed
|
||||
if (!fs.existsSync(path.join(CLI_DIR, "node_modules"))) {
|
||||
console.log("Installing cli dependencies...")
|
||||
execSync("npm install", { stdio: "inherit", cwd: CLI_DIR })
|
||||
}
|
||||
|
||||
// Build production bundle
|
||||
execSync("npm run build:production", { stdio: "inherit", cwd: CLI_DIR, env: process.env })
|
||||
console.log("✓ TypeScript CLI built")
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy the CLI dist folder to build directory
|
||||
*/
|
||||
async function copyCliDist() {
|
||||
console.log("Copying CLI distribution files...")
|
||||
|
||||
const distSource = path.join(CLI_DIR, "dist")
|
||||
const distDest = path.join(BUILD_DIR, "dist")
|
||||
|
||||
if (!fs.existsSync(distSource)) {
|
||||
console.error(`Error: CLI dist not found at ${distSource}`)
|
||||
console.error(`Please run: cd cli && npm run build:production`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
await cpr(distSource, distDest)
|
||||
|
||||
// Make the CLI executable
|
||||
const cliPath = path.join(distDest, "cli.mjs")
|
||||
if (fs.existsSync(cliPath)) {
|
||||
fs.chmodSync(cliPath, 0o755)
|
||||
}
|
||||
|
||||
console.log(`✓ CLI dist copied to ${distDest}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy package.json from cli/ directory
|
||||
*/
|
||||
async function copyPackageJson() {
|
||||
console.log("Copying package.json...")
|
||||
const source = path.join(CLI_DIR, "package.json")
|
||||
const dest = path.join(BUILD_DIR, "package.json")
|
||||
await cpr(source, dest)
|
||||
console.log(`✓ package.json copied`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy README.md from cli/ directory
|
||||
*/
|
||||
async function copyReadme() {
|
||||
console.log("Copying README...")
|
||||
|
||||
// Try cli README first, fall back to cli/ README
|
||||
let readmeSource = path.join(CLI_DIR, "README.md")
|
||||
|
||||
if (!fs.existsSync(readmeSource)) {
|
||||
readmeSource = path.join("cli", "README.md")
|
||||
}
|
||||
|
||||
if (!fs.existsSync(readmeSource)) {
|
||||
console.warn("Warning: No README.md found, skipping")
|
||||
return
|
||||
}
|
||||
|
||||
const readmeDest = path.join(BUILD_DIR, "README.md")
|
||||
await cpr(readmeSource, readmeDest)
|
||||
console.log(`✓ README.md copied from ${readmeSource}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create .npmignore file to exclude unnecessary files
|
||||
*/
|
||||
async function createNpmIgnoreFile() {
|
||||
console.log("Creating .npmignore file...")
|
||||
|
||||
const npmignoreContent = `# Exclude build artifacts and unnecessary files
|
||||
*.map
|
||||
*.ts
|
||||
!*.d.ts
|
||||
tsconfig.json
|
||||
.eslintrc*
|
||||
.prettierrc*
|
||||
`
|
||||
|
||||
const npmignorePath = path.join(BUILD_DIR, ".npmignore")
|
||||
fs.writeFileSync(npmignorePath, npmignoreContent)
|
||||
|
||||
console.log(`✓ .npmignore created`)
|
||||
}
|
||||
|
||||
/* cp -r */
|
||||
async function cpr(source, dest) {
|
||||
log_verbose(`Copying ${source} -> ${dest}`)
|
||||
await cp(source, dest, {
|
||||
recursive: true,
|
||||
preserveTimestamps: true,
|
||||
dereference: false,
|
||||
})
|
||||
}
|
||||
|
||||
/* rm -rf */
|
||||
async function rmrf(dir) {
|
||||
if (fs.existsSync(dir)) {
|
||||
log_verbose(`Removing ${dir}`)
|
||||
fs.rmSync(dir, { recursive: true, force: true })
|
||||
}
|
||||
}
|
||||
|
||||
function log_verbose(...args) {
|
||||
if (IS_VERBOSE) {
|
||||
console.log(...args)
|
||||
}
|
||||
}
|
||||
|
||||
await main()
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Wraps the marketplace publish flow (vsce + ovsx) so the .vsix gets packaged
|
||||
// with the marketplace-flavored README instead of the GitHub-flavored README.
|
||||
//
|
||||
// vsce reads README.md from the extension root at publish time and there's no
|
||||
// flag to point it elsewhere, so we swap README.marketplace.md into place
|
||||
// first and restore the original on the way out. The swap helper is
|
||||
// idempotent, so this is safe to run nested under another wrapper (e.g., the
|
||||
// CI step in .github/workflows/publish.yml that also packages a .vsix for the
|
||||
// GitHub release artifact before invoking this script).
|
||||
//
|
||||
// Usage:
|
||||
// node scripts/publish-marketplace.mjs # release channel
|
||||
// node scripts/publish-marketplace.mjs --pre-release # pre-release channel
|
||||
|
||||
import { execFileSync } from "node:child_process"
|
||||
import { restore, swapIn } from "./marketplace-readme.mjs"
|
||||
|
||||
const isPrerelease = process.argv.includes("--pre-release")
|
||||
|
||||
const result = swapIn()
|
||||
|
||||
let interrupted = false
|
||||
const cleanupOnSignal = (exitCode) => () => {
|
||||
interrupted = true
|
||||
try {
|
||||
if (!result.skipped) {
|
||||
restore()
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`marketplace-readme: failed to restore on signal: ${err.message}`)
|
||||
}
|
||||
process.exit(exitCode)
|
||||
}
|
||||
process.on("SIGINT", cleanupOnSignal(130))
|
||||
process.on("SIGTERM", cleanupOnSignal(143))
|
||||
|
||||
try {
|
||||
const vsceArgs = ["publish", "--allow-package-secrets", "sendgrid"]
|
||||
if (isPrerelease) {
|
||||
vsceArgs.push("--pre-release")
|
||||
}
|
||||
execFileSync("vsce", vsceArgs, { stdio: "inherit" })
|
||||
|
||||
const ovsxArgs = ["ovsx", "publish"]
|
||||
if (isPrerelease) {
|
||||
ovsxArgs.push("--pre-release")
|
||||
}
|
||||
execFileSync("npx", ovsxArgs, { stdio: "inherit" })
|
||||
} finally {
|
||||
if (!interrupted && !result.skipped) {
|
||||
restore()
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,6 @@ import { execFileSync, execSync } from "node:child_process"
|
||||
import fs from "node:fs"
|
||||
import path from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
import { restore as restoreMarketplaceReadme, swapIn as swapInMarketplaceReadme } from "./marketplace-readme.mjs"
|
||||
|
||||
// Get __dirname equivalent in ES modules
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
@@ -110,7 +109,6 @@ class NightlyPublisher {
|
||||
this.hasBackup = false
|
||||
this.didRenameWorkspaceLink = false
|
||||
this.didCreateNightlyWorkspaceLink = false
|
||||
this.didSwapMarketplaceReadme = false
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -294,35 +292,6 @@ class NightlyPublisher {
|
||||
this.didCreateNightlyWorkspaceLink = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Swap README.marketplace.md into README.md so the .vsix is packaged with
|
||||
* the marketplace-flavored README. vsce reads README.md from disk at
|
||||
* `vsce package` time and there's no flag to redirect it.
|
||||
*/
|
||||
swapMarketplaceReadme() {
|
||||
const result = swapInMarketplaceReadme()
|
||||
this.didSwapMarketplaceReadme = !result.skipped
|
||||
if (this.didSwapMarketplaceReadme) {
|
||||
log.info("Swapped README.marketplace.md into README.md for packaging")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore README.md if this publisher performed the swap.
|
||||
*/
|
||||
restoreMarketplaceReadme() {
|
||||
if (!this.didSwapMarketplaceReadme) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
restoreMarketplaceReadme()
|
||||
log.info("Restored original README.md")
|
||||
} catch (error) {
|
||||
log.error(`Failed to restore README.md: ${error.message}`)
|
||||
}
|
||||
this.didSwapMarketplaceReadme = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate new version with timestamp
|
||||
* Format: major.minor.timestamp
|
||||
@@ -496,9 +465,6 @@ class NightlyPublisher {
|
||||
// Step 3.5: Keep npm workspace self-link aligned with nightly package name
|
||||
this.reconcileWorkspaceSelfLinkForNightly()
|
||||
|
||||
// Step 3.6: Swap in marketplace README before packaging
|
||||
this.swapMarketplaceReadme()
|
||||
|
||||
// Step 4: Package extension
|
||||
this.packageExtension(isPreRelease)
|
||||
|
||||
@@ -530,9 +496,6 @@ class NightlyPublisher {
|
||||
|
||||
// Always restore package.json
|
||||
this.restorePackageJson()
|
||||
|
||||
// Always restore README.md
|
||||
this.restoreMarketplaceReadme()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -543,14 +506,12 @@ const publisher = new NightlyPublisher()
|
||||
process.on("exit", () => {
|
||||
publisher.restoreWorkspaceSelfLink()
|
||||
publisher.restorePackageJson()
|
||||
publisher.restoreMarketplaceReadme()
|
||||
})
|
||||
|
||||
process.on("SIGINT", () => {
|
||||
log.info("\nInterrupted, cleaning up...")
|
||||
publisher.restoreWorkspaceSelfLink()
|
||||
publisher.restorePackageJson()
|
||||
publisher.restoreMarketplaceReadme()
|
||||
process.exit(130)
|
||||
})
|
||||
|
||||
@@ -558,7 +519,6 @@ process.on("SIGTERM", () => {
|
||||
log.info("\nTerminated, cleaning up...")
|
||||
publisher.restoreWorkspaceSelfLink()
|
||||
publisher.restorePackageJson()
|
||||
publisher.restoreMarketplaceReadme()
|
||||
process.exit(143)
|
||||
})
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
### Worktree Dependency Hygiene
|
||||
|
||||
When working in a git worktree, verify dependency links before running CLI repros,
|
||||
tests, hooks, or commits. `node_modules` symlinks can accidentally point at
|
||||
another checkout, causing mixed-source type errors or runtime behavior.
|
||||
|
||||
Quick check:
|
||||
|
||||
```sh
|
||||
realpath node_modules packages/core/node_modules packages/core/node_modules/@cline/llms
|
||||
```
|
||||
|
||||
All paths should stay under the current worktree. If any path points to another
|
||||
checkout, remove the bad `node_modules` symlinks and run `bun install` from the
|
||||
worktree root before trusting test or hook results.
|
||||
@@ -1,892 +0,0 @@
|
||||
---
|
||||
name: cline-plugin
|
||||
description: Self-contained guide to designing, building, packaging, and distributing a plugin for any Cline-based agent (CLI, VS Code, Kanban, JetBrains, custom SDK hosts). Covers both single-file plugins and full plugin packages.
|
||||
---
|
||||
|
||||
# Authoring a Cline Agent Plugin
|
||||
|
||||
A **Cline plugin** is a TypeScript module that extends any agent built on the Cline Core SDK. The same plugin runs in the Cline CLI, the VS Code and JetBrains extensions, the Kanban host, and any custom app built on `@cline/core` — write it once, every host gets the new behavior.
|
||||
|
||||
A plugin can:
|
||||
|
||||
- **Register tools** the model can call (the most common use).
|
||||
- **Hook into the agent loop** before/after runs, model calls, and tool calls.
|
||||
- **Rewrite provider messages** before they hit the model (custom compaction, redaction, context shaping).
|
||||
- **Register slash commands**, **prompt rules**, **providers**, and **automation event types**.
|
||||
|
||||
A plugin ships in one of two shapes:
|
||||
|
||||
1. **Single-file plugin** — one `.ts` file that exports a default plugin object. Drop it in a discovery folder and it's loaded.
|
||||
2. **Plugin package** — a directory with `package.json`, npm dependencies, and (optionally) bundled assets like markdown templates. Installable via `cline plugin install`.
|
||||
|
||||
Both shapes use the same plugin API. The package form just adds dependency management and asset bundling.
|
||||
|
||||
This guide is self-contained. By the end of it, you'll be able to build either kind from scratch.
|
||||
|
||||
---
|
||||
|
||||
## 1. The mental model
|
||||
|
||||
When the host starts a session, it builds a registry of plugins and runs four phases:
|
||||
|
||||
1. **resolve** — collect the plugin objects.
|
||||
2. **validate** — check each plugin's `manifest`. Capabilities must be non-empty; declared hook stages must have matching handlers; if `hooks` is present, `"hooks"` must be in `capabilities`.
|
||||
3. **setup** — call each plugin's `setup(api, ctx)` once. This is where you `registerTool`, `registerCommand`, etc.
|
||||
4. **activate** — registry is frozen, the agent loop starts, and your hooks/tools are live.
|
||||
|
||||
Two invariants the registry enforces:
|
||||
|
||||
- **Every contribution requires a matching capability.** Calling `api.registerRule(...)` without `"rules"` in `manifest.capabilities` throws.
|
||||
- **Capabilities and handlers must agree.** Declaring `"hooks"` without a `hooks` object, or vice versa, fails validation.
|
||||
|
||||
After validation, registration is one-shot — there's no dynamic register/unregister during the session.
|
||||
|
||||
---
|
||||
|
||||
## 2. The smallest working plugin
|
||||
|
||||
```ts
|
||||
import type { AgentPlugin } from "@cline/core";
|
||||
import { createTool } from "@cline/core";
|
||||
|
||||
const plugin: AgentPlugin = {
|
||||
name: "hello-plugin", // required, unique within a session
|
||||
manifest: {
|
||||
capabilities: ["tools"], // declares what setup() will register
|
||||
},
|
||||
setup(api, ctx) {
|
||||
api.registerTool(
|
||||
createTool({
|
||||
name: "say_hello",
|
||||
description: "Greet a person by name.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: { name: { type: "string" } },
|
||||
required: ["name"],
|
||||
},
|
||||
async execute({ name }: { name: string }) {
|
||||
return { greeting: `Hello, ${name}!` };
|
||||
},
|
||||
}),
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default plugin;
|
||||
```
|
||||
|
||||
That's a complete plugin. The agent will see `say_hello` as a callable tool.
|
||||
|
||||
---
|
||||
|
||||
## 3. The manifest
|
||||
|
||||
```ts
|
||||
manifest: {
|
||||
capabilities: ["tools", "hooks"], // required — non-empty array
|
||||
paths?: string[], // optional — multi-entry packages
|
||||
providerIds?: string[], // optional — provider plugins
|
||||
modelIds?: string[], // optional — model plugins
|
||||
}
|
||||
```
|
||||
|
||||
| Field | When to use |
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| `capabilities` | Always. Lists what the plugin contributes; gates the corresponding `api.register*` methods. |
|
||||
| `paths` | Only inside a `package.json` `cline.plugins` entry — when one package exposes multiple plugin entry points. |
|
||||
| `providerIds` | When `capabilities` includes `"providers"` — declares which provider IDs you register. |
|
||||
| `modelIds` | When you contribute models tied to specific IDs. |
|
||||
|
||||
### The complete capability list
|
||||
|
||||
| Capability | What it unlocks in `api` |
|
||||
| ------------------ | --------------------------------------------------------------------- |
|
||||
| `tools` | `api.registerTool()` |
|
||||
| `commands` | `api.registerCommand()` (slash commands in chat surfaces) |
|
||||
| `rules` | `api.registerRule()` (string injected into the system prompt) |
|
||||
| `messageBuilders` | `api.registerMessageBuilder()` (rewrites provider-bound messages) |
|
||||
| `providers` | `api.registerProvider()` (e.g. a custom model provider) |
|
||||
| `automationEvents` | `api.registerAutomationEventType()` and `ctx.automation?.ingestEvent()` |
|
||||
| `hooks` | The runtime `hooks` object on the plugin (lifecycle callbacks) |
|
||||
|
||||
You declare any combination — most real plugins need 1–3 capabilities.
|
||||
|
||||
---
|
||||
|
||||
## 4. `setup(api, ctx)` — the registration phase
|
||||
|
||||
`setup()` runs **once per session** before the agent loop starts. Everything you register here is frozen for the lifetime of the session.
|
||||
|
||||
### 4.1 The `api` object
|
||||
|
||||
Each `register*` method requires the matching capability in your manifest:
|
||||
|
||||
```ts
|
||||
api.registerTool(tool); // requires "tools"
|
||||
api.registerCommand({ name, description, handler }); // requires "commands"
|
||||
api.registerRule({ id, content, source }); // requires "rules"
|
||||
api.registerMessageBuilder({ name, build }); // requires "messageBuilders"
|
||||
api.registerProvider({ name, description }); // requires "providers"
|
||||
api.registerAutomationEventType({ eventType, source, /* ... */ }); // requires "automationEvents"
|
||||
```
|
||||
|
||||
### 4.2 The `ctx` object — host-provided session context
|
||||
|
||||
The second argument carries everything the host knows about the current session. **All fields are optional**, so feature-detect before using them — the same plugin must work in hosts that supply less context (unit tests, sandboxed plugin processes).
|
||||
|
||||
```ts
|
||||
ctx.session?.sessionId // string — stable core session id
|
||||
ctx.client?.name // host: "cline-cli", "cline-vscode", etc.
|
||||
ctx.user // authenticated user/org info, when available
|
||||
ctx.workspaceInfo // { rootPath, hint, latestGitBranchName,
|
||||
// latestGitCommitHash, associatedRemoteUrls }
|
||||
ctx.automation?.ingestEvent // emit normalized automation events
|
||||
ctx.logger?.log // structured logger scoped to this plugin
|
||||
ctx.telemetry // ITelemetryService — only present in-process
|
||||
```
|
||||
|
||||
**Two big rules about `ctx.workspaceInfo`:**
|
||||
|
||||
1. **Always prefer `ctx.workspaceInfo?.rootPath` over `process.cwd()`.** The CLI may have been launched with `--cwd` without calling `chdir`, and VS Code workspaces don't share a single CWD. `workspaceInfo` is sourced from the session config and is always correct.
|
||||
2. **Don't use `import.meta.url` tricks to find "the workspace".** That gives you the plugin's own location, not the user's project.
|
||||
|
||||
### 4.3 Persisting state across hooks
|
||||
|
||||
`setup()` runs first; hooks fire later. The simplest way to share state is module-level variables in your plugin file:
|
||||
|
||||
```ts
|
||||
let sessionWorkspaceRoot: string | undefined;
|
||||
let sessionBranch: string | undefined;
|
||||
|
||||
const plugin: AgentPlugin = {
|
||||
name: "metrics",
|
||||
manifest: { capabilities: ["hooks"] },
|
||||
setup(api, ctx) {
|
||||
sessionWorkspaceRoot = ctx.workspaceInfo?.rootPath;
|
||||
sessionBranch = ctx.workspaceInfo?.latestGitBranchName;
|
||||
},
|
||||
hooks: {
|
||||
beforeTool({ toolCall, input }) {
|
||||
if (sessionBranch === "main" && toolCall.toolName === "run_commands") {
|
||||
// Inspect input, optionally block.
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
A single Node process may host multiple sessions concurrently. If your plugin will run in a multi-session host, key your state by `ctx.session?.sessionId` instead of using module-level singletons:
|
||||
|
||||
```ts
|
||||
const stateBySession = new Map<string, MyState>();
|
||||
setup(api, ctx) {
|
||||
const id = ctx.session?.sessionId;
|
||||
if (id) stateBySession.set(id, /* ... */);
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Tools — `api.registerTool`
|
||||
|
||||
Tools are how plugins give the agent new capabilities. Use the `createTool()` helper from `@cline/core`:
|
||||
|
||||
```ts
|
||||
import { createTool } from "@cline/core";
|
||||
|
||||
api.registerTool(
|
||||
createTool({
|
||||
name: "get_weather", // visible to the model
|
||||
description: "Get current weather for a city.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
city: { type: "string", description: "The city name" },
|
||||
},
|
||||
required: ["city"],
|
||||
},
|
||||
async execute(input, context) {
|
||||
const { city } = input as { city: string };
|
||||
// context.sessionId, context.conversationId, context.cwd are available
|
||||
return { city, temperature: "72°F", condition: "sunny" };
|
||||
},
|
||||
}),
|
||||
);
|
||||
```
|
||||
|
||||
Guidelines for good tools:
|
||||
|
||||
- **Names are snake_case verbs** — `goto_definition`, `start_background_command`.
|
||||
- **Descriptions are written for the model**, not for humans. Include when to use the tool, what inputs mean, and what the output looks like.
|
||||
- **Inputs are JSON Schema.** Mark `required` fields explicitly. Constrain enums where possible.
|
||||
- **Return JSON-serializable values** — strings, numbers, plain objects, arrays. The host serializes results before passing them back to the model.
|
||||
- **Throw on invalid input or hard failure.** The runtime turns thrown errors into tool error results the model can recover from.
|
||||
- **Keep tools focused.** A `start / get / delete` triplet of small tools beats one mega-tool with a `mode` enum.
|
||||
|
||||
---
|
||||
|
||||
## 6. Runtime hooks — `hooks: { ... }`
|
||||
|
||||
Runtime hooks are typed in-process callbacks on the same hook layer the runtime uses internally. They run inside the agent loop with full type information — no IPC, no JSON marshaling.
|
||||
|
||||
Declare `"hooks"` in `manifest.capabilities`, then add a `hooks` property:
|
||||
|
||||
```ts
|
||||
const plugin: AgentPlugin = {
|
||||
name: "metrics",
|
||||
manifest: { capabilities: ["hooks"] },
|
||||
hooks: {
|
||||
beforeRun(ctx) { /* ... */ },
|
||||
beforeTool({ toolCall, input }) { /* ... */ },
|
||||
afterTool({ toolCall, result }) { /* ... */ },
|
||||
afterRun({ result }) { /* ... */ },
|
||||
onEvent(event) { /* ... */ },
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### 6.1 The seven hooks
|
||||
|
||||
| Hook | Fires | Can stop the loop? | Common uses |
|
||||
| ------------- | ---------------------------------------------------------- | ------------------ | ------------------------------------------------------ |
|
||||
| `beforeRun` | Before the runtime loop starts (one user turn) | Yes | Greet, log, attach session metadata |
|
||||
| `afterRun` | After the runtime loop finishes (success, abort, or fail) | No | Notifications, metrics, persistent logs |
|
||||
| `beforeModel` | Before each model request | Yes (mutate req) | Inject context, last-mile prompt edits |
|
||||
| `afterModel` | After each model response, before tool execution | Yes | Block based on model output |
|
||||
| `beforeTool` | Before each tool execution | Yes (`{ stop }`) | Audit, redact, block dangerous tools |
|
||||
| `afterTool` | After each tool execution | Can replace result | Post-process, redact secrets in tool output |
|
||||
| `onEvent` | On every `AgentRuntimeEvent` emitted by the runtime | No | Streaming UIs, telemetry pipes |
|
||||
|
||||
### 6.2 Stopping the loop from a hook
|
||||
|
||||
Several hooks return an optional control object. The most common pattern is `beforeTool` blocking a destructive tool call:
|
||||
|
||||
```ts
|
||||
beforeTool({ toolCall, input }) {
|
||||
if (toolCall.toolName === "run_commands") {
|
||||
const { commands } = input as { commands?: string[] };
|
||||
if (sessionBranch === "main" && commands?.some(c => c.startsWith("git push"))) {
|
||||
return { stop: true, reason: "Blocked git push on protected branch" };
|
||||
}
|
||||
}
|
||||
return undefined; // explicit "continue"
|
||||
}
|
||||
```
|
||||
|
||||
Returning `undefined` (or omitting `return`) lets execution continue normally.
|
||||
|
||||
### 6.3 `afterRun` semantics
|
||||
|
||||
`afterRun` fires for **every** terminal status — `completed`, `aborted`, `failed`. If you only want to act on success:
|
||||
|
||||
```ts
|
||||
afterRun({ result }) {
|
||||
if (result.status !== "completed") return;
|
||||
// notify, log success metrics, etc.
|
||||
}
|
||||
```
|
||||
|
||||
### 6.4 Plugin hooks vs file hooks
|
||||
|
||||
The runtime supports two hook systems:
|
||||
|
||||
- **File hooks** — external scripts in `.cline/hooks/` invoked with serialized JSON. Right for user/workspace-specific scripts that don't ship with code.
|
||||
- **Plugin runtime hooks** — typed in-process callbacks. Right when the behavior belongs to a reusable extension and needs typed access to the runtime.
|
||||
|
||||
Core adapts file hooks onto the runtime hook layer, so you don't need both. If you're shipping a plugin, write it as runtime hooks.
|
||||
|
||||
---
|
||||
|
||||
## 7. Message builders — `api.registerMessageBuilder`
|
||||
|
||||
Message builders rewrite the **provider-bound message list** before the model call. They run after runtime messages are converted into SDK message blocks but **before** core's built-in safety builder, which always has the final say on provider-safe truncation.
|
||||
|
||||
Use them for:
|
||||
|
||||
- Custom compaction policies (replace middle history with a summary).
|
||||
- Redacting PII or secrets before they reach the provider.
|
||||
- Reshaping context for a specific model's strengths.
|
||||
|
||||
```ts
|
||||
api.registerMessageBuilder({
|
||||
name: "summarize-middle-history",
|
||||
build(messages) {
|
||||
if (estimateTokens(messages) < THRESHOLD) return messages;
|
||||
return [...prefix, summary, ...recent];
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Multiple builders run in registration order; the output of one is the input of the next.
|
||||
|
||||
**When to use `beforeModel` instead.** Reach for the `beforeModel` hook only if you need the runtime snapshot or want to mutate the request object itself. Pure message rewrites belong in a builder.
|
||||
|
||||
---
|
||||
|
||||
## 8. Automation events — `api.registerAutomationEventType` + `ctx.automation`
|
||||
|
||||
Plugins can declare normalized event types and emit them into Cline automation. Hosts that don't have automation enabled simply ignore both — your plugin should feature-detect `ctx.automation`.
|
||||
|
||||
```ts
|
||||
manifest: { capabilities: ["automationEvents"] },
|
||||
|
||||
setup(api, ctx) {
|
||||
api.registerAutomationEventType({
|
||||
eventType: "github.pull_request.opened",
|
||||
source: "github",
|
||||
description: "A new GitHub PR was opened",
|
||||
attributesSchema: { /* JSON Schema for envelope.attributes */ },
|
||||
});
|
||||
|
||||
if (!ctx.automation) return; // host has no automation
|
||||
ctx.automation.ingestEvent({
|
||||
eventId: "pr-1234",
|
||||
eventType: "github.pull_request.opened",
|
||||
source: "github",
|
||||
subject: "owner/repo#1234",
|
||||
occurredAt: new Date().toISOString(),
|
||||
attributes: { /* ... */ },
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 9. Loading a plugin
|
||||
|
||||
There are three ways a plugin gets into a session:
|
||||
|
||||
### 9.1 Auto-discovery (CLI)
|
||||
|
||||
The CLI scans these directories on startup:
|
||||
|
||||
- `<workspace>/.cline/plugins/` — project-scoped plugins (committed or gitignored).
|
||||
- `~/.cline/plugins/` — user-scoped plugins.
|
||||
- The system "Plugins" folder — host-managed installs.
|
||||
|
||||
Drop a `.ts` or `.js` file in, run `cline`, done:
|
||||
|
||||
```bash
|
||||
mkdir -p .cline/plugins
|
||||
cp my-plugin.ts .cline/plugins/
|
||||
cline -i "do the thing my plugin enables"
|
||||
```
|
||||
|
||||
### 9.2 Explicit `extensions: [...]` in SDK config
|
||||
|
||||
When you build your own host with `ClineCore`, pass the plugin object directly:
|
||||
|
||||
```ts
|
||||
import plugin from "./my-plugin";
|
||||
import { ClineCore } from "@cline/core";
|
||||
|
||||
const host = await ClineCore.create({ backendMode: "local" });
|
||||
await host.start({
|
||||
config: {
|
||||
providerId: "anthropic",
|
||||
modelId: "claude-sonnet-4-6",
|
||||
apiKey: process.env.ANTHROPIC_API_KEY ?? "",
|
||||
cwd: process.cwd(),
|
||||
enableTools: true,
|
||||
systemPrompt: "You are a helpful assistant.",
|
||||
extensions: [plugin],
|
||||
// Required for ctx.workspaceInfo to be populated:
|
||||
extensionContext: {
|
||||
workspace: { rootPath: process.cwd(), cwd: process.cwd() },
|
||||
},
|
||||
},
|
||||
prompt: "...",
|
||||
interactive: false,
|
||||
});
|
||||
```
|
||||
|
||||
### 9.3 `pluginPaths: [...]` for directory-based plugins
|
||||
|
||||
When the plugin is a directory with `package.json`, point `pluginPaths` at the directory. The loader reads `package.json` and finds entry points from the `cline.plugins` field:
|
||||
|
||||
```ts
|
||||
config: {
|
||||
// ...
|
||||
pluginPaths: ["./path/to/my-plugin-package"],
|
||||
}
|
||||
```
|
||||
|
||||
Or install one with the CLI:
|
||||
|
||||
```bash
|
||||
cline plugin install ./path/to/my-plugin-package
|
||||
cline plugin install @scope/my-cline-plugin # from npm
|
||||
cline plugin install --git github.com/owner/repo # from git
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 10. Single-file plugin — full template
|
||||
|
||||
This is the full shape for a single-file plugin. Save as `my-plugin.ts`, drop in `.cline/plugins/`.
|
||||
|
||||
```ts
|
||||
/**
|
||||
* My Cline Plugin
|
||||
*
|
||||
* What it does: <one paragraph, written for users>.
|
||||
*
|
||||
* CLI usage:
|
||||
* mkdir -p .cline/plugins
|
||||
* cp my-plugin.ts .cline/plugins/
|
||||
* cline -i "trigger something the plugin enables"
|
||||
*
|
||||
* Direct demo:
|
||||
* ANTHROPIC_API_KEY=sk-... bun run my-plugin.ts
|
||||
*/
|
||||
|
||||
import { type AgentPlugin, ClineCore, createTool } from "@cline/core";
|
||||
|
||||
let sessionRoot: string | undefined;
|
||||
|
||||
const plugin: AgentPlugin = {
|
||||
name: "my-plugin",
|
||||
manifest: {
|
||||
capabilities: ["tools", "hooks"],
|
||||
},
|
||||
|
||||
setup(api, ctx) {
|
||||
sessionRoot = ctx.workspaceInfo?.rootPath;
|
||||
|
||||
api.registerTool(
|
||||
createTool({
|
||||
name: "do_thing",
|
||||
description: "Do the thing this plugin exists for.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: { target: { type: "string" } },
|
||||
required: ["target"],
|
||||
},
|
||||
async execute(input) {
|
||||
const { target } = input as { target: string };
|
||||
return { ok: true, target, root: sessionRoot };
|
||||
},
|
||||
}),
|
||||
);
|
||||
},
|
||||
|
||||
hooks: {
|
||||
beforeRun() {
|
||||
console.log("[my-plugin] run started");
|
||||
},
|
||||
afterRun({ result }) {
|
||||
if (result.status !== "completed") return;
|
||||
console.log(`[my-plugin] done in ${result.iterations} iteration(s)`);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// Optional: a runnable demo so users can `bun run` this file directly.
|
||||
async function runDemo(): Promise<void> {
|
||||
const host = await ClineCore.create({ backendMode: "local" });
|
||||
try {
|
||||
const result = await host.start({
|
||||
config: {
|
||||
providerId: "anthropic",
|
||||
modelId: "claude-sonnet-4-6",
|
||||
apiKey: process.env.ANTHROPIC_API_KEY ?? "",
|
||||
cwd: process.cwd(),
|
||||
enableTools: true,
|
||||
systemPrompt: "You are a helpful assistant. Use tools when needed.",
|
||||
extensions: [plugin],
|
||||
extensionContext: {
|
||||
workspace: { rootPath: process.cwd(), cwd: process.cwd() },
|
||||
},
|
||||
},
|
||||
prompt: "Use do_thing on the target 'world'.",
|
||||
interactive: false,
|
||||
});
|
||||
console.log(result.result?.text ?? "");
|
||||
} finally {
|
||||
await host.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
if (import.meta.main) {
|
||||
await runDemo();
|
||||
}
|
||||
|
||||
export { plugin, runDemo };
|
||||
export default plugin;
|
||||
```
|
||||
|
||||
That's the entire shape. Copy it, rename the tool, swap in your logic.
|
||||
|
||||
---
|
||||
|
||||
## 11. Plugin package — full walkthrough
|
||||
|
||||
A **plugin package** is a directory with a `package.json`. Use it when you need any of:
|
||||
|
||||
- npm dependencies (`zod`, `yaml`, `typescript`, etc.)
|
||||
- multiple plugin entry points from one package
|
||||
- bundled assets (markdown templates, agent definitions, schemas, fixtures)
|
||||
- a way to ship and version the plugin via npm or git
|
||||
|
||||
The package is still just a normal npm package — what makes it a plugin is the `cline.plugins` field in `package.json`.
|
||||
|
||||
### 11.1 Layout
|
||||
|
||||
A typical package looks like:
|
||||
|
||||
```
|
||||
my-cline-plugin/
|
||||
├── package.json
|
||||
├── tsconfig.json (optional — for local typechecking)
|
||||
├── index.ts (the plugin entry point)
|
||||
├── README.md (user-facing docs)
|
||||
└── assets/ (optional — bundled content)
|
||||
├── templates/
|
||||
│ └── greeting.md
|
||||
└── schemas/
|
||||
└── input.json
|
||||
```
|
||||
|
||||
For larger plugins, you can also organize by feature:
|
||||
|
||||
```
|
||||
my-cline-plugin/
|
||||
├── package.json
|
||||
├── index.ts
|
||||
├── tools/
|
||||
│ ├── do-thing.ts
|
||||
│ └── read-thing.ts
|
||||
├── hooks/
|
||||
│ └── audit.ts
|
||||
├── lib/
|
||||
│ └── helpers.ts
|
||||
└── assets/
|
||||
└── ...
|
||||
```
|
||||
|
||||
### 11.2 `package.json` — the discovery contract
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "my-cline-plugin",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "What this plugin does, in one sentence.",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"typecheck": "tsc --noEmit",
|
||||
"clean": "rm -rf node_modules dist"
|
||||
},
|
||||
"exports": {
|
||||
".": "./index.ts"
|
||||
},
|
||||
"cline": {
|
||||
"plugins": [
|
||||
{
|
||||
"paths": ["./index.ts"],
|
||||
"capabilities": ["tools", "hooks"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@cline/core": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@cline/core": { "optional": true }
|
||||
},
|
||||
"dependencies": {
|
||||
"zod": "^4.1.5"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Field-by-field:
|
||||
|
||||
- **`type: "module"`** — required. Cline plugins are ES modules.
|
||||
- **`exports`** — points npm consumers at the entry. For TypeScript-source plugins loaded by Cline at runtime, you can export `./index.ts` directly; the loader handles TS.
|
||||
- **`cline.plugins`** — the discovery contract. An array of entries, each with:
|
||||
- `paths` — entry files relative to the package root. For multiple plugin objects from one package, list all entries.
|
||||
- `capabilities` — pre-declared capabilities, validated by the loader before importing the entry.
|
||||
- **`peerDependencies` for `@cline/core`** — the host already provides `@cline/core`. Marking it a peer dep avoids version drift; marking it optional lets users typecheck the plugin in isolation without forcing a `@cline/core` install.
|
||||
- **`dependencies`** — your own deps (parsers, schema libraries, SDKs you wrap).
|
||||
|
||||
### 11.3 `tsconfig.json` (optional)
|
||||
|
||||
For local typechecking only:
|
||||
|
||||
```json
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"include": ["index.ts"]
|
||||
}
|
||||
```
|
||||
|
||||
If your plugin lives outside a monorepo, a minimal standalone `tsconfig.json` works too:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["index.ts"]
|
||||
}
|
||||
```
|
||||
|
||||
### 11.4 `index.ts` — package entry
|
||||
|
||||
The same plugin shape as the single-file version, just inside a package:
|
||||
|
||||
```ts
|
||||
import { type AgentPlugin, createTool } from "@cline/core";
|
||||
import { z } from "zod";
|
||||
|
||||
const InputSchema = z.object({
|
||||
target: z.string().min(1),
|
||||
});
|
||||
|
||||
const plugin: AgentPlugin = {
|
||||
name: "my-cline-plugin",
|
||||
manifest: {
|
||||
capabilities: ["tools"],
|
||||
},
|
||||
setup(api, ctx) {
|
||||
api.registerTool(
|
||||
createTool({
|
||||
name: "do_thing",
|
||||
description: "Do the thing.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: { target: { type: "string" } },
|
||||
required: ["target"],
|
||||
},
|
||||
async execute(input) {
|
||||
const { target } = InputSchema.parse(input);
|
||||
return { ok: true, target };
|
||||
},
|
||||
}),
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default plugin;
|
||||
```
|
||||
|
||||
### 11.5 Bundling assets
|
||||
|
||||
Anything next to `index.ts` ships with the package. Resolve asset paths with `import.meta.url`, **not** `process.cwd()`:
|
||||
|
||||
```ts
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { readFileSync, existsSync, readdirSync } from "node:fs";
|
||||
|
||||
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
||||
const TEMPLATES_DIR = join(MODULE_DIR, "assets", "templates");
|
||||
|
||||
function loadTemplate(name: string): string | undefined {
|
||||
const path = join(TEMPLATES_DIR, `${name}.md`);
|
||||
return existsSync(path) ? readFileSync(path, "utf8") : undefined;
|
||||
}
|
||||
```
|
||||
|
||||
This is the only place `import.meta.url` is appropriate in a plugin — locating files **inside the plugin package**. For workspace paths, always use `ctx.workspaceInfo?.rootPath`.
|
||||
|
||||
### 11.6 The override pattern (bundled / global / project)
|
||||
|
||||
A package can ship default assets and let users override them with their own. The convention used across Cline plugins is a three-tier lookup, last write wins by `name`:
|
||||
|
||||
1. **bundled** — files inside the plugin package (defaults shipped with the plugin).
|
||||
2. **global** — files under `~/.cline/data/settings/<kind>/` (user overrides).
|
||||
3. **project** — files under `<workspace>/.cline/<kind>/` (project overrides).
|
||||
|
||||
Example: a plugin that supports user-defined "presets" via markdown files with YAML frontmatter:
|
||||
|
||||
```ts
|
||||
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import YAML from "yaml";
|
||||
|
||||
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
||||
const BUNDLED_DIR = join(MODULE_DIR, "presets");
|
||||
|
||||
function resolveDataDir(): string {
|
||||
return process.env.CLINE_DATA_DIR ??
|
||||
join(process.env.HOME ?? "~", ".cline", "data");
|
||||
}
|
||||
|
||||
function readPresets(workspaceRoot: string) {
|
||||
const sources = [
|
||||
{ dir: BUNDLED_DIR, source: "bundled" as const },
|
||||
{ dir: join(resolveDataDir(), "settings", "presets"), source: "global" as const },
|
||||
{ dir: join(workspaceRoot, ".cline", "presets"), source: "project" as const },
|
||||
];
|
||||
const presets = new Map<string, { name: string; body: string; source: string }>();
|
||||
for (const { dir, source } of sources) {
|
||||
if (!existsSync(dir)) continue;
|
||||
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
||||
if (!entry.isFile() || !entry.name.endsWith(".md")) continue;
|
||||
const raw = readFileSync(join(dir, entry.name), "utf8");
|
||||
const match = raw.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);
|
||||
const data = match ? YAML.parse(match[1] ?? "") ?? {} : {};
|
||||
const body = (match ? match[2] : raw).trim();
|
||||
const name = data?.name ?? entry.name.replace(/\.md$/, "");
|
||||
// Project overrides global overrides bundled — last write wins.
|
||||
presets.set(name, { name, body, source });
|
||||
}
|
||||
}
|
||||
return [...presets.values()];
|
||||
}
|
||||
```
|
||||
|
||||
This pattern lets users:
|
||||
|
||||
- Use the plugin out of the box (bundled defaults).
|
||||
- Customize globally for all projects (drop a file in `~/.cline/data/settings/<kind>/`).
|
||||
- Override per-project (drop a file in `<workspace>/.cline/<kind>/`).
|
||||
|
||||
### 11.7 Multiple plugin entries in one package
|
||||
|
||||
If your package exposes more than one plugin, list each in `cline.plugins`:
|
||||
|
||||
```json
|
||||
"cline": {
|
||||
"plugins": [
|
||||
{ "paths": ["./tools-plugin.ts"], "capabilities": ["tools"] },
|
||||
{ "paths": ["./hooks-plugin.ts"], "capabilities": ["hooks"] }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Each entry file should `export default` its own plugin object.
|
||||
|
||||
### 11.8 Installing the package
|
||||
|
||||
Once the package is on disk, on npm, or in a git repo, users install it with:
|
||||
|
||||
```bash
|
||||
cline plugin install ./my-cline-plugin # local path
|
||||
cline plugin install @scope/my-cline-plugin # npm
|
||||
cline plugin install --git github.com/owner/repo # git
|
||||
```
|
||||
|
||||
The CLI installs into `<workspace>/.cline/plugins/.installs/` (or `~/.cline/plugins/.installs/`) and auto-discovers it on the next session.
|
||||
|
||||
For SDK consumers, point `pluginPaths` at the package directory directly (see §9.3).
|
||||
|
||||
---
|
||||
|
||||
## 12. Testing your plugin
|
||||
|
||||
### 12.1 Unit tests
|
||||
|
||||
The plugin object is plain data. You can drive `setup()` against a minimal context and exercise tools directly:
|
||||
|
||||
```ts
|
||||
import plugin from "../my-plugin";
|
||||
|
||||
const tools: unknown[] = [];
|
||||
const api = {
|
||||
registerTool: (t: unknown) => tools.push(t),
|
||||
registerCommand: () => {},
|
||||
registerRule: () => {},
|
||||
registerMessageBuilder: () => {},
|
||||
registerProvider: () => {},
|
||||
registerAutomationEventType: () => {},
|
||||
};
|
||||
await plugin.setup?.(api as never, {
|
||||
workspaceInfo: { rootPath: "/tmp/fake-workspace" },
|
||||
});
|
||||
|
||||
// Now `tools` contains the registered tools — call tool.execute(input, ctx).
|
||||
```
|
||||
|
||||
For higher fidelity, build a real registry (`new ContributionRegistry({ extensions: [plugin] })`) and call `initialize()` — that exercises validation too.
|
||||
|
||||
### 12.2 End-to-end with a `runDemo()`
|
||||
|
||||
Add a `runDemo()` in your plugin file (see §10) that boots a real `ClineCore` session against `ANTHROPIC_API_KEY`:
|
||||
|
||||
```bash
|
||||
ANTHROPIC_API_KEY=sk-... bun run my-plugin.ts
|
||||
```
|
||||
|
||||
This is the fastest way to verify the plugin works end-to-end.
|
||||
|
||||
### 12.3 CLI smoke test
|
||||
|
||||
```bash
|
||||
mkdir -p .cline/plugins
|
||||
cp my-plugin.ts .cline/plugins/
|
||||
cline -i "trigger something that exercises the plugin"
|
||||
```
|
||||
|
||||
For packages:
|
||||
|
||||
```bash
|
||||
cline plugin install ./my-cline-plugin
|
||||
cline -i "..."
|
||||
```
|
||||
|
||||
If the plugin fails validation or setup, the CLI prints a clear error and continues without it.
|
||||
|
||||
---
|
||||
|
||||
## 13. Common gotchas
|
||||
|
||||
- **"capabilities must be a non-empty array"** — you forgot `manifest.capabilities`, or it's `[]`.
|
||||
- **"registerRule requires the 'rules' capability"** — capability/handler drift. Add `"rules"` to capabilities, or stop calling `registerRule`.
|
||||
- **Tool not visible to the model** — check `enableTools: true` on the session config, and that you're declaring `"tools"` in capabilities.
|
||||
- **`ctx.workspaceInfo` is undefined in SDK tests** — the host didn't pass `extensionContext.workspace`. In SDK code, set it explicitly (see §9.2).
|
||||
- **State leaking across sessions** — module-level variables are shared across sessions in the same process. Key by `ctx.session?.sessionId` if your host runs multiple sessions concurrently.
|
||||
- **`afterRun` firing on aborts** — guard with `if (result.status !== "completed") return;`.
|
||||
- **Heavy work in `setup()`** — `setup()` blocks session start. Defer expensive work into the first tool call or `beforeRun`.
|
||||
- **Importing host internals** — only import from `@cline/core`. Reaching into host-specific packages (e.g. CLI internals) will break in non-CLI hosts.
|
||||
- **Sandboxed plugins and `telemetry`** — telemetry is process-local. Feature-detect `ctx.telemetry` and expect it to be undefined in sandboxed plugin processes.
|
||||
- **Resolving bundled assets** — use `import.meta.url` + `fileURLToPath` to find files inside your package; never `process.cwd()`. For workspace paths, do the opposite: use `ctx.workspaceInfo?.rootPath`, never `import.meta.url`.
|
||||
- **Plugin name collisions** — `name` must be unique within a session. If two plugins share a name, validation fails. Namespace by package (`my-org-redactor`, not `redactor`).
|
||||
|
||||
---
|
||||
|
||||
## 14. Decision guide — which extension point?
|
||||
|
||||
| You want to… | Use |
|
||||
| ----------------------------------------------------------- | ------------------------------------------------ |
|
||||
| Give the model a new capability | `registerTool` |
|
||||
| Add a slash command in chat surfaces | `registerCommand` |
|
||||
| Inject text into the system prompt | `registerRule` |
|
||||
| Rewrite messages before they hit the provider | `registerMessageBuilder` |
|
||||
| Add a custom model provider | `registerProvider` |
|
||||
| Emit normalized cron/webhook events | `registerAutomationEventType` + `ctx.automation` |
|
||||
| Observe or steer the agent loop | `hooks.*` |
|
||||
| Block a dangerous tool call | `hooks.beforeTool` returning `{ stop: true }` |
|
||||
| Notify on completion | `hooks.afterRun` (gate on `status === "completed"`) |
|
||||
| Tweak each model request | `hooks.beforeModel` |
|
||||
| Stream events to a UI | `hooks.onEvent` |
|
||||
| Ship reusable templates with the plugin | Bundle assets next to `index.ts`, resolve via `import.meta.url` |
|
||||
| Let users override defaults globally or per-project | Three-tier lookup: bundled / global / project |
|
||||
|
||||
---
|
||||
|
||||
## 15. Quick checklist before you ship
|
||||
|
||||
- [ ] `manifest.capabilities` is a non-empty array.
|
||||
- [ ] Every `api.register*` call has a matching capability declared.
|
||||
- [ ] If `hooks` is present, `"hooks"` is in `capabilities`.
|
||||
- [ ] `ctx.workspaceInfo?.rootPath` is used for workspace paths (not `process.cwd()`).
|
||||
- [ ] Optional `ctx` fields are feature-detected.
|
||||
- [ ] Tool names are snake_case verbs; descriptions are written for the model.
|
||||
- [ ] Tool inputs have JSON Schema with `required` set.
|
||||
- [ ] `afterRun` handlers gate on `result.status === "completed"` if they only want successes.
|
||||
- [ ] State that must not leak between concurrent sessions is keyed by `ctx.session?.sessionId`.
|
||||
- [ ] (Package) `package.json` has `type: "module"`, `cline.plugins`, and `@cline/core` as an optional peer dep.
|
||||
- [ ] (Package) Bundled assets resolved via `import.meta.url`, not `process.cwd()`.
|
||||
- [ ] Smoke test: drop the plugin into `.cline/plugins/` (or `cline plugin install`), run `cline -i "..."`, watch it work.
|
||||
|
||||
When in doubt, write a tiny tool, get it to fire end-to-end, then grow it.
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
/.github/ @saoudrizwan @abeatrix @BarreiroT
|
||||
@@ -1,61 +0,0 @@
|
||||
# dependencies (bun install)
|
||||
node_modules
|
||||
|
||||
# output
|
||||
out
|
||||
dist
|
||||
*.tgz
|
||||
target
|
||||
.next
|
||||
.map
|
||||
|
||||
# code coverage
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# logs
|
||||
logs
|
||||
_.log
|
||||
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
||||
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
.env*.local
|
||||
|
||||
# caches
|
||||
.eslintcache
|
||||
.cache
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
|
||||
# IntelliJ based IDEs
|
||||
.idea
|
||||
|
||||
# Finder (MacOS) folder config
|
||||
.DS_Store
|
||||
|
||||
# Package lock files created by other package managers
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
pnpm-lock.yaml
|
||||
|
||||
# Session files / User data
|
||||
.cline/data
|
||||
.cline/tmp
|
||||
*.db
|
||||
*.db-shm
|
||||
*.db-wal
|
||||
|
||||
# Protobuf generated code
|
||||
packages/rpc/src/proto/generated
|
||||
|
||||
# Tauri generated code
|
||||
apps/*/src-tauri/gen
|
||||
apps/*/src-tauri/bin
|
||||
apps/examples/*/src-tauri/gen
|
||||
apps/examples/*/src-tauri/bin
|
||||
# Tauri UI test snapshots
|
||||
apps/*/src/tests/.tui-test
|
||||
apps/*/src/tests/tui-traces
|
||||
|
||||
.cli-release-staging
|
||||
@@ -1,4 +0,0 @@
|
||||
title = "Cline SDK secret scanning"
|
||||
|
||||
[extend]
|
||||
useDefault = true
|
||||
@@ -1,45 +0,0 @@
|
||||
{
|
||||
"strictness": 2,
|
||||
"triggerOnUpdates": true,
|
||||
"statusCheck": true,
|
||||
"rules": [
|
||||
{
|
||||
"id": "sdk-tool-handler-telemetry",
|
||||
"rule": "Any new tool handler added to packages/agents/src or packages/core/src that performs a user-visible action (writes files, executes commands, modifies state, calls external APIs) must include a call to captureToolUsage() from packages/core/src/services/telemetry/core-events.ts, or emit a task.tool_used event via telemetry.capture(). Pure read-only helpers and getters are exempt. When in doubt, prefer instrumentation.",
|
||||
"scope": ["packages/agents/src/**", "packages/core/src/**"],
|
||||
"severity": "high"
|
||||
},
|
||||
{
|
||||
"id": "sdk-session-lifecycle-telemetry",
|
||||
"rule": "New session start, end, or state-transition code paths in packages/core/src must call the appropriate typed helper from packages/core/src/services/telemetry/core-events.ts (captureTaskCreated, captureTaskCompleted, captureConversationTurnEvent, captureTokenUsage, etc.). Do not inline raw telemetry.capture() calls for session lifecycle events — always use the typed helper, which guarantees a consistent payload shape.",
|
||||
"scope": [
|
||||
"packages/core/src/cline-core/**",
|
||||
"packages/core/src/runtime/**"
|
||||
],
|
||||
"severity": "high"
|
||||
},
|
||||
{
|
||||
"id": "sdk-no-raw-event-strings",
|
||||
"rule": "All telemetry event name strings must be sourced from CORE_TELEMETRY_EVENTS in packages/core/src/services/telemetry/core-events.ts. If a PR introduces a string literal in a telemetry.capture(), telemetry.captureRequired(), or recordCounter()/recordHistogram()/recordGauge() call that does not reference CORE_TELEMETRY_EVENTS, flag it. New events must be added to CORE_TELEMETRY_EVENTS first, with a typed capture helper created alongside them.",
|
||||
"scope": [
|
||||
"packages/core/src/**",
|
||||
"packages/agents/src/**",
|
||||
"apps/cli/src/**",
|
||||
"apps/vscode/src/**"
|
||||
],
|
||||
"severity": "medium"
|
||||
},
|
||||
{
|
||||
"id": "sdk-auth-telemetry-completeness",
|
||||
"rule": "Any new OAuth or authentication provider added under packages/core/src/auth must emit all four lifecycle events using the typed helpers from core-events.ts: captureAuthStarted (at flow entry), captureAuthSucceeded + identifyAccount (on token success), captureAuthFailed (on error), and captureAuthLoggedOut (on token invalidation or explicit logout). Flag PRs that introduce a new auth flow file without all four. Cross-reference packages/core/src/auth/cline.ts and packages/core/src/auth/codex.ts as canonical examples.",
|
||||
"scope": ["packages/core/src/auth/**"],
|
||||
"severity": "high"
|
||||
},
|
||||
{
|
||||
"id": "sdk-telemetry-doc-update",
|
||||
"rule": "Any PR that adds new event constants to CORE_TELEMETRY_EVENTS in packages/core/src/services/telemetry/core-events.ts, adds new capture* helper functions, or changes the payload shape of an existing event must update the Event Catalog section in DOC.md. Flag PRs that modify core-events.ts without a corresponding change to DOC.md.",
|
||||
"scope": ["packages/core/src/services/telemetry/core-events.ts"],
|
||||
"severity": "medium"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"files": [
|
||||
{
|
||||
"path": "packages/core/src/services/telemetry/core-events.ts",
|
||||
"description": "Single source of truth for all telemetry event names (CORE_TELEMETRY_EVENTS) and their typed capture helper functions. Every PR touching telemetry must be evaluated against this catalog. New events must be defined here first."
|
||||
},
|
||||
{
|
||||
"path": "packages/shared/src/services/telemetry.ts",
|
||||
"description": "ITelemetryService interface definition. Defines the contract all telemetry implementations must satisfy (capture, captureRequired, recordCounter, recordHistogram, recordGauge, flush, dispose)."
|
||||
},
|
||||
{
|
||||
"path": "packages/core/src/services/telemetry/TelemetryService.ts",
|
||||
"description": "Reference implementation of ITelemetryService used by all hosts. Multi-adapter fan-out service that forwards events to OpenTelemetry."
|
||||
},
|
||||
{
|
||||
"path": "packages/core/src/services/telemetry/OpenTelemetryProvider.ts",
|
||||
"description": "OpenTelemetry-backed provider that wires logs/metrics/traces exporters. Contains createConfiguredTelemetryService and createConfiguredTelemetryHandle, the canonical factories every host should use."
|
||||
},
|
||||
{
|
||||
"path": "DOC.md",
|
||||
"description": "Public API and event documentation. The Event Catalog and 'Activation funnel' sections must be kept in sync with core-events.ts. Host integration rules (CLI dir ordering, hub daemon metadata forwarding) are documented here."
|
||||
},
|
||||
{
|
||||
"path": "ARCHITECTURE.md",
|
||||
"description": "Architecture reference. Telemetry design decisions, completion semantics (submit_and_exit anchoring), and hub-daemon telemetry forwarding are documented here. Use as ground truth for design intent."
|
||||
},
|
||||
{
|
||||
"path": "AGENTS.md",
|
||||
"description": "Package boundary rules. Telemetry runtime services live in @cline/core; @cline/agents must not own stateful telemetry. Use to evaluate whether a telemetry change is being made in the correct package."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
# SDK Telemetry Standards
|
||||
|
||||
These rules supplement `config.json`. The structured rules describe **what** to enforce; this
|
||||
document explains **why**, so Greptile has the context to avoid false positives.
|
||||
|
||||
## Telemetry Stack
|
||||
|
||||
The SDK uses OpenTelemetry (OTEL) as its sole telemetry transport. Events flow through:
|
||||
|
||||
```
|
||||
core-events.ts (event catalog + typed helpers)
|
||||
↓
|
||||
ITelemetryService (packages/shared) ← interface contract
|
||||
↓
|
||||
TelemetryService (packages/core) ← multi-adapter fan-out
|
||||
↓
|
||||
OpenTelemetryAdapter → OpenTelemetryProvider ← OTLP transport
|
||||
↓
|
||||
OTLP endpoint (collector or vendor)
|
||||
```
|
||||
|
||||
The SDK does **not** depend on the original `cline/cline` repo for telemetry. The two have
|
||||
parallel-but-independent stacks; this `.greptile/` config covers only the SDK.
|
||||
|
||||
## The Single Source of Truth
|
||||
|
||||
`packages/core/src/services/telemetry/core-events.ts` is the single source of truth for all
|
||||
event names. It exports:
|
||||
|
||||
- `CORE_TELEMETRY_EVENTS` — a frozen const object grouped by family
|
||||
(`CLIENT`, `SESSION`, `USER`, `TASK`, `HOOKS`, `WORKSPACE`)
|
||||
- A typed `capture*()` helper for every event family
|
||||
(`captureExtensionActivated`, `captureTaskCreated`, `captureToolUsage`, etc.)
|
||||
|
||||
**Never use raw string literals for event names at call sites.** A new event always means:
|
||||
|
||||
1. Add the constant to `CORE_TELEMETRY_EVENTS`
|
||||
2. Add a typed `capture*()` helper alongside it (with a typed `properties` parameter)
|
||||
3. Update the Event Catalog section in `DOC.md`
|
||||
4. Add a unit test in `core-events.test.ts` asserting the event is dropped when telemetry is opted out
|
||||
|
||||
## The Activation Funnel
|
||||
|
||||
The canonical funnel that downstream analytics depends on:
|
||||
|
||||
```
|
||||
user.extension_activated
|
||||
→ workspace.initialized
|
||||
→ workspace.path_resolved (gated on multi-root)
|
||||
→ task.created
|
||||
→ task.conversation_turn (one per turn, source: "user" | "assistant")
|
||||
→ task.completed (source: "submit_and_exit" | "shutdown")
|
||||
```
|
||||
|
||||
Emission ownership:
|
||||
|
||||
- `user.extension_activated`: emitted **once per host process** by host-specific helpers
|
||||
(`captureCliExtensionActivated` for the CLI, `captureExtensionActivated` for VS Code).
|
||||
- `workspace.initialized` / `workspace.init_error`: emitted by a per-process de-duplicated
|
||||
emitter in `prepareLocalRuntimeBootstrap`. Hosts must NOT re-emit these.
|
||||
- `workspace.path_resolved`: emitted from default tool executors **only when**
|
||||
`WorkspaceManager` exposes more than one root.
|
||||
- `task.*`: emitted by core session lifecycle code in `packages/core/src/cline-core/` and
|
||||
`packages/core/src/runtime/`. Hosts must not duplicate this emission.
|
||||
|
||||
## `task.completed` Semantics
|
||||
|
||||
`task.completed` marks the moment the **assistant declared the task done**, not the moment
|
||||
the SDK session record was finalized. The local runtime emits it when it observes a successful
|
||||
`submit_and_exit` tool call (the SDK analog of original Cline's `attempt_completion`). For
|
||||
non-interactive runs that finish without invoking the explicit completion tool,
|
||||
`shutdownSession` emits it as a fallback with `source: "shutdown"`.
|
||||
|
||||
Each session is guaranteed at most one `task.completed` emission. The `source` field
|
||||
(`"submit_and_exit" | "shutdown"`) is required for analytics attribution.
|
||||
|
||||
## CLI Directory-Ordering Rule
|
||||
|
||||
The CLI accepts `--config <dir>`. The CLI **must** apply `setClineDir(...)` and
|
||||
`setHomeDir(...)` from `@cline/shared/storage` **before** calling
|
||||
`captureCliExtensionActivated()`. Otherwise the telemetry singleton's persisted distinct-id
|
||||
and any other on-disk telemetry state lands under `~/.cline` instead of the user's chosen
|
||||
config dir.
|
||||
|
||||
The canonical pattern is in `apps/cli/src/main.ts` (PR #357):
|
||||
|
||||
```ts
|
||||
if (configDir) setClineDir(configDir);
|
||||
setHomeDir(homedir());
|
||||
captureCliExtensionActivated(); // <-- after dir overrides
|
||||
```
|
||||
|
||||
## Hub Daemon Metadata Forwarding
|
||||
|
||||
Hosts that spawn a detached `@cline/core/hub/daemon-entry` process must forward telemetry
|
||||
metadata into the daemon argv so the daemon can reconstruct an equivalent
|
||||
`ITelemetryService`. The expected payload is base64-encoded JSON with snake_case keys:
|
||||
|
||||
```
|
||||
{ extension_version, cline_type, platform, platform_version, os_type, os_version, is_remote_workspace }
|
||||
```
|
||||
|
||||
The reference implementation is `apps/vscode/src/hub-daemon.ts` (PR #357). Without this
|
||||
forwarding, hub-backed sessions silently drop their lifecycle telemetry.
|
||||
|
||||
## Auth Lifecycle Completeness
|
||||
|
||||
Every authentication provider in `packages/core/src/auth/` must emit all four auth lifecycle
|
||||
events using the typed helpers:
|
||||
|
||||
| Phase | Helper | Where it fires |
|
||||
|---|---|---|
|
||||
| Flow entry | `captureAuthStarted(provider)` | Top of the OAuth flow function |
|
||||
| Token success | `captureAuthSucceeded(provider)` + `identifyAccount(...)` | After successful token exchange |
|
||||
| Token error | `captureAuthFailed(provider, errorMessage)` | In the catch block |
|
||||
| Token invalidation | `captureAuthLoggedOut(provider, reason)` | On invalid_grant or explicit logout |
|
||||
|
||||
Cross-reference `packages/core/src/auth/cline.ts` and `packages/core/src/auth/codex.ts` as
|
||||
canonical examples of all four phases.
|
||||
|
||||
## Single Telemetry Service Per Host
|
||||
|
||||
On VS Code, the telemetry handle is built **once** in `activate()`
|
||||
(`apps/vscode/src/telemetry.ts`) and the same instance is passed into the sidebar, panel
|
||||
command, and daemon spawn payload. Do not let individual controllers construct their own
|
||||
`ITelemetryService` — that fragments distinct-id state, opt-out tracking, and flush ownership.
|
||||
|
||||
The CLI follows the same pattern via the `getCliTelemetryService()` singleton in
|
||||
`apps/cli/src/utils/telemetry.ts`, which is memoized by the activation gate in
|
||||
`telemetry.activation-gate.ts`.
|
||||
|
||||
## Common False-Positive Adjustments
|
||||
|
||||
If Greptile flags one of the following, the rule is **not** violated:
|
||||
|
||||
- A telemetry call that is wrapped in a host-specific helper (e.g.
|
||||
`captureCliExtensionActivated` wrapping `captureExtensionActivated`) — the inner helper
|
||||
is the typed call.
|
||||
- `enterprise.*` events emitted from `apps/cli/src/utils/enterprise.ts` — these are
|
||||
enterprise-side events not yet in `CORE_TELEMETRY_EVENTS`; they are tracked separately.
|
||||
- A new test file that uses raw event name strings inside `expect(...)` assertions — tests
|
||||
may reference event names as strings to assert what was emitted.
|
||||
@@ -1,9 +0,0 @@
|
||||
if ! command -v gitleaks >/dev/null 2>&1; then
|
||||
echo "gitleaks is required for the pre-commit secret scan."
|
||||
echo "Install it with: brew install gitleaks"
|
||||
echo "Other install options: https://github.com/gitleaks/gitleaks#installing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gitleaks git --pre-commit --redact --staged --verbose || exit 1
|
||||
lint-staged
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"shortcuts": [
|
||||
{
|
||||
"label": "Build & Link CLI",
|
||||
"command": "bun -F @cline/cli build && bun -F @cline/cli link",
|
||||
"icon": "play"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
22
|
||||
@@ -1,2 +0,0 @@
|
||||
node 22
|
||||
bun 1.3.13
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"biomejs.biome",
|
||||
"oven.bun-vscode"
|
||||
]
|
||||
}
|
||||
Vendored
-132
@@ -1,132 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Run VS Code Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}/apps/examples/vscode",
|
||||
"--disable-extensions"
|
||||
],
|
||||
"outFiles": ["${workspaceFolder}/apps/examples/vscode/dist/**/*.js"],
|
||||
"preLaunchTask": "build-vscode-extension"
|
||||
},
|
||||
{
|
||||
"name": "Run VS Code Extension (Dev Webview)",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}/apps/examples/vscode",
|
||||
"--disable-extensions"
|
||||
],
|
||||
"outFiles": ["${workspaceFolder}/apps/examples/vscode/dist/**/*.js"],
|
||||
"env": {
|
||||
"VITE_DEV_SERVER_URL": "http://localhost:5173"
|
||||
},
|
||||
"preLaunchTask": "dev-all-vscode",
|
||||
"postDebugTask": "kill-vscode-dev"
|
||||
},
|
||||
{
|
||||
"name": "Launch Bun CLI (Prompt)",
|
||||
"type": "bun",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceFolder}/apps/cli",
|
||||
"runtime": "bun",
|
||||
"runtimeArgs": ["--conditions=development"],
|
||||
"program": "${workspaceFolder}/apps/cli/src/index.ts",
|
||||
"args": ["${input:cliPrompt}"],
|
||||
"env": {
|
||||
"CLINE_BUILD_ENV": "development"
|
||||
},
|
||||
"presentation": {
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Launch RPC Server",
|
||||
"type": "bun",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceFolder}/apps/cli",
|
||||
"runtime": "bun",
|
||||
"runtimeArgs": ["--conditions=development"],
|
||||
"program": "${workspaceFolder}/apps/cli/src/index.ts",
|
||||
"args": ["rpc", "start"],
|
||||
"env": {
|
||||
"CLINE_BUILD_ENV": "development",
|
||||
"CLINE_DEBUG_PORT_BASE": "9230"
|
||||
},
|
||||
"presentation": {
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Attach RPC Runtime (9230)",
|
||||
"type": "bun",
|
||||
"request": "attach",
|
||||
"url": "ws://127.0.0.1:9230",
|
||||
"localRoot": "${workspaceFolder}",
|
||||
"remoteRoot": "${workspaceFolder}",
|
||||
"presentation": {
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Attach Hook Worker (9231)",
|
||||
"type": "bun",
|
||||
"request": "attach",
|
||||
"url": "ws://127.0.0.1:9231",
|
||||
"localRoot": "${workspaceFolder}",
|
||||
"remoteRoot": "${workspaceFolder}",
|
||||
"presentation": {
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Attach Plugin Sandbox (9232)",
|
||||
"type": "bun",
|
||||
"request": "attach",
|
||||
"url": "ws://127.0.0.1:9232",
|
||||
"localRoot": "${workspaceFolder}",
|
||||
"remoteRoot": "${workspaceFolder}",
|
||||
"presentation": {
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Attach Connector Child (9233)",
|
||||
"type": "bun",
|
||||
"request": "attach",
|
||||
"url": "ws://127.0.0.1:9233",
|
||||
"localRoot": "${workspaceFolder}",
|
||||
"remoteRoot": "${workspaceFolder}",
|
||||
"presentation": {
|
||||
"hidden": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "Launch RPC Server Debugger",
|
||||
"configurations": ["Launch RPC Server", "Attach RPC Runtime (9230)"]
|
||||
},
|
||||
{
|
||||
"name": "Launch CLI Debugger",
|
||||
"configurations": [
|
||||
"Launch Bun CLI (Prompt)",
|
||||
"Attach RPC Runtime (9230)",
|
||||
"Attach Hook Worker (9231)",
|
||||
"Attach Plugin Sandbox (9232)",
|
||||
"Attach Connector Child (9233)"
|
||||
]
|
||||
}
|
||||
],
|
||||
"inputs": [
|
||||
{
|
||||
"id": "cliPrompt",
|
||||
"type": "promptString",
|
||||
"description": "Prompt to send to the CLI",
|
||||
"default": "hey"
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"files.insertFinalNewline": true,
|
||||
"biome.enabled": true,
|
||||
"editor.defaultFormatter": "biomejs.biome",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.biome": "explicit",
|
||||
"source.removeUnused.biome": "always",
|
||||
"source.removeUnusedImports": "always",
|
||||
"source.organizeImports.biome": "always"
|
||||
}
|
||||
}
|
||||
Vendored
-88
@@ -1,88 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build-sdk",
|
||||
"type": "shell",
|
||||
"command": "bun run build:sdk",
|
||||
"problemMatcher": ["$tsc"],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "build-vscode-extension",
|
||||
"type": "shell",
|
||||
"command": "bun run build",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": false
|
||||
},
|
||||
"dependsOn": ["build-sdk"],
|
||||
"problemMatcher": ["$tsc"],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/apps/examples/vscode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "watch-vscode-extension",
|
||||
"type": "shell",
|
||||
"command": "bun run watch",
|
||||
"isBackground": true,
|
||||
"dependsOn": ["build-sdk"],
|
||||
"problemMatcher": {
|
||||
"pattern": {
|
||||
"regexp": "^.*$",
|
||||
"file": 0,
|
||||
"location": 0,
|
||||
"message": 0
|
||||
},
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": "^Bundled",
|
||||
"endsPattern": "^\\s*extension\\.js"
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/apps/examples/vscode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "dev-vscode-webview",
|
||||
"type": "shell",
|
||||
"command": "cd src/webview && bun run dev",
|
||||
"isBackground": true,
|
||||
"problemMatcher": {
|
||||
"pattern": {
|
||||
"regexp": "^.*$",
|
||||
"file": 0,
|
||||
"location": 0,
|
||||
"message": 0
|
||||
},
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": "VITE",
|
||||
"endsPattern": "Local:"
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/apps/examples/vscode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "dev-all-vscode",
|
||||
"dependsOn": ["watch-vscode-extension", "dev-vscode-webview"],
|
||||
"dependsOrder": "parallel",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "kill-vscode-dev",
|
||||
"type": "shell",
|
||||
"command": "kill $(lsof -ti:5173) 2>/dev/null; exit 0",
|
||||
"problemMatcher": [],
|
||||
"presentation": {
|
||||
"reveal": "silent"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
---
|
||||
description: Development reference for the Cline SDK workspace.
|
||||
globs: "*.ts,*.tsx,*.js,*.jsx,*.json,*.md"
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Cline SDK — Development Reference
|
||||
|
||||
Quick-reference for active development. For onboarding, workspace setup, publishing, and detailed workflow see [CONTRIBUTING.md](./CONTRIBUTING.md). For architecture and runtime flows see [ARCHITECTURE.md](./ARCHITECTURE.md). For API details see [DOC.md](./DOC.md).
|
||||
|
||||
## Package Boundaries
|
||||
|
||||
### Published SDK Packages
|
||||
|
||||
- `@cline/shared`: shared contracts, schemas, path helpers, hook engine, extension registry, low-level utilities
|
||||
- `@cline/llms`: provider settings/config, model catalogs, provider manifests, gateway contracts, handler creation
|
||||
- `@cline/agents`: stateless agent loop, tool orchestration, hook/extension runtime, event streaming
|
||||
- `@cline/core`: stateful orchestration, session lifecycle, storage, config watching, plugin loading, default tools, telemetry. Exposes `@cline/core/hub` for discovery, the detached daemon entry, WebSocket clients, and session/UI client adapters, plus `@cline/core/hub/daemon-entry` for launching the shared daemon
|
||||
|
||||
### Dependency Direction
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
shared["@cline/shared"] --> llms["@cline/llms"] & agents["@cline/agents"] & core["@cline/core"]
|
||||
llms --> agents & core
|
||||
agents --> core
|
||||
core --> apps["CLI / VS Code / Code App"]
|
||||
```
|
||||
|
||||
Rules:
|
||||
- `shared` stays low-level and reusable
|
||||
- `agents` stays stateless — no session/storage/config concerns
|
||||
- `core` owns stateful orchestration, including the shared-hub daemon, server, and client adapters under `src/hub/`
|
||||
|
||||
## Change Routing
|
||||
|
||||
Route changes to the package that owns the concern:
|
||||
|
||||
- model/provider schemas or handler behavior: `@cline/llms`
|
||||
- stateless loop, tool orchestration, streaming, hook/extension runtime: `@cline/agents`
|
||||
- session lifecycle, storage, config watching, default tools, plugin loading, telemetry, hub runtime services, hub discovery, hub daemon spawn, and session-oriented client helpers (`HubSessionClient`, `HubUIClient`, `connectToHub`): `@cline/core` (hub pieces live under `src/hub/`)
|
||||
- remote-config schemas, managed instruction materialization, blob upload metadata, and OpenTelemetry config normalization: `@cline/shared/src/remote-config`
|
||||
- host-specific UX or shell behavior: app package
|
||||
|
||||
## Verifying Changes
|
||||
|
||||
Root commands for cross-package confidence:
|
||||
|
||||
```sh
|
||||
bun run types # typecheck all packages
|
||||
bun run test # run all tests
|
||||
bun run check # lint + build + typecheck + check-publish
|
||||
```
|
||||
|
||||
If you touch hub/bootstrap/session flows, please update `ARCHITECTURE.md`.
|
||||
|
||||
## Practical Guidance
|
||||
|
||||
### Keep Boundaries Clean
|
||||
|
||||
- Don't move stateful logic down into `agents`
|
||||
- Don't put app-specific behavior into `core` unless it is truly shared host behavior
|
||||
- Keep remote-config primitives generic in `shared`; host-facing session integration belongs in `core`
|
||||
|
||||
### Refactor Standard
|
||||
|
||||
- Prefer direct architectural cleanup over compatibility shims
|
||||
- Move code to the layer that owns the concern and update all call sites
|
||||
- If a helper just projects watcher state, keep it with the config layer instead of creating thin runtime wrappers
|
||||
|
||||
## Documentation Responsibilities
|
||||
|
||||
- `README.md`: visitor-facing overview. Update when the repo story or package inventory changes.
|
||||
- `CONTRIBUTING.md`: onboarding, workflow, publishing. Update when contributor setup or release process changes.
|
||||
- `AGENTS.md` (this file): development reference. Update when package boundaries, dependency rules, or change routing changes.
|
||||
- `ARCHITECTURE.md`: design, boundaries, runtime flows. Update when system design or architectural constraints change.
|
||||
- `DOC.md`: API and behavior reference. Update when exported surfaces, lifecycle semantics, or runtime behavior changes.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user