@vividcodeai/pick 0.0.2-test → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +157 -0
  2. package/bin/pick.js +67 -0
  3. package/package.json +30 -2
package/README.md ADDED
@@ -0,0 +1,157 @@
1
+ [中文文档](README.zh-CN.md)
2
+
3
+ ![Pick TUI](docs/image/tui-en.png)
4
+
5
+ # Pick
6
+
7
+ **Pick** is an AI coding assistant that runs in your terminal. It connects to multiple LLM providers (Anthropic, OpenAI, Google, Mistral, Bedrock, etc.), understands your codebase, and can read, write, edit files, run commands, search code, and more — all through natural language conversation.
8
+
9
+ A Rust port of the pi AI coding agent, combining high performance with reliability.
10
+
11
+ ## Features
12
+
13
+ - **Multi-provider LLM** — Anthropic, OpenAI, Google, Mistral, Bedrock, Azure OpenAI, Cloudflare, GitHub Copilot, Google Vertex
14
+ - **4 run modes** — TUI (default), Interactive (REPL), Print/JSON (batch), RPC (JSON-RPC over stdio)
15
+ - **Agent tool system** — read, write, edit, bash, grep, find, ls, webfetch
16
+ - **Extensions** — dynamic library loading via lifecycle hooks
17
+ - **MCP support** — Model Context Protocol servers for extending tool capabilities
18
+ - **Session management** — JSONL-based persistence, fork/resume, compaction, branch summarization
19
+ - **Plan / Build modes** — Read-only planning phase before making changes
20
+ - **Sandbox isolation** — Windows restricted tokens, Linux bubblewrap, macOS Seatbelt
21
+ - **Permission system** — Granular allow/deny/ask rules with audit trail
22
+ - **Custom TUI** — Differential rendering, markdown, syntax highlighting, image display, undo/redo
23
+ - **Skills & prompt templates** — Reusable instructions and system prompts
24
+ - **Themes** — Customizable terminal UI themes
25
+ - **Two-tier settings** — Global `~/.pick/settings.json` merged with project `.pick/settings.json`
26
+ - **Auto-update** — Built-in update mechanism via `pick update`
27
+ - **Session export** — Export conversations to HTML
28
+ - **Cross-platform** — Windows, macOS, Linux
29
+
30
+ ## Architecture
31
+
32
+ ```text
33
+ pick-tui (no deps on other pick crates)
34
+
35
+ pick-ai (no deps on other pick crates)
36
+
37
+ pick-agent (depends on pick-ai, pick-tui)
38
+
39
+ pick-cli (binary, depends on all) — produces `pick` executable
40
+ pick-mcp (MCP protocol)
41
+ pick-sandbox (process isolation)
42
+ ```
43
+
44
+ - **pick-ai** — Unified multi-provider LLM abstraction with provider registry pattern
45
+ - **pick-agent** — Agent loop, tool system, session/JSONL storage, extension loader
46
+ - **pick-tui** — Crossterm-based terminal UI with custom differential rendering engine
47
+ - **pick-cli** — CLI binary, argument parsing, settings, auth, all run modes
48
+ - **pick-mcp** — Model Context Protocol client (stdio, SSE, streamable HTTP)
49
+ - **pick-sandbox** — Platform-specific process isolation (Windows Job Objects, Linux bwrap, macOS Seatbelt)
50
+
51
+ ## Installation
52
+
53
+ ### Linux / macOS
54
+
55
+ ```bash
56
+ curl -fsSL https://github.com/vividcodeai/pick/releases/latest/download/install.sh | sh
57
+ ```
58
+
59
+ ### Windows (PowerShell)
60
+
61
+ ```powershell
62
+ irm https://github.com/vividcodeai/pick/releases/latest/download/install.ps1 | iex
63
+ ```
64
+
65
+ ### From source
66
+
67
+ ```bash
68
+ git clone https://github.com/vividcodeai/pick.git
69
+ cd pick
70
+ cargo build --release
71
+ ./target/release/pick --help
72
+ ```
73
+
74
+ ## Quick Start
75
+
76
+ ```bash
77
+ # Start TUI (default mode)
78
+ pick
79
+
80
+ # Start with a specific model and provider
81
+ pick -m claude-sonnet-4-20250514 -p anthropic
82
+
83
+ # One-shot question (print mode)
84
+ pick -P "What does this project do?"
85
+
86
+ # Interactive REPL mode
87
+ pick --mode interactive
88
+
89
+ # Resume a previous session
90
+ pick -s <session-id>
91
+
92
+ # List available models
93
+ pick --list-models
94
+
95
+ # Plan mode (read-only research before making changes)
96
+ pick --agent-mode plan -P "How should I refactor this?"
97
+ ```
98
+
99
+ ## Configuration
100
+
101
+ Settings are stored in two tiers:
102
+
103
+ - **Global**: `~/.pick/settings.json`
104
+ - **Project**: `.pick/settings.json` (project-local, overrides global)
105
+
106
+ Example `.pick/settings.json`:
107
+
108
+ ```json
109
+ {
110
+ "default_provider": "anthropic",
111
+ "default_model": "claude-sonnet-4-20250514",
112
+ "permission": {
113
+ "approval_policy": "on_request",
114
+ "permission_profile": ":workspace"
115
+ }
116
+ }
117
+ ```
118
+
119
+ ## CLI Options
120
+
121
+ | Flag | Description |
122
+ |------|-------------|
123
+ | `-m, --model` | Model to use |
124
+ | `-p, --provider` | LLM provider |
125
+ | `-s, --session` | Resume session by ID |
126
+ | `-r, --resume` | Interactive session selector |
127
+ | `--fork <ID>` | Fork a session |
128
+ | `--mode` | Run mode: tui, interactive, print, json, rpc |
129
+ | `--thinking <LEVEL>` | Thinking level: off, minimal, low, medium, high, xhigh |
130
+ | `-P, --print` | Print mode (batch) |
131
+ | `-e, --extension` | Load extension |
132
+ | `--skill` | Load skill |
133
+ | `--agent-mode` | build or plan |
134
+ | `--list-models` | List available models |
135
+ | `--export <FILE>` | Export session to HTML |
136
+ | `--audit` | View permission audit trail |
137
+
138
+ ## Pros & Cons
139
+
140
+ **Pros:**
141
+ - Fast, native performance (Rust)
142
+ - Wide LLM provider support
143
+ - Rich TUI with markdown, images, syntax highlighting
144
+ - Session persistence with compaction
145
+ - Plan mode prevents accidental changes
146
+ - Extensible via dynamic libraries and MCP
147
+ - Built-in sandboxing for command execution
148
+ - Granular permission control
149
+
150
+ **Cons:**
151
+ - Younger project, smaller community
152
+ - Documentation still growing
153
+ - Some features (e.g., sandbox on macOS) require platform-specific setup
154
+
155
+ ## License
156
+
157
+ MIT
package/bin/pick.js ADDED
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from "module";
3
+ import { spawn } from "child_process";
4
+ import { existsSync } from "fs";
5
+ import { join, dirname } from "path";
6
+ import { fileURLToPath } from "url";
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const require = createRequire(import.meta.url);
10
+
11
+ const PLATFORM_PACKAGES = {
12
+ "linux-x64": "@vividcodeai/pick-linux-x64",
13
+ "linux-arm64": "@vividcodeai/pick-linux-arm64",
14
+ "darwin-x64": "@vividcodeai/pick-darwin-x64",
15
+ "darwin-arm64": "@vividcodeai/pick-darwin-arm64",
16
+ "win32-x64": "@vividcodeai/pick-win32-x64",
17
+ "win32-arm64": "@vividcodeai/pick-win32-arm64",
18
+ };
19
+
20
+ const BINARY_NAME = process.platform === "win32" ? "pick.exe" : "pick";
21
+
22
+ function getTargetTriple(platform, arch) {
23
+ if (platform === "linux" && arch === "x64") return "x86_64-unknown-linux-gnu";
24
+ if (platform === "linux" && arch === "arm64") return "aarch64-unknown-linux-gnu";
25
+ if (platform === "darwin" && arch === "x64") return "x86_64-apple-darwin";
26
+ if (platform === "darwin" && arch === "arm64") return "aarch64-apple-darwin";
27
+ if (platform === "win32" && arch === "x64") return "x86_64-pc-windows-msvc";
28
+ if (platform === "win32" && arch === "arm64") return "aarch64-pc-windows-msvc";
29
+ return null;
30
+ }
31
+
32
+ function main() {
33
+ const platform = process.platform;
34
+ const arch = process.arch;
35
+ const mapKey = `${platform}-${arch}`;
36
+ const pkgName = PLATFORM_PACKAGES[mapKey];
37
+
38
+ if (!pkgName) {
39
+ console.error(`Unsupported platform: ${platform} ${arch}`);
40
+ process.exit(1);
41
+ }
42
+
43
+ let pkgPath;
44
+ try {
45
+ pkgPath = dirname(require.resolve(`${pkgName}/package.json`));
46
+ } catch {
47
+ console.error(
48
+ `Platform package ${pkgName} not installed. Try: npm install -g ${pkgName}`
49
+ );
50
+ process.exit(1);
51
+ }
52
+
53
+ const binaryPath = join(pkgPath, "vendor", BINARY_NAME);
54
+ if (!existsSync(binaryPath)) {
55
+ console.error(`Binary not found at ${binaryPath}`);
56
+ process.exit(1);
57
+ }
58
+
59
+ const child = spawn(binaryPath, process.argv.slice(2), {
60
+ stdio: "inherit",
61
+ env: process.env,
62
+ });
63
+
64
+ child.on("exit", (code) => process.exit(code));
65
+ }
66
+
67
+ main();
package/package.json CHANGED
@@ -1,6 +1,34 @@
1
1
  {
2
2
  "name": "@vividcodeai/pick",
3
- "version": "0.0.2-test",
3
+ "version": "0.1.6",
4
+ "description": "Pick CLI - An AI coding assistant that runs locally on your computer",
4
5
  "license": "MIT",
5
- "files": []
6
+ "bin": {
7
+ "pick": "bin/pick.js"
8
+ },
9
+ "type": "module",
10
+ "engines": {
11
+ "node": ">=16"
12
+ },
13
+ "files": [
14
+ "bin/pick.js"
15
+ ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/vividcode-ai/pick.git",
19
+ "directory": "npm/pick"
20
+ },
21
+ "publishConfig": {
22
+ "registry": "https://registry.npmjs.org",
23
+ "access": "public",
24
+ "provenance": true
25
+ },
26
+ "optionalDependencies": {
27
+ "@vividcodeai/pick-linux-x64": "npm:@vividcodeai/pick@0.1.6-linux-x64",
28
+ "@vividcodeai/pick-linux-arm64": "npm:@vividcodeai/pick@0.1.6-linux-arm64",
29
+ "@vividcodeai/pick-darwin-x64": "npm:@vividcodeai/pick@0.1.6-darwin-x64",
30
+ "@vividcodeai/pick-darwin-arm64": "npm:@vividcodeai/pick@0.1.6-darwin-arm64",
31
+ "@vividcodeai/pick-win32-x64": "npm:@vividcodeai/pick@0.1.6-win32-x64",
32
+ "@vividcodeai/pick-win32-arm64": "npm:@vividcodeai/pick@0.1.6-win32-arm64"
33
+ }
6
34
  }