@callimacus/auth

中文文档
1.8.4发布于 2026/11/09UNLICENSEDTypeScriptES Module近 30 天下载 2099

Public bootstrap for Callimacus: callimacus login configures the private SDK registry (.npmrc) + API access. The full tool is the private @callimacus/callimacus-cli.

原始使用文档
文档目录5 节
  1. First run
  2. Commands
  3. CI
  4. Configuration
  5. Notes

@callimacus/auth

The public bootstrap for Callimacus. One callimacus login configures everything a developer needs to build on Callimacus: the private SDK download (~/.npmrc) and API access — with zero prior setup.

This package is intentionally small and public so a new client can run it before they have any credentials. The full operator/tenant-config CLI is the private @callimacus/callimacus-cli, installable only after login configures the registry.

npx @callimacus/auth login

Prefer npx. Both this package and @callimacus/callimacus-cli install a binary named callimacus, so a global install of this one can win the $PATH race and shadow the full tool. Since 1.2.0 the full CLI mounts these same commands, so once it is installed you do not need this package on $PATH at all — callimacus login works from either.

Requires Node.js ≥ 24 (the active LTS). Supported Node lines are the current LTS and newer. The hard technical floor is 22.12.0 — commander v15 is ESM-only and is loaded via require(esm), which Node only supports from 22.12.0 on — but Node 22 is in maintenance and is not a supported target.

First run

npx @callimacus/auth login          # sign in on the hosted page → writes ~/.npmrc + the API profile
npm i -g @callimacus/callimacus-cli # now installs (private, via the configured registry)
callimacus login                    # the full tool carries these commands too, from 1.2.0
callimacus configure …              # …alongside everything else

login signs you in with the same identity as the Studio — passkey, magic code or SSO — on the hosted WorkOS sign-in page: it prints a URL + short code and opens your browser (falling back to "paste this URL" on headless boxes). One sign-in covers every project you belong to, and every one gets a profile (--project <id>, repeatable, narrows it). From 1.7.0 the sign-in itself is kept — no key is minted per project, and a project is entered the first time a command needs it. The registry token goes to user-level ~/.npmrc; the session (your WorkOS refresh token) is stored once per host in ~/.callimacus/config.json, with a profile per project picked that holds no secret — the same file @callimacus/callimacus-cli reads, so this one login configures that CLI too. Each command asks core for a short-lived access token for its project (/cli/token) and caches it for the hour it lives; you act as yourself, with your role in that project, and leaving the organization ends it. The session lasts 30 days (7 idle), then login runs again. The active profile is the first project picked (an already-active one stays active when it is refreshed); callimacus use <project> switches.

An app still needs a key pair of its own, never your session: callimacus scaffold in its directory mints one in the active project and writes it to .env. A browser app takes callimacus scaffold --frontend: only the public key, as VITE_CALLIMACUS_CLIENT_ID, never the secret. CI and callimacus configure keep using key pairs as before.

Core enforces each organization's sign-in policy per project: one that requires SSO or MFA enrolment you have not completed, a parked tenant, or a membership with no role core knows is listed with the reason and the others still land. Sign in to that project in the Studio once, then run login again.

This needs a Callimacus host on a core release that serves /cli/session, /cli/credentials and /cli/token; on a host that predates /cli/token, login says so and npx @callimacus/[email protected] login still mints key pairs. An older host, or one without CLI sign-in enabled, answers that it has no CLI sign-in configured yet, and login says so.

Commands

CommandWhat it does
login [--project <id>]…Sign in once on the hosted WorkOS page (passkey, magic code or SSO), keep the session for every project you belong to (or only those named with --project), and receive the registry token. --all is the default, accepted for scripts. Or no-op materialize from CALLIMACUS_NPM_TOKEN in CI.
scaffold [--profile <name>] [--frontend]Scaffold the current project: .npmrc scope map, .env API key (minted for the app when you are signed in with a session), .gitignore. The key is for the credentials whoami shows (--profile, then CALLIMACUS_PROFILE, then the environment pair, then the active profile). --frontend is for a browser app: .env gets only the public key, as VITE_CALLIMACUS_CLIENT_ID. Named init before 1.2.0 — renamed because the full CLI has an unrelated init, and Commander shadows a duplicate name silently.
whoami [--profile <name>]Show the active profile + project (or the one named), and whether ~/.npmrc is configured.
use <project>Switch the active project profile.
logout [project]Remove every profile, the session and the registry lines in ~/.npmrc; or, with a project named (or --profile <name>), only that profile, leaving the session and ~/.npmrc to the others.
setup-ci [--print]Configure the registry from CALLIMACUS_NPM_TOKEN (writes ~/.npmrc, or prints with --print).

CI

A developer with several projects has one registry token (machine-level) and one session. In CI, skip the browser:

env:
  CALLIMACUS_NPM_TOKEN: ${{ secrets.CALLIMACUS_NPM_TOKEN }}   # the registry token
steps:
  - run: npx @callimacus/auth setup-ci   # writes ~/.npmrc headlessly
  - run: npm ci

Configuration

Env varDefaultPurpose
CALLIMACUS_API_URLhttps://api.callimacus.aiAPI host (/cli/config, /cli/session, /cli/credentials). Override for dev.
CALLIMACUS_REGISTRY_URLhttps://npm.callimacus.aiPrivate registry the .npmrc points at.
CALLIMACUS_NPM_TOKEN—Registry token for non-interactive login/setup-ci. The former name CALLIMACUS_TOKEN is still accepted (with a deprecation warning).

Notes

  • Config interop: writes ~/.callimacus/config.json in the exact schema @callimacus/callimacus-cli (its lib/config.ts) reads, so the two share one profile.
  • SDK env var names: scaffold writes CALLIMACUS_CLIENT_ID / CALLIMACUS_CLIENT_SECRET to .env — the current names the @callimacus/callimacus-sdk env wrapper reads (CALLIMACUS_PUBLIC_KEY/PRIVATE_KEY still work but the SDK logs a deprecation warning).
  • No native deps: pure Node + commander and @clack/prompts (≥ Node 24 LTS), so npm i -g / npx work on Windows, Linux, macOS, and WSL. 0600/0700 file modes are enforced on Unix; on Windows they no-op and the files rely on the user-scoped profile dir (same posture as aws/gcloud/gh).

版本与发布记录

@callimacus/auth 共发布 18 个版本,首次发布于 2026/09/29;过去 12 个月发布了 18 个版本。

版本发布日期距今
1.8.4latest2026/11/09今天
1.8.32026/11/045 天前
1.8.22026/11/036 天前
1.8.12026/11/018 天前
1.8.02026/10/2713 天前
1.7.32026/10/2515 天前

关于 @callimacus/auth 的常见问题

@callimacus/auth 是什么?

Public bootstrap for Callimacus: callimacus login configures the private SDK registry (.npmrc) + API access. The full tool is the private @callimacus/callimacus-cli.

如何安装 @callimacus/auth?

在项目目录运行 npm install @callimacus/auth,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 callimacus,可以用 npx callimacus 直接运行。

@callimacus/auth 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@callimacus/auth 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@callimacus/auth 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@callimacus/auth 可以商用吗?

@callimacus/auth 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@callimacus/auth 的下载量有多少?

根据 npm 官方下载统计,@callimacus/auth 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,099 次,日均约 70 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@callimacus/auth 还在维护吗?

最新版本 1.8.4 发布于 2026/11/09(今天);至今共发布 18 个版本,其中过去 12 个月发布了 18 个;首次发布于 2026/09/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。