{"_id":"@ancher-ai/cli","_rev":"2-2eee17f6818488f04b529bebec88da3b","name":"@ancher-ai/cli","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@ancher-ai/cli","version":"0.1.0","license":"Apache-2.0","_id":"@ancher-ai/cli@0.1.0","maintainers":[{"name":"why-ancher","email":"why@streamify.one"},{"name":"yajun.wang.streamify","email":"yajun.wang@streamify.one"}],"bin":{"ancher":"dist/index.js"},"dist":{"shasum":"0a19bde4589682336c1c490dc8fad828846e658b","tarball":"https://registry.npmjs.org/@ancher-ai/cli/-/cli-0.1.0.tgz","fileCount":4,"integrity":"sha512-sFU9pyZD1x2iN5Db/uakkFHhCsank4ni1St+2H56YsB2JVUjHYK1M3UtBJik4fibPYn3+W8Bvl4CvlXhnnIsMg==","signatures":[{"sig":"MEUCIQDrAJHCR9YYjCpIRP1WTRanzh0vl7+0TkCWe81XYheekgIgGB9Ad8chTxdOaAqzns8icrAey4+pPlZFvIzIJUWsezs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":200726},"type":"module","_from":"file:apps/cli/ancher-ai-cli-0.1.0.tgz","exports":{".":"./dist/index.js"},"private":false,"scripts":{"dev":"esbuild src/index.ts --bundle --platform=node --format=esm --target=node24 --outfile=dist/index.js --banner:js=\"#!/usr/bin/env node\" --watch=forever","lint":"pnpm --dir ../.. exec vp check apps/cli","test":"vp test run","build":"esbuild src/index.ts --bundle --platform=node --format=esm --target=node24 --outfile=dist/index.js --banner:js=\"#!/usr/bin/env node\"","package":"pnpm build && pnpm pack","typecheck":"tsc --noEmit","link:global":"pnpm link --global"},"_npmUser":{"name":"yajun.wang.streamify","email":"yajun.wang@streamify.one"},"_resolved":"/Users/arjun/Code/streamify-one/streamify-one-design-system/apps/cli/ancher-ai-cli-0.1.0.tgz","_integrity":"sha512-sFU9pyZD1x2iN5Db/uakkFHhCsank4ni1St+2H56YsB2JVUjHYK1M3UtBJik4fibPYn3+W8Bvl4CvlXhnnIsMg==","_npmVersion":"11.13.0","description":"Ancher CLI — a thin, terminal-friendly layer over @ancher-ai/sdk. Authenticates (OAuth2 or API key) and drives the whole Ancher API.","directories":{},"_nodeVersion":"24.16.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"4.1.9","esbuild":"^0.28.1","vite-plus":"0.2.6","typescript":"~5.9.3","@types/node":"^24.12.2","@ancher-ai/sdk":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.1.0_1785813862186_0.4227601895036417","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@ancher-ai/cli","version":"0.1.1","private":false,"type":"module","description":"Command line for Ancher, your personal knowledge base and research assistant: capture notes, search them by meaning, chat with the agent, and script the whole Ancher API.","keywords":["ancher","cli","knowledge-base","note-taking","notes","rag","semantic-search","ai-agent","second-brain","api-client"],"license":"Apache-2.0","homepage":"https://ancher.ai","repository":{"type":"git","url":"git+https://github.com/streamify-one/ancher-cli.git"},"bugs":{"url":"https://github.com/streamify-one/ancher-cli/issues"},"bin":{"ancher":"dist/index.js"},"exports":{".":"./dist/index.js"},"devDependencies":{"@types/node":"^24.12.2","esbuild":"^0.28.1","typescript":"~5.9.3","vitest":"4.1.9","vite-plus":"0.2.6","@ancher-ai/sdk":"0.1.0"},"scripts":{"dev":"esbuild src/index.ts --bundle --platform=node --format=esm --target=node24 --outfile=dist/index.js --banner:js=\"#!/usr/bin/env node\" --watch=forever","build":"esbuild src/index.ts --bundle --platform=node --format=esm --target=node24 --outfile=dist/index.js --banner:js=\"#!/usr/bin/env node\"","link:global":"pnpm link --global","typecheck":"tsc --noEmit","lint":"pnpm --dir ../.. exec vp check apps/cli","test":"vp test run","package":"pnpm build && pnpm pack"},"_id":"@ancher-ai/cli@0.1.1","_integrity":"sha512-nqeEV6qaP4aJSa1OhxRL+41IWdk9cO3oFTefHvOAFcHKlaA6bq8Vr3vJvPgGYwganWMmksi1yB7EJPUao44X/A==","_resolved":"/home/runner/work/_temp/ancher-ai-cli-0.1.1.tgz","_from":"file:/home/runner/work/_temp/ancher-ai-cli-0.1.1.tgz","_nodeVersion":"24.18.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-nqeEV6qaP4aJSa1OhxRL+41IWdk9cO3oFTefHvOAFcHKlaA6bq8Vr3vJvPgGYwganWMmksi1yB7EJPUao44X/A==","shasum":"ab4a6ad4fa2463b33bd663f95de9d463898c8813","tarball":"https://registry.npmjs.org/@ancher-ai/cli/-/cli-0.1.1.tgz","fileCount":4,"unpackedSize":203430,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDRMOhvEyUgP4N7Jj8SJRrDTgKCC4S0rm3DlFlwoQ4k7wIhALTxLjyRsoEmH26KJcdSrlKIgi7en09UE5drNKyAIffw"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c97f96ba-4f62-4ad6-aeb1-42efdfcc3abe"}},"directories":{},"maintainers":[{"name":"why-ancher","email":"why@streamify.one"},{"name":"yajun.wang.streamify","email":"yajun.wang@streamify.one"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.1.1_1785837083153_0.8186538547426039"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-04T03:24:22.062Z","modified":"2026-08-04T09:51:23.480Z","0.1.0":"2026-08-04T03:24:22.343Z","0.1.1":"2026-08-04T09:51:23.288Z"},"license":"Apache-2.0","description":"Command line for Ancher, your personal knowledge base and research assistant: capture notes, search them by meaning, chat with the agent, and script the whole Ancher API.","maintainers":[{"name":"why-ancher","email":"why@streamify.one"},{"name":"yajun.wang.streamify","email":"yajun.wang@streamify.one"}],"readme":"# @ancher-ai/cli\n\n[![npm](https://img.shields.io/npm/v/@ancher-ai/cli)](https://www.npmjs.com/package/@ancher-ai/cli)\n[![license](https://img.shields.io/npm/l/@ancher-ai/cli)](https://github.com/streamify-one/ancher-cli/blob/main/LICENSE)\n\nThe command line for **[Ancher](https://ancher.ai)** — your personal knowledge\nbase and research assistant. Save anything, find it by meaning rather than\nkeyword, and put an agent to work on it, without leaving your terminal.\n\n```bash\nnpm install -g @ancher-ai/cli\nancher login\nancher chat \"what did I save about vector databases?\"\n```\n\nEvery command prints JSON, authenticates from an environment variable, and\nrejects an unknown flag before a request leaves your machine — so one interface\nserves a person at a prompt, a CI job, and an AI agent equally well.\n\nRequires **Node 24+**.\n\n## Authentication\n\nTwo modes. The CLI uses the API key when `ANCHER_API_TOKEN` is set, and\notherwise the OAuth2 session saved by `ancher login`.\n\n**Interactive** — a human at a terminal:\n\n```bash\nancher login    # Authorization Code + PKCE, in your browser\nancher whoami   # the authenticated user\nancher logout   # clear the saved session\n```\n\nThe session is written to `credentials.json` under `$ANCHER_CONFIG_DIR`, falling\nback to `$XDG_CONFIG_HOME/ancher` and then `~/.config/ancher`.\n\n**Non-interactive** — CI, scripts, agents:\n\n```bash\nexport ANCHER_API_TOKEN=sk_your_key_here\nancher whoami\n```\n\nMint a key from an already-authenticated session:\n\n```bash\nancher api-keys create \"ci\" --expires-in-days 90\n```\n\n## Talk to the agent\n\nThe reply streams as it is generated.\n\n```bash\nancher chat \"summarize my recent notes\"\nancher chat \"and the one about Postgres?\" --conversation <id>\nancher chat \"plan my reading week\" --verbose\n```\n\n`--conversation` continues an existing thread; `--verbose` also surfaces the\nagent's thinking and tool calls. Conversations are first-class objects:\n\n```bash\nancher conversations list --limit 5\nancher conversations get <id>\n```\n\n## Your knowledge base\n\nCapture from text, a URL, a file, or a conversation:\n\n```bash\nancher notes create-text \"Kafka rebalances stall consumers for about 3s\"\nancher notes create-url \"https://example.com/article\" --comment \"great read\"\nancher files upload --file ./diagram.png\n```\n\nSearch by meaning rather than keyword — this is retrieval-augmented, so it finds\nthe note you half-remember:\n\n```bash\nancher retrieval notes \"vector databases\"\nancher retrieval chunks \"how does presigned upload work\"\n```\n\nOrganize:\n\n```bash\nancher notes list --limit 10 --order-by -updated_at\nancher notes update <id> --title \"New title\" --public --reaction like\nancher collections create \"Reading list\" --color blue\nancher collections add-note <id> <noteId>\nancher tags create \"urgent\" --color red\nancher notes set-tags <id> <tagId> <tagId>\n```\n\nRead a note's body as plain text instead of a JSON envelope:\n\n```bash\nancher notes content <id> > note.md\n```\n\n## Call any endpoint\n\nThe typed commands are sugar over a single authenticated transport, and `api`\nexposes it directly — anything the Ancher API can do, the CLI can do:\n\n```bash\nancher api GET \"notes/?limit=5\"\nancher api POST notes/text --body '{\"text\":\"hello\"}'\nancher api PATCH notes/{id} --body @patch.json\n```\n\nReach for it when you need a field the typed commands don't expose yet, or when\nthe payload already exists on disk — `--body @file` reads it from there.\n\n## Output\n\n| Stream | Contents |\n| --- | --- |\n| stdout | Pretty-printed JSON: the response, and nothing else. Pipe it to `jq`. |\n| stderr | Progress, warnings, and errors. |\n\nExit code `0` on success, `1` on any failure. Errors are actionable rather than\nraw — an HTTP 401 tells you to run `ancher login`.\n\nTwo commands return raw bytes on purpose, because that is the point of them:\n`notes content` prints the note body, and `chat` streams prose.\n\n## Flags\n\nFlags are validated before anything is sent. A flag a command doesn't declare\nfails immediately and names itself, so a typo can never reach the API as\nsilently dropped input:\n\n```bash\nancher notes list --limitt 2      # error: Unknown flag --limitt\nancher notes list --limit abc     # error: --limit must be a number (got \"abc\")\n```\n\n- Values attach inline or as the next token — `--limit=5`, `--limit 5`.\n- Booleans are bare and negate with `--no-` — `--public`, `--no-public`.\n- Nullable fields clear with `--clear-<flag>`, which sends `null` —\n  `ancher notes update <id> --clear-reaction`.\n- Short forms cover the busiest flags: `-q`/`--query`, `-d`/`--body`,\n  `-f`/`--file`, `-c`/`--conversation`, plus the global `-h` and `-v`.\n- A bare `--` ends option parsing, for free text that starts with a dash —\n  `ancher notes create-text -- \"--text that starts with dashes\"`.\n\nSecret-bearing flags accept a `--<flag>-stdin` variant that reads one line from\nstdin, keeping the value out of argv, shell history, and `ps`. Several in one\ncommand read successive lines:\n\n```bash\nprintf '%s\\n%s\\n' \"$OLD_PASSWORD\" \"$NEW_PASSWORD\" |\n  ancher users change-password --current-password-stdin --new-password-stdin\n```\n\n## Environment variables\n\n| Variable | Purpose |\n| --- | --- |\n| `ANCHER_API_TOKEN` | API key for non-interactive auth. Takes precedence over the saved session. |\n| `ANCHER_API_BASE_URL` | Target a non-default API origin. Same as `--base-url`. |\n| `ANCHER_CONFIG_DIR` | Where the OAuth2 session is stored. Defaults to `$XDG_CONFIG_HOME/ancher`, then `~/.config/ancher`. |\n\n## Command reference\n\nThe CLI documents itself: `ancher help` lists every command, and\n`ancher help <resource>` prints one resource's actions with their exact flags.\n\n| Group | Resources |\n| --- | --- |\n| Knowledge base | `notes` `collections` `artifacts` `tags` `files` |\n| Agent & AI | `conversations` `messages` `retrieval` `image-prompt` |\n| Inbox & discovery | `pins` `notifications` `suggestions` `recommendations` |\n| Account | `sessions` `users` `api-keys` `connections` `devices` `billing` |\n\nMost resources share the same verbs — `list` (with `--limit`, `--cursor`,\n`--order-by`), `get <id>`, `create <primary> [--flags]`, `update <id> [--flags]`,\nand `delete <id>`. A request body's one primary field is a positional argument;\nevery other field is a named flag.\n\n## Driving this from an AI agent\n\n`ancher` is built to be called by a program, not just typed:\n\n- **Authenticate with `ANCHER_API_TOKEN`.** No browser, no prompt, no local state.\n- **Parse stdout as JSON.** Diagnostics never contaminate it.\n- **Discover the surface at runtime** via `ancher help` and\n  `ancher help <resource>` instead of hardcoding a command list.\n- **Trust the flag validator.** A wrong guess fails loudly and names the flag,\n  rather than sending a request that quietly omits your data.\n- **Fall back to `api`** for anything the typed commands don't cover.\n\nIf your agent is Claude Code, Codex, or Cursor,\n[`@ancher-ai/agent-skills`](https://www.npmjs.com/package/@ancher-ai/agent-skills)\ninstalls ready-made Ancher skills plus the hosted MCP server in one step — the\nagent gets both the know-how and the tools, without shelling out to this CLI.\n\n## Links\n\n- **[ancher.ai](https://ancher.ai)** — the product\n- **[`@ancher-ai/agent-skills`](https://www.npmjs.com/package/@ancher-ai/agent-skills)** —\n  Ancher skills and MCP setup for coding agents\n- **[Issues](https://github.com/streamify-one/ancher-cli/issues)** — bugs and\n  feature requests\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md","homepage":"https://ancher.ai","keywords":["ancher","cli","knowledge-base","note-taking","notes","rag","semantic-search","ai-agent","second-brain","api-client"],"repository":{"type":"git","url":"git+https://github.com/streamify-one/ancher-cli.git"},"bugs":{"url":"https://github.com/streamify-one/ancher-cli/issues"}}