[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81848":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":15,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":16,"rankGlobal":10,"rankLanguage":10,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":18,"hasPages":18,"topics":20,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":28,"discoverSource":29},81848,"scinet-queue","tivris\u002Fscinet-queue","tivris","A small CLI for managing Sci-Net paper requests.","",null,"Rust",23,2,1,0,41.43,"MIT License",false,"main",[21,22,23,24],"cli","doi","research-tools","sci-net","2026-06-12 04:01:35","# scinet-queue\n\n[![ci](https:\u002F\u002Fgithub.com\u002Ftivris\u002Fscinet-queue\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftivris\u002Fscinet-queue\u002Factions\u002Fworkflows\u002Fci.yml)\n\n`scinet-queue` is a small command-line tool for managing Sci-Net paper\nrequests. The binary is `snq`.\n\nThe project is in early development. The current build supports\nworkspace-local queues, browser selection, managed login\u002Fsession checks,\nSci-Net check\u002Frequest\u002Fwatch\u002Fview\u002Furl\u002Ffetch workflows, local approval state,\ntoken balance and budget checks, JSON output, and doctor diagnostics. macOS,\nLinux, and Windows builds are checked in CI.\n\nAuthenticated commands use a managed browser profile. Chromium-compatible\nbrowsers are supported through Chrome DevTools Protocol. Firefox\u002FGecko-based\nbrowsers are supported through WebDriver BiDi.\n\n`snq` does not bundle a browser, import cookies from an existing browser\nprofile, or release tokens implicitly.\n\n## Install\n\nDownload a precompiled `snq` binary from the\n[latest GitHub release](https:\u002F\u002Fgithub.com\u002Ftivris\u002Fscinet-queue\u002Freleases\u002Flatest).\n\nRelease archives are published for:\n\n- `x86_64-unknown-linux-gnu`\n- `x86_64-apple-darwin`\n- `aarch64-apple-darwin`\n- `x86_64-pc-windows-msvc`\n\nUnpack the archive for your platform, move `snq` or `snq.exe` somewhere on\nyour `PATH`, and check it:\n\n```sh\nsnq --help\n```\n\nEach release includes `SHA256SUMS` for the uploaded archives.\n\nYou can also install from source with Rust 1.85 or newer:\n\n```sh\ncargo install --locked --git https:\u002F\u002Fgithub.com\u002Ftivris\u002Fscinet-queue --tag v0.1.0\n```\n\nInstall from a local checkout:\n\n```sh\ncargo install --locked --path .\n```\n\n## Quick Start\n\nLog in once, import DOIs, request them, wait for PDFs, fetch them, then mark\nreviewed papers as approved in the local queue:\n\n```sh\nsnq login\nsnq import research-papers.md\nsnq request --all --reward 1\nsnq watch\nsnq fetch --wait --poll 30 --out papers\nsnq approve 10.1000\u002Fsnq-example\nsnq release 10.1000\u002Fsnq-example --confirm-token-release\n```\n\nApproval is always explicit. `snq approve` records local review state only; it\ndoes not release tokens. `snq release` is the separate remote action, and it\nonly proceeds when Sci-Net exposes a visible accept\u002Frelease control for that\nrequest.\n\n## Queue Basics\n\nAdd one or more DOIs directly:\n\n```sh\nsnq add 10.1000\u002Fsnq-example\n```\n\nImport DOIs from a plain text or Markdown file:\n\n```sh\nsnq import papers.md\n```\n\nUse `snq import -` to read from stdin.\n\nList or remove queued entries:\n\n```sh\nsnq list\nsnq remove 10.1000\u002Fsnq-example\n```\n\n`snq` stores the queue in `.snq\u002Fqueue.jsonl` in the current workspace.\n\n## Sci-Net Commands\n\nCheck whether Sci-Net can find a DOI:\n\n```sh\nsnq check 10.1000\u002Fsnq-example\n```\n\nShells such as zsh treat some DOI characters, including parentheses, as glob\nsyntax. Quote DOIs with shell metacharacters:\n\n```sh\nsnq check '10.1016\u002Fs0272-5231(21)01013-3'\n```\n\nRequest one queued paper, or request all queued papers:\n\n```sh\nsnq request '10.1016\u002Fs0272-5231(21)01013-3' --reward 1\nsnq request --all --reward 1\n```\n\nIf `--reward` is omitted, `snq` uses `1`.\nAdd `--budget-check` to read the visible Sci-Net token balance first and fail\nbefore posting any request if the balance cannot be read or cannot cover\n`reward * targeted DOI count`:\n\n```sh\nsnq balance\nsnq request --all --reward 1 --budget-check\n```\n\nIf Sci-Net reports that a request cannot be created but `snq` can see the same\nDOI on an existing request page, `snq` syncs the local queue to that remote\nstate. A remote `pending` request becomes local `requested`; a remote `working`\nrequest becomes local `working`. A remote page with a PDF link remains local\n`requested` until `snq fetch` downloads and validates the file.\n\nWatch requested and working entries for visible PDF uploads:\n\n```sh\nsnq watch\n```\n\nThe text output includes the local status, Sci-Net state, DOI, and a suggested\nnext action such as `wait`, `release`, or `fetch`. Sci-Net may report `solved`\nbefore a direct PDF link is visible; in that state the visible `view` action can\nrelease the reward, so `snq fetch` will not open it until token release has been\nexplicitly confirmed.\n\nInspect one remote request:\n\n```sh\nsnq view 10.1000\u002Fsnq-example\n```\n\nPrint the Sci-Net request URL for a DOI without opening a browser:\n\n```sh\nsnq url '10.1016\u002Fs0272-5231(21)01013-3'\n```\n\nDownload one available PDF, or fetch available PDFs for queued, requested, and\nworking entries:\n\n```sh\nsnq fetch 10.1000\u002Fsnq-example --out papers\nsnq fetch --out papers\n```\n\nWhen Sci-Net reports open-access or Sci-Hub availability but no request-page PDF\nis downloadable yet, `snq fetch` reports that availability instead of treating\nthe DOI as simply pending. `snq` does not download from publisher pages,\nopen-access repositories, or Sci-Hub itself. In JSON output, resolved provider\nURLs are included when Sci-Net exposes them.\n\nIf `snq fetch \u003Cdoi>` sees an existing pending Sci-Net request for the same DOI,\nit creates or updates the local queue entry as `requested`. If Sci-Net redirects\nto a generic page that does not match the DOI, the remote state is reported as\n`not-found` and the queue is left unchanged.\n\nKeep polling until every targeted DOI reaches an actionable outcome: a\ndownloadable request-page PDF, or a Sci-Net availability hint such as\nopen-access or Sci-Hub:\n\n```sh\nsnq fetch --wait --poll 30 --out papers\n```\n\nWhile waiting, `snq fetch --wait` prints compact progress when Sci-Net state\nchanges, for example `state working \u003Cdoi>`. With `--json`, the final result\nstays on stdout and progress events are written to stderr as JSONL.\n\nMark a fetched paper as reviewed in the local queue:\n\n```sh\nsnq approve 10.1000\u002Fsnq-example\n```\n\nBy default, the queue entry must already be fetched. Use `--force` only when\nthe PDF was reviewed outside `snq`.\n\nRelease the Sci-Net reward after review, or when Sci-Net reports a solved\nrequest whose `view` action is required before the PDF can be downloaded:\n\n```sh\nsnq release 10.1000\u002Fsnq-example --confirm-token-release\n```\n\nThis is intentionally separate from `approve`. It checks the remote request\npage and refuses to guess hidden endpoints. If Sci-Net exposes only a solved\n`view` action, `snq release` treats that as the token-release boundary and keeps\nit behind `--confirm-token-release`.\n\n## JSON Output\n\nAgent-facing JSON is available for commands that need structured output:\n\n```sh\nsnq session --json\nsnq balance --json\nsnq browsers --json\nsnq list --json\nsnq request --all --reward 1 --budget-check --json\nsnq watch --json\nsnq view 10.1000\u002Fsnq-example --json\nsnq fetch --json\nsnq approve 10.1000\u002Fsnq-example --json\nsnq release 10.1000\u002Fsnq-example --confirm-token-release --json\nsnq doctor --json\n```\n\n`snq check \u003Cdoi>` prints the Sci-Net response as JSON without a separate\n`--json` flag.\n\nExample `snq list --json` output:\n\n```json\n[\n  {\n    \"doi\": \"10.1000\u002Fsnq-example\",\n    \"status\": \"working\",\n    \"created_at\": 1779283748,\n    \"updated_at\": 1779285046\n  }\n]\n```\n\nExample `snq watch --json` output:\n\n```json\n[\n  {\n    \"doi\": \"10.1000\u002Fsnq-example\",\n    \"previous_status\": \"requested\",\n    \"status\": \"working\",\n    \"status_changed\": true,\n    \"remote_state\": \"solved\",\n    \"next_action\": \"release\"\n  }\n]\n```\n\nExample `snq request --json` output when Sci-Net already has a pending request:\n\n```json\n[\n  {\n    \"doi\": \"10.1000\u002Fsnq-example\",\n    \"status\": \"requested\",\n    \"remote_state\": \"pending\",\n    \"response\": {\n      \"ok\": true,\n      \"status\": 200,\n      \"body\": {\n        \"error\": true\n      }\n    }\n  }\n]\n```\n\nExample `snq fetch --json` output:\n\n```json\n[\n  {\n    \"doi\": \"10.1000\u002Fsnq-example\",\n    \"status\": \"no-pdf\",\n    \"remote_state\": \"working\",\n    \"availability\": [\"open-access\", \"sci-hub\"],\n    \"availability_links\": [\n      {\n        \"source\": \"sci-hub\",\n        \"url\": \"https:\u002F\u002Fsci-hub.example\u002F10.1000\u002Fsnq-example\"\n      }\n    ],\n    \"path\": null\n  }\n]\n```\n\nExample `snq approve --json` output:\n\n```json\n{\n  \"doi\": \"10.1000\u002Fsnq-example\",\n  \"status\": \"approved\",\n  \"forced\": false\n}\n```\n\nExample `snq release --json` output:\n\n```json\n{\n  \"doi\": \"10.1000\u002Fsnq-example\",\n  \"status\": \"released\",\n  \"local_status\": \"released\",\n  \"remote_state\": \"pdf\",\n  \"remote_action\": \"token-release\",\n  \"confirmed\": true,\n  \"irreversible\": true,\n  \"response\": {\n    \"ok\": true,\n    \"status\": 200,\n    \"body\": {\n      \"success\": true\n    }\n  }\n}\n```\n\n## Browser Sessions\n\nAuthenticated Sci-Net commands run through a `snq`-managed browser profile.\nThe profile is separate from the user's normal browser profile.\n\nThe browser support model is engine\u002Fprotocol oriented:\n\n| Engine family | Protocol | Status |\n| --- | --- | --- |\n| Chromium-compatible | Chrome DevTools Protocol | Supported |\n| Firefox\u002FGecko-based | WebDriver BiDi | Supported |\n\n`snq` discovers a compatible browser on the system. To choose a specific\nbrowser binary for the current workspace, run:\n\n```sh\nsnq browsers --pick\n```\n\nFor scripts or agents, set the path explicitly:\n\n```sh\nsnq browsers --set \u002Fpath\u002Fto\u002Fbrowser\n```\n\nOn macOS, `\u002FApplications\u002FFirefox.app`-style app bundle paths and concrete\n`Contents\u002FMacOS\u002F...` executable paths are both accepted.\n\nThe workspace browser preference is stored in `.snq\u002Fbrowser.json`. It is local\nto the current workspace, checked every time it is used, and can be removed\nwith:\n\n```sh\nsnq browsers --clear\n```\n\nSelection order is:\n\n1. `SCINET_QUEUE_BROWSER`, when set.\n2. `.snq\u002Fbrowser.json`, when present and valid.\n3. The first discovered compatible browser.\n\nIf more than one compatible browser is available and no preference exists,\ninteractive login and authenticated commands ask once and save the answer. JSON\nand noninteractive paths do not prompt.\n\nTo inspect discovery and the active selection, run:\n\n```sh\nsnq browsers\nsnq browsers --json\n```\n\nIf `.snq\u002Fbrowser.json` is edited by hand and becomes invalid, authenticated\ncommands fail until the preference is cleared or replaced.\n\nTo override everything without writing `.snq\u002Fbrowser.json`, set:\n\n```sh\nSCINET_QUEUE_BROWSER=\u002Fpath\u002Fto\u002Fbrowser\n```\n\n`snq login` opens the managed profile and waits until Sci-Net is logged in:\n\n```sh\nsnq login\n```\n\nAfter login is detected, `snq` closes that browser cleanly so authenticated\ncommands can reuse the managed profile headlessly. Use `snq login --no-wait` to\nleave the login browser open; finish login and close that browser before\nrunning `snq session`, `snq fetch`, or other authenticated commands. The\nprinted PID is the launcher process; on macOS the long-lived app process may\nhave a different PID. While that login browser remains open, it owns the\nmanaged profile and later authenticated commands may fail until it is closed.\n\n`snq session` starts the managed profile headlessly and checks whether Sci-Net\nloads with a logged-in session:\n\n```sh\nsnq session\nsnq session --json\nsnq session --json --redact\n```\n\n`snq balance` starts the same managed profile headlessly and prints the visible\nSci-Net token balance:\n\n```sh\nsnq balance\nsnq balance --json\n```\n\n`snq doctor` checks browser discovery, profile path resolution, queue\nreadability, Sci-Net session state, and the visible token balance when it can\nbe read:\n\n```sh\nsnq doctor\nsnq doctor --json\nsnq doctor --json --redact\n```\n\n`snq doctor` exits nonzero if any check fails. Add `--redact` before posting\nsession or doctor output publicly; it hides local home paths and token balances\nwhile keeping the useful pass\u002Ffail shape.\n\nThe login flow avoids decrypting cookies from existing browser profiles or the\noperating system keychain. Importing an existing browser profile is outside the\ndefault flow.\n\n## Storage\n\nQueue state is workspace-local by default. Account and browser profile state\nlives under the user's platform state directory.\n\nThe queue is plain and inspectable:\n\n```text\n.snq\u002F\n  browser.json\n  queue.jsonl\n  queue.lock\npapers\u002F\n```\n\n## Design\n\n- Native CLI.\n- Plain local state.\n- Explicit commands.\n- Sci-Net-specific behavior.\n- No Selenium.\n- No bundled browser.\n- No background daemon by default.\n- No token approval without an explicit user command.\n\n## Known Limitations\n\n- Authenticated commands require a supported browser engine: Chromium-compatible\n  through Chrome DevTools Protocol or Firefox\u002FGecko-based through WebDriver\n  BiDi.\n- Sci-Net is a third-party website. UI or endpoint changes can break request\n  detection, PDF detection, download behavior, or token release actions.\n- `snq approve` is local review state only. Use `snq release\n  --confirm-token-release` for the explicit remote token action.\n- `snq` does not import cookies from an existing personal browser profile.\n\n## Responsible Use\n\n`scinet-queue` is an independent tool for automating a user's own Sci-Net\nsession for lawful educational and research workflows. It is not affiliated\nwith Sci-Net, any third-party paper index, repository, or publisher. It does\nnot bypass authentication, paywalls, access controls, or usage terms. Use it\nonly where you have the right to request, download, and store the papers\ninvolved.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\nObserved Sci-Net behavior is documented in [docs\u002Fbehavior.md](docs\u002Fbehavior.md).\n","`scinet-queue` 是一个用于管理 Sci-Net 论文请求的小型命令行工具。该项目采用 Rust 语言开发，支持工作区本地队列、浏览器选择、登录\u002F会话检查、Sci-Net 请求\u002F查看\u002F获取等工作流、本地审批状态、令牌余额和预算检查以及 JSON 输出等功能。该工具适用于需要批量处理学术论文请求的研究人员或团队，尤其在跨平台（macOS、Linux 和 Windows）环境下使用时更为方便。通过支持基于 Chromium 的浏览器和 Firefox\u002FGecko 浏览器，用户可以利用已有的浏览器配置进行认证操作，无需额外导入 cookie 或隐式释放令牌。","2026-06-11 04:06:56","CREATED_QUERY"]