{"_id":"@andie/cd2","_rev":"4-bf7038f85dafddc1a36ec4178c8fc589","name":"@andie/cd2","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@andie/cd2","version":"0.0.1","_id":"@andie/cd2@0.0.1","maintainers":[{"name":"andie","email":"zchangan@163.com"}],"bin":{"cd2":"dist/cli.js"},"dist":{"shasum":"703bd8e4268c234e881eecfb15152da2f2008198","tarball":"https://registry.npmjs.org/@andie/cd2/-/cd2-0.0.1.tgz","fileCount":22,"integrity":"sha512-mJMp/WvI1WZDFAdGhs70hDyygfXrf6nzdMYOSKn8zjQgAZitw+VyxzTfZICahEa2/reIDQlIi0bbQ6b5VCxPhA==","signatures":[{"sig":"MEUCIQDj497EnDnUn14EVg+XhaDEdAAtlPZ4vLIoJ2jItCnowgIgAUqNaF4cVvKc9mQgdX8MdYlUsicpBJGttJrbpKXZSUU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":167048},"engines":{"node":">=20"},"gitHead":"35a3287ef1869dfa49399bbce1c232a21e8a00ec","scripts":{"cd2":"tsx src/cli.ts","test":"vitest run","build":"tsc -p tsconfig.build.json","prepack":"pnpm build","typecheck":"tsc -p tsconfig.json --noEmit","live:smoke":"tsx tests/live-smoke.ts","test:watch":"vitest"},"_npmUser":{"name":"andie","email":"zchangan@163.com"},"_npmVersion":"11.13.0","description":"CloudDrive2 gRPC CLI and Agent Skill","directories":{},"_nodeVersion":"24.17.0","dependencies":{"@grpc/grpc-js":"^1.14.4","@grpc/proto-loader":"^0.8.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.3","vitest":"^3.2.4","typescript":"^5.8.3","@types/node":"^24.0.4"},"_npmOperationalInternal":{"tmp":"tmp/cd2_0.0.1_1782186458506_0.2284423178981314","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@andie/cd2","version":"0.0.2","_id":"@andie/cd2@0.0.2","maintainers":[{"name":"andie","email":"zchangan@163.com"}],"homepage":"https://github.com/Andiedie/cd2-skills#readme","bugs":{"url":"https://github.com/Andiedie/cd2-skills/issues"},"bin":{"cd2":"dist/cli.js"},"dist":{"shasum":"e5278da6cb40e3bfd2ddcbd8942340d1d2965bb0","tarball":"https://registry.npmjs.org/@andie/cd2/-/cd2-0.0.2.tgz","fileCount":22,"integrity":"sha512-88CJP9wY06pSNwd6tW15QdKhsEaN3cq9RuMhbt3zgeMjT6AaBB1x0Dcw54eCMAnfZ9dW3fBWfSxL0o1XRk2Amw==","signatures":[{"sig":"MEYCIQC/y2hIZqtXvp+EXu9yUr70BLMfxoG13MtPpe2CAwMx6gIhAMZDKHVIvVWaICBqu99rPcm1w96gu/Rn6072R0oI5ZpW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@andie%2fcd2@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":167178},"engines":{"node":">=20"},"gitHead":"367f6a5dec616359d3f4830a37e30d593069f376","scripts":{"cd2":"tsx src/cli.ts","test":"vitest run","build":"tsc -p tsconfig.build.json","prepack":"pnpm build","typecheck":"tsc -p tsconfig.json --noEmit","live:smoke":"tsx tests/live-smoke.ts","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9577d066-7f42-4725-88fe-dbb14c28cd55"}},"repository":{"url":"git+https://github.com/Andiedie/cd2-skills.git","type":"git"},"_npmVersion":"11.13.0","description":"CloudDrive2 gRPC CLI and Agent Skill","directories":{},"_nodeVersion":"24.16.0","dependencies":{"@grpc/grpc-js":"^1.14.4","@grpc/proto-loader":"^0.8.1"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.18.1","devDependencies":{"tsx":"^4.20.3","vitest":"^3.2.4","typescript":"^5.8.3","@types/node":"^24.0.4"},"_npmOperationalInternal":{"tmp":"tmp/cd2_0.0.2_1782187014489_0.33569320586362483","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@andie/cd2","version":"0.0.3","_id":"@andie/cd2@0.0.3","maintainers":[{"name":"andie","email":"zchangan@163.com"}],"homepage":"https://github.com/Andiedie/cd2-skills#readme","bugs":{"url":"https://github.com/Andiedie/cd2-skills/issues"},"bin":{"cd2":"dist/cli.js"},"dist":{"shasum":"589a78ae901cc56c02f989746ce3250aa447d6f2","tarball":"https://registry.npmjs.org/@andie/cd2/-/cd2-0.0.3.tgz","fileCount":21,"integrity":"sha512-/cTFJzMNkUaoVk+dSzgy/wTLJZvyD3ThYyP+wDPHVeCFBighJq19QyF0zBfj6iYkhcqdNV3vV9ozmqxdh2unjA==","signatures":[{"sig":"MEUCIQCL2oqHvHqPwudly7nmuIKvaZrVrLj8fE/gDScbld82tgIgfHn5j/3hPHYbaFmv74f6NKI7AOvMLl4ey0izvx7i6CI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@andie%2fcd2@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":163013},"engines":{"node":">=20"},"gitHead":"5d2839e61b6db119a55b3fa57ee8c2e7e46fa7fd","scripts":{"cd2":"tsx src/cli.ts","test":"vitest run","build":"pnpm clean && tsc -p tsconfig.build.json","clean":"node -e \"require('node:fs').rmSync('dist', {recursive: true, force: true})\"","prepack":"pnpm build","typecheck":"tsc -p tsconfig.json --noEmit","live:smoke":"tsx tests/live-smoke.ts","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9577d066-7f42-4725-88fe-dbb14c28cd55"}},"repository":{"url":"git+https://github.com/Andiedie/cd2-skills.git","type":"git"},"_npmVersion":"11.13.0","description":"CloudDrive2 gRPC CLI and Agent Skill","directories":{},"_nodeVersion":"24.16.0","dependencies":{"@grpc/grpc-js":"^1.14.4","@grpc/proto-loader":"^0.8.1"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.18.1","devDependencies":{"tsx":"^4.20.3","vitest":"^3.2.4","typescript":"^5.8.3","@types/node":"^24.0.4"},"_npmOperationalInternal":{"tmp":"tmp/cd2_0.0.3_1782202297976_0.26172594663387927","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@andie/cd2","version":"0.0.4","description":"CloudDrive2 gRPC CLI and Agent Skill","repository":{"type":"git","url":"git+https://github.com/Andiedie/cd2-skills.git"},"packageManager":"pnpm@10.18.1","bin":{"cd2":"dist/cli.js"},"scripts":{"clean":"node -e \"require('node:fs').rmSync('dist', {recursive: true, force: true})\"","build":"pnpm clean && tsc -p tsconfig.build.json","cd2":"tsx src/cli.ts","live:smoke":"tsx tests/live-smoke.ts","prepack":"pnpm build","test":"vitest run","test:watch":"vitest","typecheck":"tsc -p tsconfig.json --noEmit"},"engines":{"node":">=20"},"devDependencies":{"@types/node":"^24.0.4","tsx":"^4.20.3","typescript":"^5.8.3","vitest":"^3.2.4"},"dependencies":{"@grpc/grpc-js":"^1.14.4","@grpc/proto-loader":"^0.8.1"},"gitHead":"5e984d1de40c59aa763107d8e160d24dee2e71e6","_id":"@andie/cd2@0.0.4","bugs":{"url":"https://github.com/Andiedie/cd2-skills/issues"},"homepage":"https://github.com/Andiedie/cd2-skills#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-Hbm783APX/nSzm/xRVZcnVF69OObzbC+UDbUsV/dTyScpz9e/4/MOxgIIqAyAJitcH3VDc/b9oqIXqb++nKLGQ==","shasum":"151002b2a235a8101f551c1ec05f378323a57dcc","tarball":"https://registry.npmjs.org/@andie/cd2/-/cd2-0.0.4.tgz","fileCount":25,"unpackedSize":179752,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@andie%2fcd2@0.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHKiJEjokj6fsf8FLYoKIXyBLRqnJ4txvr0Nq4Qe7zdgAiEAs377AvrXIKNznPtdn3XovXsAGvOWygXAgQgAPdoOkqI="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9577d066-7f42-4725-88fe-dbb14c28cd55"}},"directories":{},"maintainers":[{"name":"andie","email":"zchangan@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cd2_0.0.4_1782211324194_0.916195781690798"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-23T03:47:38.320Z","modified":"2026-06-23T10:42:04.571Z","0.0.1":"2026-06-23T03:47:38.663Z","0.0.2":"2026-06-23T03:56:54.620Z","0.0.3":"2026-06-23T08:11:38.147Z","0.0.4":"2026-06-23T10:42:04.324Z"},"bugs":{"url":"https://github.com/Andiedie/cd2-skills/issues"},"homepage":"https://github.com/Andiedie/cd2-skills#readme","repository":{"type":"git","url":"git+https://github.com/Andiedie/cd2-skills.git"},"description":"CloudDrive2 gRPC CLI and Agent Skill","maintainers":[{"name":"andie","email":"zchangan@163.com"}],"readme":"# cd2\n\n`cd2` is a Node.js CLI and Agent Skill for basic CloudDrive2 file operations over gRPC.\n\nThe npm package is `@andie/cd2`; the executable command is `cd2`.\n\n## Install And Run\n\n```sh\nnpx @andie/cd2 --help\n```\n\nFor local development:\n\n```sh\npnpm install\npnpm cd2 -- --help\n```\n\n## Configure\n\n```sh\nnpx @andie/cd2 config set endpoint localhost:19798\nnpx @andie/cd2 config set token <api-token>\nnpx @andie/cd2 config get\n```\n\nConfig is stored at `~/.config/cd2/config.json` unless `XDG_CONFIG_HOME` is set.\n\nPrecedence:\n\n1. CLI flags\n2. Environment variables\n3. User config\n\nEnvironment variables:\n\n```sh\nCD2_ENDPOINT=localhost:19798\nCD2_API_TOKEN=<api-token>\n```\n\n## Commands\n\n```sh\nnpx @andie/cd2 stat /docs/a.txt\nnpx @andie/cd2 ls /docs --refresh\nnpx @andie/cd2 tree /docs --max-depth 3 --limit 300\nnpx @andie/cd2 find /docs --name invoice --max-depth 8 --limit 200\nnpx @andie/cd2 find /docs --glob \"*.pdf\" --type file\nnpx @andie/cd2 mkdir /docs/new-folder\nnpx @andie/cd2 upload ./a.txt /docs/a.txt\nnpx @andie/cd2 download /docs/a.txt ./a.txt\nnpx @andie/cd2 rename /docs/a.txt b.txt\nnpx @andie/cd2 mv /docs/b.txt /archive --conflict skip\nnpx @andie/cd2 cp /archive/b.txt /docs --conflict rename\nnpx @andie/cd2 rm /docs/b.txt\n```\n\nRemote paths must be absolute and begin with `/`.\n\n`upload` and `download` take full file paths. `mv` and `cp` take destination directories. Use `rename` to change a file name.\n\n`rename` takes a single new name, not a path. Use `mv` to move a file to\nanother directory.\n\n`rm` uses normal CloudDrive2 deletion by default. Use `--permanent` only when permanent deletion is explicitly desired.\n\n`tree` and `find` use bounded recursive listing. If `--max-depth` or `--limit` is omitted, the command applies defaults and reports the effective values in `data.limits`. Check `data.truncated` and `data.truncation.byLimit` / `data.truncation.byMaxDepth` before treating the result as complete.\n\n`find` filters names locally from recursive listings; it does not use CloudDrive2 native search.\n\n## Output\n\nCommands write stable JSON Agent Results to stdout:\n\n```json\n{\n  \"ok\": true,\n  \"command\": \"stat\",\n  \"data\": {}\n}\n```\n\nDiagnostics and progress go to stderr.\n\nMutation commands return an operation receipt. Prefer these fields over raw\nCloudDrive2 RPC fields:\n\n```json\n{\n  \"ok\": true,\n  \"command\": \"cp\",\n  \"data\": {\n    \"from\": \"/archive/a.txt\",\n    \"to\": \"/docs/a.txt\",\n    \"destDir\": \"/docs\",\n    \"conflict\": \"rename\",\n    \"reportedPaths\": [],\n    \"warnings\": [\n      {\n        \"code\": \"RESULT_PATH_NOT_REPORTED\",\n        \"message\": \"CloudDrive2 did not report the final path.\"\n      }\n    ]\n  }\n}\n```\n\nFor `cp`, `mv`, and `rename`, `to` is the requested target path. If\nCloudDrive2 reports affected paths, they appear in `reportedPaths`; this array\ncan be empty even when the command succeeds. `rm` returns `removed: true` after\nsuccessful deletion.\n\n## Development\n\n```sh\npnpm test\npnpm typecheck\npnpm build\n```\n\nThe normal test suite does not require live CloudDrive2 credentials.\n\nOptional live smoke test:\n\n```sh\nCD2_ENDPOINT=localhost:19798 \\\nCD2_API_TOKEN=<api-token> \\\nCD2_LIVE_ROOT=/ \\\npnpm live:smoke\n```\n\nUse a dedicated API token scoped to a disposable test root. If CloudDrive2 token `RootDirectoryRequired` is set, that root appears to the CLI as `/`.\n","readmeFilename":"README.md"}