From bbdeb3b04fbaf99909f72b32383ed68ae487890b Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 20 Aug 2025 17:36:08 -0700 Subject: [PATCH] delete / move cli files --- .vscode/launch.json | 43 ++++++ .vscode/tasks.json | 62 +++++++++ .../.continue/assistants/cli-assistant.yaml | 12 -- .../continue-sdk-cli-and-hub-context.yaml | 36 ----- extensions/cli/.nvmrc | 1 - extensions/cli/.prettierignore | 40 ------ extensions/cli/.prettierrc | 8 -- extensions/cli/.vscode/launch.json | 46 ------- extensions/cli/.vscode/tasks.json | 56 -------- extensions/cli/docs/command-line-flags.md | 129 ------------------ 10 files changed, 105 insertions(+), 328 deletions(-) delete mode 100644 extensions/cli/.continue/assistants/cli-assistant.yaml delete mode 100644 extensions/cli/.continue/rules/continue-sdk-cli-and-hub-context.yaml delete mode 100644 extensions/cli/.nvmrc delete mode 100644 extensions/cli/.prettierignore delete mode 100644 extensions/cli/.prettierrc delete mode 100644 extensions/cli/.vscode/launch.json delete mode 100644 extensions/cli/.vscode/tasks.json delete mode 100644 extensions/cli/docs/command-line-flags.md diff --git a/.vscode/launch.json b/.vscode/launch.json index 656f25993..9e8fd7ca9 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -131,6 +131,49 @@ "env": { "NODE_OPTIONS": "--experimental-vm-modules" } + }, + { + "name": "Debug CLI", + "type": "node", + "request": "launch", + "program": "${workspaceFolder}/extensions/cli/src/index.ts", + "args": [], + "env": { + "NODE_ENV": "development" + // "CONTINUE_API_BASE": "http://localhost:3001/", + // "WORKOS_CLIENT_ID": "client_01J0FW6XCPMJMQ3CG51RB4HBZQ", + // "HUB_URL": "http://localhost:3000" + }, + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "skipFiles": ["/**"], + "runtimeArgs": ["--loader", "ts-node/esm"], + "sourceMaps": true, + "resolveSourceMapLocations": [ + "${workspaceFolder}/**", + "!**/node_modules/**" + ], + "preLaunchTask": "watch-logs", + "cwd": "${workspaceFolder}/extensions/cli" + }, + { + "name": "Debug CLI Tests", + "type": "node", + "request": "launch", + "program": "${workspaceFolder}/extensions/cli/node_modules/.bin/vitest", + "args": ["--run", "--no-cache"], + "env": { + "NODE_ENV": "test" + }, + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "skipFiles": ["/**"], + "sourceMaps": true, + "resolveSourceMapLocations": [ + "${workspaceFolder}/**", + "!**/node_modules/**" + ], + "cwd": "${workspaceFolder}/extensions/cli" } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a08ec41ef..ae679efd3 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -311,6 +311,68 @@ "close": true, "focus": false } + }, + { + "label": "cli:build", + "type": "npm", + "script": "build", + "group": "build", + "presentation": { + "echo": true, + "reveal": "silent", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false + }, + "problemMatcher": ["$tsc"], + "options": { + "cwd": "${workspaceFolder}/extensions/cli" + } + }, + { + "label": "cli:test", + "type": "npm", + "script": "test", + "group": "test", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false + }, + "options": { + "cwd": "${workspaceFolder}/extensions/cli" + } + }, + { + "label": "watch-logs", + "type": "shell", + "command": "npm run watch:logs", + "isBackground": true, + "problemMatcher": { + "pattern": { + "regexp": "^$", + "file": 1, + "location": 2, + "message": 3 + }, + "background": { + "activeOnStart": true, + "beginsPattern": "^.*$", + "endsPattern": "^.*$" + } + }, + "presentation": { + "reveal": "always", + "panel": "new", + "focus": false + }, + "options": { + "cwd": "${workspaceFolder}/extensions/cli" + } } ] } diff --git a/extensions/cli/.continue/assistants/cli-assistant.yaml b/extensions/cli/.continue/assistants/cli-assistant.yaml deleted file mode 100644 index 168731625..000000000 --- a/extensions/cli/.continue/assistants/cli-assistant.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: CLI Agent -version: 0.0.1 -schema: v1 - -models: - - uses: anthropic/claude-3-7-sonnet - with: - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - -mcpServers: - - uses: repomix/repomix-mcp - - uses: anthropic/memory-mcp diff --git a/extensions/cli/.continue/rules/continue-sdk-cli-and-hub-context.yaml b/extensions/cli/.continue/rules/continue-sdk-cli-and-hub-context.yaml deleted file mode 100644 index a71e68275..000000000 --- a/extensions/cli/.continue/rules/continue-sdk-cli-and-hub-context.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Continue SDK CLI and Hub Context -version: 0.0.1 -schema: v1 -rules: - - name: Continue SDK CLI and Hub Context - rule: >- - This repository is a CLI for the Continue SDK, which provides programmatic - access to Continue's APIs. - - - Key components: - - - Continue SDK: Experimental package in early development, subject to - breaking changes - - - Continue Hub: Registry for custom AI code agent - - - Hub functionality: Manages agent building blocks (models, rules, - context providers, prompts, docs, etc.) - - - Governance: Allows central configuration for organizations - - - Important libraries: - - - WorkOS: Handles authentication flows - - - Model Context Protocol (MCP): Manages MCP server interactions - - - readline-sync: Provides synchronous CLI user interactions - - - Vitest: Used for testing framework - - - All code should follow established patterns for a Node.js CLI tool - interfacing with this experimental SDK. diff --git a/extensions/cli/.nvmrc b/extensions/cli/.nvmrc deleted file mode 100644 index 7ea6a59d3..000000000 --- a/extensions/cli/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v20.11.0 diff --git a/extensions/cli/.prettierignore b/extensions/cli/.prettierignore deleted file mode 100644 index f7553b3a2..000000000 --- a/extensions/cli/.prettierignore +++ /dev/null @@ -1,40 +0,0 @@ -# Dependencies -node_modules/ - -# Build output -dist/ - -# Coverage -coverage/ - -# Logs -*.log -logs/ - -# OS files -.DS_Store -Thumbs.db - -# IDE files -.vscode/ -.idea/ -*.swp -*.swo - -# Lock files -package-lock.json -yarn.lock -pnpm-lock.yaml - -# Test files -*.test.ts -*.test.tsx -*.spec.ts -*.spec.tsx - -# Config files that don't need formatting -.prettierrc -.prettierignore - -# Generated files -*.generated.* \ No newline at end of file diff --git a/extensions/cli/.prettierrc b/extensions/cli/.prettierrc deleted file mode 100644 index 354af4b2f..000000000 --- a/extensions/cli/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "tabWidth": 2, - "useTabs": false, - "trailingComma": "all", - "semi": true, - "singleQuote": false, - "bracketSpacing": true -} diff --git a/extensions/cli/.vscode/launch.json b/extensions/cli/.vscode/launch.json deleted file mode 100644 index 07d82ce2a..000000000 --- a/extensions/cli/.vscode/launch.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Debug CLI", - "type": "node", - "request": "launch", - "program": "${workspaceFolder}/src/index.ts", - "args": [], - "env": { - "NODE_ENV": "development" - // "CONTINUE_API_BASE": "http://localhost:3001/", - // "WORKOS_CLIENT_ID": "client_01J0FW6XCPMJMQ3CG51RB4HBZQ", - // "HUB_URL": "http://localhost:3000" - }, - "console": "integratedTerminal", - "internalConsoleOptions": "neverOpen", - "skipFiles": ["/**"], - "runtimeArgs": ["--loader", "ts-node/esm"], - "sourceMaps": true, - "resolveSourceMapLocations": [ - "${workspaceFolder}/**", - "!**/node_modules/**" - ], - "preLaunchTask": "watch-logs" - }, - { - "name": "Debug Tests", - "type": "node", - "request": "launch", - "program": "${workspaceFolder}/node_modules/.bin/vitest", - "args": ["--run", "--no-cache"], - "env": { - "NODE_ENV": "test" - }, - "console": "integratedTerminal", - "internalConsoleOptions": "neverOpen", - "skipFiles": ["/**"], - "sourceMaps": true, - "resolveSourceMapLocations": [ - "${workspaceFolder}/**", - "!**/node_modules/**" - ] - } - ] -} diff --git a/extensions/cli/.vscode/tasks.json b/extensions/cli/.vscode/tasks.json deleted file mode 100644 index 0e4b46eb2..000000000 --- a/extensions/cli/.vscode/tasks.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "script": "build", - "group": "build", - "presentation": { - "echo": true, - "reveal": "silent", - "focus": false, - "panel": "shared", - "showReuseMessage": true, - "clear": false - }, - "problemMatcher": ["$tsc"] - }, - { - "type": "npm", - "script": "test", - "group": "test", - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "shared", - "showReuseMessage": true, - "clear": false - } - }, - { - "label": "watch-logs", - "type": "shell", - "command": "npm run watch:logs", - "isBackground": true, - "problemMatcher": { - "pattern": { - "regexp": "^$", - "file": 1, - "location": 2, - "message": 3 - }, - "background": { - "activeOnStart": true, - "beginsPattern": "^.*$", - "endsPattern": "^.*$" - } - }, - "presentation": { - "reveal": "always", - "panel": "new", - "focus": false - } - } - ] -} diff --git a/extensions/cli/docs/command-line-flags.md b/extensions/cli/docs/command-line-flags.md deleted file mode 100644 index 935adb1a1..000000000 --- a/extensions/cli/docs/command-line-flags.md +++ /dev/null @@ -1,129 +0,0 @@ -# Continue CLI Command Line Options - -Quick reference for using `cn` command line options. - -## Basic Usage - -```bash -cn # Start interactive chat -cn "analyze my code" # Chat with prompt -cn -p "review this file" # Print response and exit (headless) -``` - -## Configuration - -- `--config ` - Use specific config file -- `--verbose` - Show detailed logging - -```bash -cn --config ./my-config.yaml -cn --verbose -p "debug this issue" -``` - -## Permission Modes - -- `--readonly` - Only allow read operations (safe mode) -- `--auto` - Allow all tools without asking (careful!) - -```bash -cn --readonly -p "analyze the codebase" # Safe: can't modify files -cn --auto -p "fix the failing tests" # Dangerous: will modify files -``` - -## Fine-grained Permissions - -- `--allow ` - Allow specific tools -- `--ask ` - Ask before using tools -- `--exclude ` - Block specific tools - -```bash -cn --allow readFile --allow searchCode -p "find todos" -cn --exclude Write -p "help me understand this code" # Can't modify files -cn --ask writeFile -p "suggest fixes" # Will ask before writing -``` - -## Headless Mode (for scripts) - -Use `-p` for non-interactive output: - -```bash -cn -p "summarize the main function" -echo "error log" | cn -p "what caused this error?" -cn -p --format json "list main files" | jq '.response' -cn -p --silent "get summary" | grep -v "^$" # Clean output -``` - -## Server Mode - -Run Continue as a server: - -```bash -cn serve # Start server on port 8000 -cn serve --port 3000 # Custom port -cn serve --timeout 600 # 10 minute timeout -``` - -## Remote Development - -```bash -cn remote "help debug this" # Create new remote environment -cn remote --url https://my-server.com "work" # Connect to existing server -cn remote --idempotency-key my-session "work" # Resume or create idempotent session -``` - -### Idempotent Sessions - -Use `--idempotency-key` to create resumable remote sessions: - -```bash -# First time - creates new session -cn remote --idempotency-key "project-review" "start code review" - -# Later - resumes same session if it exists -cn remote --idempotency-key "project-review" "continue where we left off" - -# Different key - creates separate session -cn remote --idempotency-key "feature-dev" "work on new feature" -``` - -The backend manages session lifecycle based on the idempotency key: - -- New key = new remote environment -- Existing key = connect to existing session -- Sessions may expire based on backend configuration - -### Repository Detection - -The `cn remote` command automatically detects your repository URL: - -- **GitHub Actions**: Uses `GITHUB_REPOSITORY` and `GITHUB_SERVER_URL` environment variables -- **Git Repository**: Uses `git remote get-url origin` -- **Fallback**: Uses current working directory path - -This ensures the remote environment is created with the correct repository context. - -## Common Examples - -```bash -# Safe code analysis -cn --readonly -p "review my git diff" - -# Let AI fix tests (with permission) -cn --ask writeFile -p "fix failing tests" - -# Scripted code review -git diff | cn -p "review this change" --format json - -# Remote pair programming -cn remote "help me implement user auth" - -# Run as code review server -cn serve --readonly --port 8080 -``` - -## Notes - -- Use `--readonly` when you want AI to analyze but not modify code -- Use `--auto` only when you trust the AI to make changes -- Pipe input works: `cat file.py | cn -p "explain this"` -- `--format json` and `--silent` only work with `-p`